2 Commits

Author SHA1 Message Date
7c79f83138 Fix pagination for Hugo 0.146 2025-04-20 04:33:37 -05:00
fa89bc6746 Add TODO warning to fix pagination 2025-04-19 01:35:08 -05:00
58 changed files with 108 additions and 33 deletions

View File

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

3
assets/js/share-event.js Normal file
View File

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

68
exampleSite/hugo.yaml Normal file
View File

@ -0,0 +1,68 @@
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
enableGitInfo: true
pagination:
pagerSize: 5
taxonomies:
_merge: deep
markup: # this just keeps the bobatheme markup styling
_merge: deep
outputs:
_merge: deep
outputFormats:
_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

@ -8,12 +8,6 @@
{{ partial "top.html" . }}
{{ if hugo.IsServer -}}
<div style="position: fixed; bottom: 25px; right: 25px;">
{{ templates.Current.Name }}
</div>
{{ end -}}
<div class="main-container">
{{ if not .IsHome }}
{{ partial "breadcrumb.html" . }}

View File

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

View File

@ -1,14 +0,0 @@
{{/* 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

@ -16,6 +16,9 @@
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ 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 }}
<link rel="icon" href="{{ . | absURL }}" />

View File

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

View File

@ -22,8 +22,6 @@
{{ 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/tags.html" . }}

View File

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

View File

@ -0,0 +1,20 @@
{{ $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 }}