Format templates

master
Will Faught 2 years ago
parent 038b48bfc2
commit 469d6ee893

@ -12,10 +12,12 @@
{{ if templates.Exists "partials/paige/body-first.html" }}
{{ partial "paige/body-first.html" $page }}
{{ end }}
<div class="container flex-fill">
<div class="row">
<div class="col">
{{ partial "paige/header.html" $page }}
<main>
{{ if templates.Exists "partials/paige/main-first.html" }}
{{ partial "paige/main-first.html" $page }}
@ -25,11 +27,14 @@
{{ partial "paige/main-last.html" $page }}
{{ end }}
</main>
{{ partial "paige/footer.html" $page }}
</div>
</div>
</div>
{{ partial "paige/scripts.html" $page }}
{{ if templates.Exists "partials/paige/body-last.html" }}
{{ partial "paige/body-last.html" $page }}
{{ end }}

@ -5,6 +5,7 @@
<article>
{{ partial "paige/metadata.html" $page }}
<section>
{{ if $page.Param "paige.home.image.url" }}
{{ $class := cond ($stretch | not) "mw-100 rounded-4 shadow" "rounded-4 shadow w-100" }}
@ -21,9 +22,11 @@
) }}
</p>
{{ end }}
{{ with $page.Param "paige.home.greeting" }}
<p class="display-5 fw-bold h2 text-center">{{ . | markdownify }}</p>
{{ end }}
{{ with $page.Param "paige.home.blurb" }}
<div class="container-fluid">
<div class="justify-content-center row">
@ -34,6 +37,7 @@
</div>
{{ end }}
</section>
{{ partial "paige/toc.html" $page }}
{{ partial "paige/content.html" $page }}
{{ partial "paige/social.html" $page }}

@ -4,5 +4,6 @@
{{ if $page.Param "paige.list.content.show" | not }}
{{ partial "paige/article.html" $page }}
{{ end }}
{{ partial "paige/pages.html" $page }}
{{ end }}

@ -2,6 +2,7 @@
{{ $page := . }}
{{ partial "paige/article.html" $page }}
{{ if $page.Pages }}
<section>
<ul class="list-inline text-center">

@ -10,12 +10,15 @@
{{ if $first }}
{{ partial "paige/footer-first.html" . }}
{{ end }}
{{ if $copyright }}
<p class="{{ if $credit }} mb-0 {{ end }} text-center text-secondary">{{ $copyright | markdownify }}</p>
{{ end }}
{{ if $credit }}
<p class="text-center"><a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
{{ end }}
{{ if $last }}
{{ partial "paige/footer-last.html" . }}
{{ end }}

@ -4,10 +4,14 @@
{{ if templates.Exists "partials/paige/head-first.html" }}
{{ partial "paige/head-first.html" $page }}
{{ end }}
{{ partial "paige/metas.html" $page }}
<title>{{ partial "paige/func-title.html" $page }}</title>
{{ partial "paige/links.html" $page }}
{{ partial "paige/style.html" $page }}
{{ if templates.Exists "partials/paige/head-last.html" }}
{{ partial "paige/head-last.html" $page }}
{{ end }}

@ -9,9 +9,11 @@
{{ if $first }}
{{ partial "paige/header-first.html" $page }}
{{ end }}
{{ if $menu }}
{{ partial "paige/menu.html" $page }}
{{ end }}
{{ if $last }}
{{ partial "paige/header-last.html" $page }}
{{ end }}

@ -14,6 +14,7 @@
"page" $page
"url" (relLangURL $href)
)) | minify | fingerprint }}
{{ $href = $resource.RelPermalink }}
{{ $integrity = $resource.Data.Integrity }}
{{ end }}

@ -3,13 +3,16 @@
<link href="{{ relLangURL `apple-touch-icon.png` | safeURL }}" rel="apple-touch-icon" sizes="180x180">
<link href="{{ relLangURL `favicon-16x16.png` | safeURL }}" rel="icon" sizes="16x16" type="image/png">
<link href="{{ relLangURL `favicon-32x32.png` | safeURL }}" rel="icon" sizes="32x32" type="image/png">
{{ if ne (relLangURL "favicon.ico") "/favicon.ico" }}
<link href="{{ relLangURL `favicon.ico` | safeURL }}" rel="shortcut icon">
{{ end }}
<link href="{{ relLangURL `favicon.png` | safeURL }}" rel="icon" type="image/png">
<link href="{{ relLangURL `favicon.svg` | safeURL }}" rel="icon" type="image/svg+xml">
<link color="{{ $page.Param `paige.color` | default `#0d6efd` }}" href="{{ relLangURL `safari-pinned-tab.svg` | safeURL }}" rel="mask-icon">
<link href="{{ relLangURL `site.webmanifest` | safeURL }}" rel="manifest">
{{ partial "paige/link.html" (dict
"href" ($page.Param "paige.bootstrap.icons.link_href" | default "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css")
"integrity" ($page.Param "paige.bootstrap.icons.link_integrity")
@ -20,6 +23,7 @@
"integrity" ($page.Param "paige.bootstrap.style.link_integrity")
"raw" ($page.Param "paige.bootstrap.style.raw")
) }}
{{ if or ($page.Param "paige.math") (and ($page.Param "paige.list.content.show") (where $page.Pages "Params.paige.math" "eq" true)) }}
{{ partial "paige/link.html" (dict
"href" ($page.Param "paige.katex.style.link_href" | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css")
@ -27,6 +31,7 @@
"raw" true
) }}
{{ end }}
{{ if .AlternativeOutputFormats }}
{{ $title := partial "paige/func-title.html" $page }}
{{ range .AlternativeOutputFormats }}

@ -31,6 +31,7 @@
{{ $pagepath := strings.TrimPrefix $basepath $.RelPermalink }}
{{ $menupath := strings.TrimPrefix $basepath .URL }}
{{ $active := or (and (eq $menupath "/") (eq $pagepath "/")) (and (ne $menupath "/") (hasPrefix $pagepath $menupath)) }}
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} link-secondary {{ end }} {{ end }} nav-link" href="{{ .URL | safeURL }}">{{ .Name }}</a>
{{ end }}
</div>

@ -1,20 +1,27 @@
{{ $page := . }}
<meta charset="utf-8">
{{ with partial "paige/func-authors.html" $page }}
<meta content="{{ . }}" name="author">
{{ end }}
{{ with $page.Description }}
<meta content="{{ . }}" name="description">
{{ end }}
{{ if or $page.Keywords $page.Params.tags $page.Params.categories }}
<meta content="{{ delimit (sort (union (union $page.Keywords $page.Params.tags) $page.Params.categories)) `, ` }}" name="keywords">
{{ end }}
<meta content="{{ $page.Param `paige.color` | default `#0d6efd` }}" name="msapplication-TileColor">
{{ if ne (relLangURL "browserconfig.xml") "/browserconfig.xml" }}
<meta content="{{ relLangURL `browserconfig.xml` }}" name="msapplication-config" >
{{ end }}
<meta content="{{ $page.Param `paige.color` | default `#0d6efd` }}" name="theme-color">
<meta content="width=device-width, initial-scale=1" name="viewport">
{{ template "_internal/opengraph.html" $page }}
{{ template "_internal/twitter_cards.html" $page }}

@ -16,6 +16,7 @@
"page" $page
"url" (relLangURL $src)
)) | minify | fingerprint }}
{{ $integrity = $resource.Data.Integrity }}
{{ $src = $resource.RelPermalink }}
{{ end }}

Loading…
Cancel
Save