mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-04 11:07:32 -05:00
Compare commits
11 Commits
hugo-0.146
...
ca0f8d390c
Author | SHA1 | Date | |
---|---|---|---|
ca0f8d390c
|
|||
62f0d42140
|
|||
16f08dce7f
|
|||
c06e7eb938
|
|||
5a957bc745
|
|||
67ac36e9e2
|
|||
6ff0ffb80b
|
|||
ff4998f31b
|
|||
1aa2f8ea5c
|
|||
6e7160efbb
|
|||
04c3c007a8
|
@ -291,17 +291,17 @@ table.simple 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 */
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
function share_event(service) {
|
|
||||||
// this function does nothing by default
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
baseURL: https://example.com
|
|
||||||
theme: bobatheme
|
|
||||||
defaultContentLanguage: en
|
|
||||||
copyright: '© 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
|
|
154
layouts/_partials/_internal/pagination.html
Normal file
154
layouts/_partials/_internal/pagination.html
Normal 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">««</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">««</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">«</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">«</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">»</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">»</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">»»</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">»»</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">««</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">«</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">»</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">»»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
@ -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 }}" />
|
@ -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 -}}
|
1
layouts/_partials/page-metadata/custom-full.html
Normal file
1
layouts/_partials/page-metadata/custom-full.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!-- Placeholder for website to add custom post metadata to summaries -->
|
@ -22,6 +22,8 @@
|
|||||||
{{ partial "page-metadata/item/edithistory.html" . }}
|
{{ partial "page-metadata/item/edithistory.html" . }}
|
||||||
{{ partial "page-metadata/item/viewraw.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" . }}
|
@ -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" . }}
|
6
layouts/_partials/pagination.html
Normal file
6
layouts/_partials/pagination.html
Normal 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 }}
|
14
layouts/_shortcodes/include.html
Normal file
14
layouts/_shortcodes/include.html
Normal 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 -}}
|
@ -8,6 +8,12 @@
|
|||||||
|
|
||||||
{{ 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" . }}
|
@ -1,5 +0,0 @@
|
|||||||
{{ if gt .Paginator.TotalPages 1 }}
|
|
||||||
<nav class="pagination">
|
|
||||||
{{ template "_internal/pagination.html" . }}
|
|
||||||
</nav>
|
|
||||||
{{ end }}
|
|
@ -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 }}
|
|
Reference in New Issue
Block a user