Skip to content

Commit

Permalink
(platenioGH-35) Inject CSS into body of _default/baseof.html
Browse files Browse the repository at this point in the history
This commit modifies the `_default/baseof.html` template to inject
a CSS class into the `body` tag, enabling Platen site maintainers
to override the styling for any page(s) via this mechanism.

This is a patch on top of the `layouts/_default/baseof.html` file
from the usptream project (alex-shpak/hugo-book). If the upstream
file is updated, we will need to replace our copy of the template
with the newer version and then cherry-pick this commit on top.
  • Loading branch information
binarystargames authored and michaeltlombardi committed Feb 11, 2022
1 parent ee73faf commit ae5d24f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{{ partial "docs/html-head" . }}
{{ partial "docs/inject/head" . }}
</head>
<body dir="{{ default "ltr" .Site.Language.LanguageDirection }}">
{{ $injectedClass := partial "platen/getCssClass.html" . }}
<body dir="{{ default "ltr" .Site.Language.LanguageDirection }}" class="{{ $injectedClass }}">
<input type="checkbox" class="hidden toggle" id="menu-control" />
<input type="checkbox" class="hidden toggle" id="toc-control" />
<main class="container flex">
Expand Down Expand Up @@ -80,4 +81,4 @@

{{ define "toc" }}
{{ partial "docs/toc" . }}
{{ end }}
{{ end }}

0 comments on commit ae5d24f

Please sign in to comment.