26 Commits

Author SHA1 Message Date
ba9c106a88 Add data-pagefind-body to main content element
In preparation for adding Pagefind search support to bbaovanc.com. Those
templates will just go in the bbaovanc.com tree instead.
2025-07-02 01:21:05 -05:00
150ee40fd5 Fix website title not showing up in OpenGraph tags
I don't know how I never noticed this or how long it's been missing.
Maybe it was never there?
2025-07-02 01:20:11 -05:00
ca0f8d390c Add workaround for code icon being chopped off on side
Introduced by 16f08dce7f. Since the aspect
ratio of the icon isn't square, it's too wide and collides with the text
next to it. Would be nice to follow #82 and switch to a better
maintained icon pack.
2025-07-01 02:57:55 -05:00
62f0d42140 Add possibility for adding custom meta items to page
Fixes #67
2025-07-01 02:48:37 -05:00
16f08dce7f Tweak icon size and alignment
Use em units so it matches the text size automatically. Using sub for
vertical-align seems to look a little nicer? Maybe only so because now
the height of icon matches the font size now.
2025-07-01 02:09:15 -05:00
c06e7eb938 Remove assets/js/share-event.js
Moved this completely to bbaovanc.com repo. I think it was here as a
placeholder purely because of some issue with global resources not
working in the past. It seems like it maybe works fine now though.
2025-07-01 00:52:33 -05:00
5a957bc745 Fix __hugo_ctx in include shortcode
See posts 2 and 3:
https://discourse.gohugo.io/t/weird-hugo-ctx-pid-34-inside-rendershortcodes/55176?u=bbaovanc

The 4 spaces causes it to think it's an inline code block.
2025-06-29 16:18:37 -05:00
67ac36e9e2 Use resources to power the include shortcode
https://github.com/gohugoio/hugo/issues/13823#issuecomment-3015270202

Then I can just create unrendered pages for snippets. It fixes all the
markdown rendering related woes.
2025-06-29 03:41:37 -05:00
6ff0ffb80b Fix section summary rendering (Hugo 0.146)
Didn't notice this was broken because my public website doesn't use
subsections at all.
2025-06-29 02:36:58 -05:00
ff4998f31b debug: Show current template filename in bottom right
Only displayed when running live server. May remove in the future, just
need it now to make it much easier to reorganize some of the templates.
2025-06-28 03:25:46 -05:00
1aa2f8ea5c Move template files based on Hugo v0.146 revamp
See https://gohugo.io/templates/new-templatesystem-overview/

Under layouts/
- mv _default/* .
- mv partials _partials
- mv shortcodes _shortcodes
- mv taxonomy/list.html taxonomy.html
- mv taxonomy/term.html term.html
2025-06-28 03:07:02 -05:00
6e7160efbb Remove exampleSite
This isn't really kept up to date these days, the example site is
bbaovanc.com.
2025-04-20 04:41:57 -05:00
04c3c007a8 Fix pagination for Hugo 0.146 2025-04-20 04:34:15 -05:00
ad7432155f Update jam icons repo to my own reupload 2025-04-19 01:13:33 -05:00
0aaf865b75 Rename privacy.twitter.enableDNT to x due to deprecation in Hugo 2025-04-19 00:58:23 -05:00
c9095e948b Replace table shortcode with markdown attributes for class 2024-11-15 17:25:46 -06:00
ddb57e0120 Merge branch 'markdown-output' 2024-10-01 13:30:00 -05:00
9b851ce0e4 Add "View raw" button to page to view raw markdown code of page 2024-10-01 13:29:14 -05:00
f34cffb849 Make markdown output "ugly"
This makes it so, for example, `/blog/swapfile-guide` has markdown file
at `/blog/swapfile-guide.md` instead of `/blog/swapfile-guide/index.md`.
2024-10-01 13:28:19 -05:00
91994df910 Create markdown output template
Further progress is blocked by Hugo feature requests:

- https://discourse.gohugo.io/t/render-alternative-output-format-outside-of-leaf-bundle-subdirectory/46968
- https://github.com/gohugoio/hugo/issues/8927
2024-09-28 20:10:22 -05:00
e84f334591 Replace paginate with pagination.pagerSize in hugo.yaml 2024-09-24 21:17:41 -05:00
ebf39263a6 Replace use of deprecated .Site.Social 2024-08-29 20:39:34 -05:00
77afe66aa6 Support custom keywords instead of defaulting to using tags
Now can set `keywords:` in the front matter for actual keywords
2024-01-22 20:44:54 -06:00
788583ea23 Update syntax styles to fix user-select
Turns out the last commit didn't work because bobastyle.css has lower
priority than the syntax CSS. But Hugo must've updated the styles
upstream because it's fixed after regenerating.
2023-12-01 20:05:42 -06:00
4216b9ed6f Add vendor-prefixed user-select to code block line numbers 2023-12-01 19:57:39 -06:00
54e639ecc3 Don't automatically put copyright in <p> 2023-11-11 20:33:08 -06:00
65 changed files with 266 additions and 141 deletions

2
.gitmodules vendored
View File

@ -1,4 +1,4 @@
[submodule "assets/jam"] [submodule "assets/jam"]
path = assets/jam path = assets/jam
url = https://github.com/michaelampr/jam.git url = https://github.com/BBaoVanC/jam.git
branch = master branch = master

View File

@ -248,31 +248,31 @@ hr {
} }
} }
table.markdown { table.simple {
border-collapse: collapse; border-collapse: collapse;
border: 2px solid var(--text-1); border: 2px solid var(--text-1);
} }
table.markdown thead { table.simple thead {
background-color: var(--background-2); background-color: var(--background-2);
color: var(--text-2); color: var(--text-2);
border-bottom: 2px solid var(--text-1); border-bottom: 2px solid var(--text-1);
} }
table.markdown th, table.simple th,
table.markdown td { table.simple td {
padding: 8px; padding: 8px;
} }
table.markdown :is(th, td) + :is(th, td) { table.simple :is(th, td) + :is(th, td) {
border-left: 2px solid var(--text-1); border-left: 2px solid var(--text-1);
} }
table.markdown tbody tr:nth-child(odd) { table.simple tbody tr:nth-child(odd) {
background-color: var(--background-0); background-color: var(--background-0);
color: var(--text-0); color: var(--text-0);
} }
table.markdown tbody tr:nth-child(even) { table.simple tbody tr:nth-child(even) {
background-color: var(--background-1); background-color: var(--background-1);
color: var(--text-1); color: var(--text-1);
} }
@ -291,17 +291,17 @@ table.markdown tbody tr:nth-child(even) {
/* Icons */ /* Icons */
.icon { .icon {
width: 20px; width: 1em;
height: 20px; height: 1em;
color: var(--text-1); color: var(--text-1);
text-align: center; text-align: center;
display: inline; display: inline;
vertical-align: middle; vertical-align: sub;
} }
h1 svg.icon { /* workarounds for some icons from jam-icons being non-square aspect ratio */
width: 30px; .icon-code {
height: 30px; width: 1.25em;
} }
/* }}} */ /* }}} */
@ -315,11 +315,6 @@ h1 svg.icon {
font-weight: bold; font-weight: bold;
} }
.heading-link svg {
width: 15px;
height: 15px;
}
/* }}} */ /* }}} */
/* Top bar formatting {{{ */ /* Top bar formatting {{{ */
@ -676,6 +671,7 @@ h1 svg.icon {
display: flex; display: flex;
gap: 8px; gap: 8px;
justify-content: center; justify-content: center;
font-size: 32px;
} }
.share-buttons a { .share-buttons a {
@ -690,8 +686,7 @@ h1 svg.icon {
} }
.share-buttons svg { .share-buttons svg {
width: 32px; display: block;
height: 32px;
} }
/* https://stackoverflow.com/a/72073682/19003757 */ /* https://stackoverflow.com/a/72073682/19003757 */

View File

@ -5,16 +5,17 @@
color: black; color: black;
} }
/* Background */ .bg { background-color: #f8f8f8 } /* Background */ .bg { background-color: #f8f8f8; }
/* PreWrapper */ .chroma { background-color: #f8f8f8; } /* PreWrapper */ .chroma { background-color: #f8f8f8; }
/* Other */ .chroma .x { color: #000000 } /* Other */ .chroma .x { color: #000000 }
/* Error */ .chroma .err { color: #a40000 } /* Error */ .chroma .err { color: #a40000 }
/* CodeLine */ .chroma .cl { } /* CodeLine */ .chroma .cl { }
/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc } /* LineHighlight */ .chroma .hl { background-color: #dfdfdf }
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } /* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } /* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* Line */ .chroma .line { display: flex; } /* Line */ .chroma .line { display: flex; }
/* Keyword */ .chroma .k { color: #204a87; font-weight: bold } /* Keyword */ .chroma .k { color: #204a87; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold } /* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold }

View File

@ -1,15 +1,16 @@
/* native style */ /* native style */
/* Background */ .bg { color: #d0d0d0; background-color: #202020 } /* Background */ .bg { color: #d0d0d0; background-color: #202020; }
/* PreWrapper */ .chroma { color: #d0d0d0; background-color: #202020; } /* PreWrapper */ .chroma { color: #d0d0d0; background-color: #202020; }
/* Other */ .chroma .x { } /* Other */ .chroma .x { }
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }
/* CodeLine */ .chroma .cl { } /* CodeLine */ .chroma .cl { }
/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc } /* LineHighlight */ .chroma .hl { background-color: #363636 }
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 } /* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 }
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 } /* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 }
/* Line */ .chroma .line { display: flex; } /* Line */ .chroma .line { display: flex; }
/* Keyword */ .chroma .k { color: #6ab825; font-weight: bold } /* Keyword */ .chroma .k { color: #6ab825; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold } /* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold }

View File

@ -1,3 +0,0 @@
function share_event(service) {
// this function does nothing by default
}

View File

@ -1,60 +0,0 @@
baseURL: https://example.com
theme: bobatheme
defaultContentLanguage: en
copyright: '&copy; 2021 bbaovanc <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>'
sectionPagesMenu: main
enableRobotsTXT: true
paginate: 5
enableGitInfo: true
taxonomies:
_merge: deep
markup: # this just keeps the bobatheme markup styling
_merge: deep
params:
author:
name: bbaovanc
# these are for the OpenGraph/Twitter embeds in Hugo
description: Example website for bobatheme
# these are for favicons in bobatheme (disabled by default)
# faviconSVG: favicon.svg
# appleTouchPNG: apple-touch-icon.png
# show reading time (enabled by default)
# readingtime: true
# used for "View source" (unset by default)
# gitFileURL: https://github.com/BBaoVanC/bobatheme/blob/master
# gitFileIcon: github-circle
# gitHistoryURL: https://github.com/BBaoVanC/bobatheme/commits/master
# social media share icons
# shareButtons:
# twitter: true
# facebook: true
# linkedin: true
# reddit: true
# telegram: true
# print: true
# show "Latest Posts" section at bottom of content pages
# latestPostsOnContent: true
# footer: >-
# Some example text for the footer.
# see https://gohugo.io/about/hugo-and-gdpr/#all-privacy-settings
# you probably want to keep this default
privacy:
_merge: deep
languages:
en:
languageName: English
title: Example Website
weight: 1

View File

@ -2,6 +2,12 @@ markup:
highlight: highlight:
noClasses: false noClasses: false
lineNos: true lineNos: true
goldmark:
parser:
attribute:
block: true
# this is enabled by default already
#title: true
params: params:
readingtime: true readingtime: true
@ -12,11 +18,20 @@ taxonomies:
author: authors author: authors
series: series series: series
outputs:
page:
- html
- markdown
outputFormats:
markdown:
ugly: true
privacy: privacy:
googleAnalytics: googleAnalytics:
disable: true disable: true
twitter: x:
enableDNT: true enableDNT: true
vimeo: vimeo:

View File

@ -30,6 +30,9 @@ readingtime:
edit_history: edit_history:
other: "Edit history" other: "Edit history"
view_markdown:
other: "View raw"
# Post count # Post count
no_posts: no_posts:
@ -67,6 +70,9 @@ aria_rss_link:
aria_post_meta_edit_history: aria_post_meta_edit_history:
other: "link to page edit history" other: "link to page edit history"
aria_post_meta_view_markdown:
other: "link to view raw markdown code of page"
aria_post_meta_categories: aria_post_meta_categories:
other: "categories" other: "categories"

View File

@ -0,0 +1,154 @@
{{- $validFormats := slice "default" "terse" }}
{{- $msg1 := "When passing a map to the internal pagination template, one of the elements must be named 'page', and it must be set to the context of the current page." }}
{{- $msg2 := "The 'format' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }}
{{- $page := . }}
{{- $format := "default" }}
{{- if reflect.IsMap . }}
{{- with .page }}
{{- $page = . }}
{{- else }}
{{- errorf $msg1 }}
{{- end }}
{{- with .format }}
{{- $format = lower . }}
{{- end }}
{{- end }}
{{- if in $validFormats $format }}
{{- if gt $page.Paginator.TotalPages 1 }}
<ul class="pagination pagination-{{ $format }}">
{{- partial (printf "inline/pagination/%s.html" $format) $page }}
</ul>
{{- end }}
{{- else }}
{{- errorf $msg2 (delimit $validFormats ", ") }}
{{- end -}}
{{/* Format: default
{{/* --------------------------------------------------------------------- */}}
{{- define "_partials/inline/pagination/default.html" }}
{{- with .Paginator }}
{{- $currentPageNumber := .PageNumber }}
{{- with .First }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">&laquo;&laquo;</span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="First" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">&laquo;&laquo;</span></a>
</li>
{{- end }}
{{- end }}
{{- with .Prev }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">&laquo;</span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="Previous" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">&laquo;</span></a>
</li>
{{- end }}
{{- $slots := 5 }}
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
{{- if lt (add (sub $end $start) 1) $slots }}
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
{{- end }}
{{- range $k := seq $start $end }}
{{- if eq $.Paginator.PageNumber $k }}
<li class="page-item active">
<a aria-current="page" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
</li>
{{- else }}
<li class="page-item">
<a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
</li>
{{- end }}
{{- end }}
{{- with .Next }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">&raquo;</span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="Next" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">&raquo;</span></a>
</li>
{{- end }}
{{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">&raquo;&raquo;</span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="Last" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">&raquo;&raquo;</span></a>
</li>
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
{{/* Format: terse
{{/* --------------------------------------------------------------------- */}}
{{- define "_partials/inline/pagination/terse.html" }}
{{- with .Paginator }}
{{- $currentPageNumber := .PageNumber }}
{{- with .First }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">&laquo;&laquo;</span></a>
</li>
{{- end }}
{{- end }}
{{- with .Prev }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">&laquo;</span></a>
</li>
{{- end }}
{{- $slots := 3 }}
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
{{- if lt (add (sub $end $start) 1) $slots }}
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
{{- end }}
{{- range $k := seq $start $end }}
{{- if eq $.Paginator.PageNumber $k }}
<li class="page-item active">
<a aria-current="page" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
</li>
{{- else }}
<li class="page-item">
<a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
</li>
{{- end }}
{{- end }}
{{- with .Next }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">&raquo;</span></a>
</li>
{{- end }}
{{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">&raquo;&raquo;</span></a>
</li>
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

View File

@ -16,9 +16,6 @@
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }} {{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script> <script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }} {{ end }}
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ with .Site.Params.faviconSVG }} {{ with .Site.Params.faviconSVG }}
<link rel="icon" href="{{ . | absURL }}" /> <link rel="icon" href="{{ . | absURL }}" />

View File

@ -1,6 +1,6 @@
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}} {{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
{{- $icon := $icon_resource.Content -}} {{- $icon := $icon_resource.Content -}}
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}} {{- $icon = replaceRE `<svg` (printf `<svg class="icon icon-%s"` .) $icon -}}
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}} {{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}} {{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
{{- $icon | safeHTML -}} {{- $icon | safeHTML -}}

View File

@ -0,0 +1 @@
<!-- Placeholder for website to add custom post metadata to summaries -->

View File

@ -0,0 +1,8 @@
{{ with .OutputFormats.Get "markdown" }}
<span class="page-metadata-item post-meta-view-markdown" aria-label="{{ i18n "aria_post_meta_view_markdown" }}">
{{ partial "icon.html" "code" }}
<a href="{{ .Permalink }}" target="_blank">
{{- i18n "view_markdown" -}}
</a>
</span>
{{ end }}

View File

@ -20,7 +20,12 @@
{{ partial "page-metadata/item/authors.html" . }} {{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }} {{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/edithistory.html" . }} {{ partial "page-metadata/item/edithistory.html" . }}
{{ partial "page-metadata/item/viewraw.html" . }}
{{ partial "page-metadata/custom-full.html" . }}
{{ partial "page-metadata/item/categories.html" . }} {{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }} {{ partial "page-metadata/item/tags.html" . }}
</div> </div>
{{ end }} {{ end }}

View File

@ -9,6 +9,7 @@
{{ partial "page-metadata/item/authors.html" . }} {{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }} {{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/series.html" . }} {{ partial "page-metadata/item/series.html" . }}
{{ partial "page-metadata/item/categories.html" . }} {{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }} {{ partial "page-metadata/item/tags.html" . }}

View File

@ -0,0 +1,6 @@
{{ if gt .Paginator.TotalPages 1 }}
<nav class="pagination">
{{/* https://github.com/gohugoio/hugo/blob/a88b488181279befd50e1d127f9f67604f2f9854/tpl/tplimpl/embedded/templates/_partials/pagination.html */}}
{{ partial "_internal/pagination.html" . }}
</nav>
{{ end }}

View File

@ -33,7 +33,7 @@
<meta property="og:locale" content="{{ . }}"> <meta property="og:locale" content="{{ . }}">
{{ end }} {{ end }}
{{ with .Site.Params.title }} {{ with .Site.Title }}
<meta property="og:site_name" content="{{ . }}"> <meta property="og:site_name" content="{{ . }}">
{{ end }} {{ end }}

View File

@ -21,10 +21,14 @@
<meta itemprop="image" content="{{ $featured.Permalink }}"> <meta itemprop="image" content="{{ $featured.Permalink }}">
{{ end }} {{ end }}
{{ with (.GetTerms "tags") }} {{ with .Keywords }}
{{ $tags := slice }} <meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ range . }} {{ else }}
{{ $tags = $tags | append .LinkTitle }} {{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append .LinkTitle }}
{{ end }}
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
{{ end }} {{ end }}
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
{{ end }} {{ end }}

View File

@ -24,6 +24,6 @@
<meta name="twitter:title" content="{{ .Title | plainify }}"> <meta name="twitter:title" content="{{ .Title | plainify }}">
<meta name="twitter:description" content="{{ (partial "seo-description.html" .) | plainify }}"> <meta name="twitter:description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ with .Site.Social.twitter }} {{ with .Site.Params.social.twitter }}
<meta name="twitter:site" content="@{{ . }}"> <meta name="twitter:site" content="@{{ . }}">
{{ end }} {{ end }}

View File

@ -0,0 +1,14 @@
{{/* https://github.com/gohugoio/hugo/issues/13823#issuecomment-3015270202 */}}
{{ with .Get 0 -}}
{{ with $.Page.GetPage . -}}
{{ .RenderShortcodes -}}
{{ else with $.Page.Resources.Get . -}}
{{ .RenderShortcodes -}}
{{ else with resources.Get . -}}
{{ .Content -}}
{{ else -}}
{{ errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position -}}
{{ end -}}
{{ else -}}
{{ errorf "The %q shortcode requires a positional parameter indicating the logical path of the file to include. See %s" .Name .Position -}}
{{ end -}}

View File

@ -8,12 +8,18 @@
{{ partial "top.html" . }} {{ partial "top.html" . }}
{{ if hugo.IsServer -}}
<div style="position: fixed; bottom: 25px; right: 25px;">
{{ templates.Current.Name }}
</div>
{{ end -}}
<div class="main-container"> <div class="main-container">
{{ if not .IsHome }} {{ if not .IsHome }}
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
{{ end }} {{ end }}
<main id="main-content"> <main id="main-content" data-pagefind-body>
{{ block "main" . }} {{ block "main" . }}
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it) THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
{{ end }} {{ end }}
@ -27,7 +33,7 @@
{{ if or .Site.Copyright .Site.Params.footer }} {{ if or .Site.Copyright .Site.Params.footer }}
<footer> <footer>
{{ with .Site.Copyright }} {{ with .Site.Copyright }}
<p>{{ . | safeHTML }}</p> {{ . | safeHTML }}
{{ end }} {{ end }}
{{ with .Site.Params.footer }} {{ with .Site.Params.footer }}

View File

@ -1,5 +0,0 @@
{{ if gt .Paginator.TotalPages 1 }}
<nav class="pagination">
{{ template "_internal/pagination.html" . }}
</nav>
{{ end }}

View File

@ -1,20 +0,0 @@
{{ $path := "" }}
{{ $markdown := false }}
{{ if .IsNamedParams }}
{{ $path = .Get "path" }}
{{ with .Get "markdown" }}
{{ $markdown = . }}
{{ end }}
{{ else }}
{{ $path = .Get 0 }}
{{ end }}
{{ with ($path | readFile) }}
{{ if $markdown }}
{{ $path | readFile | $.Page.RenderString (dict "display" "block") }}
{{ else }}
{{ $path | readFile }}
{{ end }}
{{ else }}
{{ errorf "file not found: %s" $path }}
{{ end }}

View File

@ -1,10 +0,0 @@
{{/* See https://willschenk.com/articles/2020/styling_tables_with_hugo/ */}}
{{ $class := "markdown" }}
{{ with .Get "class" }}
{{ $class = delimit (slice $class .) " " }}
{{ end }}
{{ $htmlTable := .Inner | .Page.RenderString (dict "display" "block") }}
{{ $new := printf `<table class="%s">` $class }}
{{ (replace $htmlTable "<table>" $new) | safeHTML }}

View File

@ -0,0 +1,9 @@
{{ with .File -}}
{{ with (.Path | readFile) -}}
{{ . -}}
{{ else -}}
{{ errorf "file not found: %s" .Path -}}
{{ end -}}
{{ else -}}
{{ errorf "no file available for markdown template?" -}}
{{ end -}}