First, last includes for body, footer, head, header, and main tags
This commit is contained in:
18
README.md
18
README.md
@@ -767,8 +767,22 @@ Parameters:
|
|||||||
|
|
||||||
## Customize
|
## Customize
|
||||||
|
|
||||||
If `partials/paige/head-last.html` exists in the site, it is included at the end of the head tag.
|
### Include
|
||||||
If `partials/paige/body-last.html` exists in the site, it is included at the end of the body tag.
|
|
||||||
|
| If this file exists in the site | It is included at |
|
||||||
|
| ------------------------------- | ----------------- |
|
||||||
|
| `partials/paige/body-first.html` | The beginning of the body tag |
|
||||||
|
| `partials/paige/body-last.html` | The end of the body tag |
|
||||||
|
| `partials/paige/footer-first.html` | The beginning of the footer tag |
|
||||||
|
| `partials/paige/footer-last.html` | The end of the footer tag |
|
||||||
|
| `partials/paige/head-first.html` | The beginning of the head tag |
|
||||||
|
| `partials/paige/head-last.html` | The end of the head tag |
|
||||||
|
| `partials/paige/header-first.html` | The beginning of the header tag |
|
||||||
|
| `partials/paige/header-last.html` | The end of the header tag |
|
||||||
|
| `partials/paige/main-first.html` | The beginning of the main tag |
|
||||||
|
| `partials/paige/main-last.html` | The end of the main tag |
|
||||||
|
|
||||||
|
### Override
|
||||||
|
|
||||||
Most code is in partial templates that are included by the default layouts.
|
Most code is in partial templates that are included by the default layouts.
|
||||||
Elements can be added, changed, or removed easily by overriding the corresponding default layout or partial template.
|
Elements can be added, changed, or removed easily by overriding the corresponding default layout or partial template.
|
||||||
|
@@ -4,12 +4,21 @@
|
|||||||
<html {{ if eq .Site.Params.paige.color_scheme `dark` }} data-bs-theme="dark" {{ end }} {{ if $rtl }} dir="rtl" {{ end }} {{ with $lang }} lang="{{ . }}" {{ end }}>
|
<html {{ if eq .Site.Params.paige.color_scheme `dark` }} data-bs-theme="dark" {{ end }} {{ if $rtl }} dir="rtl" {{ end }} {{ with $lang }} lang="{{ . }}" {{ end }}>
|
||||||
{{ partial "paige/head.html" . }}
|
{{ partial "paige/head.html" . }}
|
||||||
{{ partial "paige/body.html" . }}
|
{{ partial "paige/body.html" . }}
|
||||||
|
{{ if templates.Exists "partials/paige/body-first.html" }}
|
||||||
|
{{ partial "paige/body-first.html" . }}
|
||||||
|
{{ end }}
|
||||||
<div class="container flex-fill">
|
<div class="container flex-fill">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
{{ partial "paige/header.html" . }}
|
{{ partial "paige/header.html" . }}
|
||||||
<main>
|
<main>
|
||||||
|
{{ if templates.Exists "partials/paige/main-first.html" }}
|
||||||
|
{{ partial "paige/main-first.html" . }}
|
||||||
|
{{ end }}
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }}{{ end }}
|
||||||
|
{{ if templates.Exists "partials/paige/main-last.html" }}
|
||||||
|
{{ partial "paige/main-last.html" . }}
|
||||||
|
{{ end }}
|
||||||
</main>
|
</main>
|
||||||
{{ partial "paige/footer.html" . }}
|
{{ partial "paige/footer.html" . }}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,11 +1,22 @@
|
|||||||
{{ if or .Site.Copyright (not .Site.Params.paige.hide_theme_link) }}
|
{{ $copyright := .Site.Copyright }}
|
||||||
|
{{ $first := templates.Exists "partials/paige/footer-first.html" }}
|
||||||
|
{{ $last := templates.Exists "partials/paige/footer-last.html" }}
|
||||||
|
{{ $showlink := not .Site.Params.paige.hide_theme_link }}
|
||||||
|
|
||||||
|
{{ if or $copyright $first $last $showlink }}
|
||||||
<footer>
|
<footer>
|
||||||
{{ if and .Site.Copyright (not .Site.Params.paige.hide_theme_link) }}
|
{{ if $first }}
|
||||||
<p class="text-center text-secondary">{{ .Site.Copyright | markdownify }} · <a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
|
{{ partial "paige/footer-first.html" . }}
|
||||||
{{ else if .Site.Copyright }}
|
{{ end }}
|
||||||
<p class="text-center text-secondary">{{ .Site.Copyright | markdownify }}</p>
|
{{ if and $copyright $showlink }}
|
||||||
{{ else if not .Site.Params.paige.hide_theme_link }}
|
<p class="text-center text-secondary">{{ $copyright | markdownify }} · <a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
|
||||||
|
{{ else if $copyright }}
|
||||||
|
<p class="text-center text-secondary">{{ $copyright | markdownify }}</p>
|
||||||
|
{{ else if $showlink }}
|
||||||
<p class="text-center"><a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
|
<p class="text-center"><a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if $last }}
|
||||||
|
{{ partial "paige/footer-last.html" . }}
|
||||||
|
{{ end }}
|
||||||
</footer>
|
</footer>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<head>
|
<head>
|
||||||
|
{{ if templates.Exists "partials/paige/head-first.html" }}
|
||||||
|
{{ partial "paige/head-first.html" . }}
|
||||||
|
{{ end }}
|
||||||
{{ partial "paige/metas.html" . }}
|
{{ partial "paige/metas.html" . }}
|
||||||
<title>{{ partial "paige/func-title.html" . }}</title>
|
<title>{{ partial "paige/func-title.html" . }}</title>
|
||||||
{{ partial "paige/links.html" . }}
|
{{ partial "paige/links.html" . }}
|
||||||
|
@@ -1,5 +1,17 @@
|
|||||||
{{ if .Site.Menus.main }}
|
{{ $first := templates.Exists "partials/paige/header-first.html" }}
|
||||||
|
{{ $last := templates.Exists "partials/paige/header-last.html" }}
|
||||||
|
{{ $menu := .Site.Menus.main }}
|
||||||
|
|
||||||
|
{{ if or $first $last $menu }}
|
||||||
<header>
|
<header>
|
||||||
{{ partial "paige/menu.html" . }}
|
{{ if $first }}
|
||||||
|
{{ partial "paige/header-first.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if $menu }}
|
||||||
|
{{ partial "paige/menu.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if $last }}
|
||||||
|
{{ partial "paige/header-last.html" . }}
|
||||||
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Reference in New Issue
Block a user