Partials are expected under layouts/partials/wtg-theme/helpers
and
wtg-theme/output
in order to avoid conflicting with modules from
other developers.
For function (no output) partials
For output partials
[params] topLevelClass = "has-js"
+++
…
topLevelClass = "has-js"
…
+++
Some page content.
…
Using cascade allows to set the param on multiple pages at once.
See the Hugo documentation of cascade
for details.
Defaults to "no-js" meaning the assumption is that no javascript should be running on the page.
With "has-js", a script that runs on page load will replace "has-js" with "use-js", and any element that has a "default-hide-js" class will have that class replaced with "default-show-js".
Defaults to not adding a class to the body. Setting the
bodyClass
param as described above, will add the
string provided as a class to the <body>
element.
The page can be hidden via param (user) by setting omitPageHeader
to true
. Alternatively a layout can override the body-header
block.
If the page has a <header>
element at the top of the <body>
(the default),
then setting the bodyHeaderClass
param will use string provided as the
class(es) for that <header>
.
If the page has a <main>
element (the default), then
setting the bodyMainClass
param will use string provided as the
class(es) for that <main>
.
If the page has a <main>
element (the default), then setting
the bodyMainId
param will use string provided as the
id for that <main>
.
This is a function partial…no page text/elements/etc may be output by this
partial (warnf
and errorf
are okay). This exists to do things like
'collect' CSS and JS from other layouts (called in the body).
_default/list.html
Uses partial wtg-theme/output/layout-default-list.html
if
present, otherwise
{{- .Content -}}
{{- range .Data.Pages }}
<ul>
<li><a href="{{ .RelPermalink }}">[Uses partial "…helpers/find-link-title]</a></li>
</ul>
{{- end -}}
_default/list.html
Uses partial wtg-theme/output/layout-default-single.html
if present, otherwise
{{ .Content -}}
404.html
Uses partial wtg-theme/output/layout-404.html
if present,
otherwise
<p>404 Page not found</p>