57 Commits

Author SHA1 Message Date
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
c980ced2fb Remove back to top button
It's kind of ugly and weird, and probably not necessary. I might add it
back in the future if it's actually needed again.
2023-11-05 17:41:59 -06:00
9ca15a198f Revert "Load bobastyle.css async too"
This reverts commits f33492ef8e and 5c87c2b069.

It turns out this makes performance score even worse because it makes
the CLS really bad
2023-11-05 01:20:20 -05:00
5c87c2b069 Fix async loading of bobastyle.css 2023-11-05 01:00:22 -05:00
6c42ae9518 Lazy load images 2023-11-05 00:56:13 -05:00
f33492ef8e Load bobastyle.css async too 2023-11-05 00:56:01 -05:00
ffcae79156 Load syntax CSS async 2023-11-05 00:31:26 -05:00
a59a87374b Rename config.yaml to hugo.yaml 2023-11-04 20:55:02 -05:00
88adfbdf89 Move site author to under params due to .Site.Author deprecation
See Hugo v0.120.0
2023-11-03 23:33:28 -05:00
0f717e81c0 Patch link issue with delimit due to breaking change in Hugo v0.120
References:
- https://github.com/gohugoio/hugo/releases/tag/v0.120.0
- https://github.com/gohugoio/hugo/issues/10876
- https://github.com/gohugoio/hugo/issues/11502
2023-11-03 22:08:23 -05:00
ede5958a46 Fix main container padding when printing 2023-11-02 01:01:24 -05:00
0b3b160e87 Rename config.yaml to hugo.yaml in exampleSite 2023-10-21 21:45:22 -05:00
12c6efc0fe Add "Skip to main content" tab-focusable button
- https://webaim.org/techniques/skipnav/
- https://css-tricks.com/how-to-create-a-skip-to-content-link/
2023-10-21 20:21:26 -05:00
0e930f7ae1 Clean up dom layout of full-width page lists
They shouldn't be a child of the centered, max-width'd body because they
need to be full width. So put them outside of the main container div.
2023-10-21 19:44:02 -05:00
289f55dc19 Throw error in include shortcode if file not found 2023-10-16 20:35:05 -05:00
0ddf0bdf42 Improve print compatiblity with navbar redesign 2023-10-15 20:54:11 -05:00
03d826f1c4 Fix wrong highlight color on navbar 2023-10-15 19:40:45 -05:00
f94307cdbf Redesign navbar to be full width 2023-10-15 19:33:10 -05:00
fde24f7438 Fix navbar highlighting on section page itself 2023-10-15 17:49:56 -05:00
c0426f191a Revert ":3"
This reverts 50a207b8ee
2023-10-15 00:42:45 -05:00
e8a34ae4a4 Add gap before page-list when there's no text description 2023-04-10 15:08:33 -05:00
18731498e8 Minor W3C validation fixes
Hopefully more to come soon, there's a lot of errors and warnings
2023-04-06 00:25:08 -05:00
ad5c40b02b Use CSS to set footer font size instead of <small> 2023-04-06 00:18:18 -05:00
e6b5997dff Move @media specializations section instead of previous commit
Reverts 960d1d24be
2023-04-06 00:12:43 -05:00
960d1d24be Fix table of contents on print 2023-04-06 00:11:12 -05:00
17047babc0 Improve date element in page metadata 2023-04-06 00:08:28 -05:00
7bc8a4cb57 Clean up CSS
- Add vim folds to make organized sections
- Rename a lot of classes from post- to page-
- Generalize series CSS classes better
- Clean up navbar div structure
- Remove langpicker and most of multilingual support
- many other minor tweaks
2023-03-24 08:49:02 -05:00
d34b2a56d7 Remove series position indicator -- racy and buggy 2023-03-18 21:11:07 -05:00
50a207b8ee :3 2023-03-18 20:23:49 -05:00
6f140f096b Organize summary template files
Also a small CSS patch to fix margin around post-title
2023-02-28 18:24:19 -06:00
316c62ebe8 Remove unnecessary credit.html partial 2023-02-28 17:54:22 -06:00
1caa7acdc9 Prevent page breaking in some elements when printing 2023-01-27 16:39:04 -06:00
f2f9e78559 Use RenderString instead of markdownify in some places 2023-01-27 16:14:23 -06:00
dd65d55389 Make sure link-1 has enough contrast 2023-01-26 16:54:17 -06:00
c7acf8ce38 Add link-1 color to light theme too 2023-01-26 16:47:39 -06:00
d7647a0b6f Fix table borders between th and td in same line 2023-01-26 16:43:46 -06:00
ebaa1de00b Add aria labels to share buttons 2023-01-26 16:36:03 -06:00
0744af717d Fix code block text sizing on mobile safari 2023-01-24 01:54:27 -06:00
23f86d5982 Use relative URL for fonts
Makes it work when the website isn't on root (such as demo)
2023-01-24 01:34:23 -06:00
b854ae48e6 Specify table.markdown instead of just .markdown for table styling 2023-01-23 18:11:00 -06:00
36a19a48b7 Add more borders in table for clarity 2023-01-23 18:10:11 -06:00
1f8a82228e Add include shortcode 2023-01-23 17:39:20 -06:00
60ed1c0264 Serve fonts (Open Sans and JetBrains Mono) rather than use system 2023-01-22 20:46:18 -06:00
61 changed files with 989 additions and 1118 deletions

2
.gitmodules vendored
View File

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

View File

@ -8,7 +8,7 @@ comments: true
draft: true
authors:
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
- {{ with .Site.Params.author.name }}{{ . }}{{ else }}John Doe{{ end }}
categories:
- archetype-stuff

View File

@ -6,7 +6,7 @@ toc: true
comments: false
authors:
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
- {{ with .Site.params.author.name }}{{ . }}{{ else }}John Doe{{ end }}
---

File diff suppressed because it is too large Load Diff

View File

@ -5,16 +5,17 @@
color: black;
}
/* Background */ .bg { background-color: #f8f8f8 }
/* Background */ .bg { background-color: #f8f8f8; }
/* PreWrapper */ .chroma { background-color: #f8f8f8; }
/* Other */ .chroma .x { color: #000000 }
/* Error */ .chroma .err { color: #a40000 }
/* 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; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
/* LineNumbersTable */ .chroma .lnt { 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; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* LineHighlight */ .chroma .hl { background-color: #dfdfdf }
/* 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; -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; }
/* Keyword */ .chroma .k { color: #204a87; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold }

View File

@ -1,15 +1,16 @@
/* native style */
/* Background */ .bg { color: #d0d0d0; background-color: #202020 }
/* Background */ .bg { color: #d0d0d0; background-color: #202020; }
/* PreWrapper */ .chroma { color: #d0d0d0; background-color: #202020; }
/* Other */ .chroma .x { }
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }
/* 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; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
/* LineNumbersTable */ .chroma .lnt { 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; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 }
/* LineHighlight */ .chroma .hl { background-color: #363636 }
/* 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; -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; }
/* Keyword */ .chroma .k { color: #6ab825; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold }

View File

@ -1,13 +1,3 @@
// back to top
const backToTop = document.getElementById("back-to-top");
window.onscroll = function() {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
backToTop.style.display = "block";
} else {
backToTop.style.display = "none";
}
}
// code block copy to clipboard
window.onload = () => {
document.querySelectorAll(".code-block").forEach(codeBlock => {

View File

@ -1,12 +0,0 @@
1: "enero"
2: "febrero"
3: "marzo"
4: "abril"
5: "mayo"
6: "julio"
7: "junio"
8: "agosto"
9: "septiembre"
10: "octubre"
11: "noviembre"
12: "diciembre"

View File

@ -1,70 +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
author:
name: bbaovanc
markup: # this just keeps the bobatheme markup styling
_merge: deep
params:
# 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
# display a "Latest Posts" section on the homepage below its content
homepageLatestPosts: true
# 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
es:
languageName: Español
title: Sitio web ejemplo
weight: 2
params:
description: Sitio web ejemplo para bobatheme

View File

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

View File

@ -19,9 +19,6 @@ copy_to_clipboard:
# Meta items
long_date:
other: "{{ .Date.Format `January 2, 2006` }}"
wordcount:
one: "{{ . }} word"
other: "{{ . }} words"
@ -33,6 +30,9 @@ readingtime:
edit_history:
other: "Edit history"
view_markdown:
other: "View raw"
# Post count
no_posts:
@ -58,8 +58,8 @@ newer_post:
# ARIA labels
aria_header_link:
other: "header link"
aria_heading_link:
other: "heading link"
aria_back_to_top_button:
other: "back to top button"
@ -70,8 +70,8 @@ aria_rss_link:
aria_post_meta_edit_history:
other: "link to page edit history"
aria_post_meta_translations:
other: "translations"
aria_post_meta_view_markdown:
other: "link to view raw markdown code of page"
aria_post_meta_categories:
other: "categories"
@ -121,11 +121,23 @@ aria_series_metadata:
aria_navbar:
other: "navigation bar"
aria_langpicker:
other: "language picker"
aria_langpicker_list:
other: "language list"
aria_table_of_contents:
other: "table of contents"
aria_share_twitter:
other: "share to twitter button"
aria_share_facebook:
other: "share to facebook button"
aria_share_linkedin:
other: "share to linkedin button"
aria_share_reddit:
other: "share to reddit button"
aria_share_telegram:
other: "share to telegram button"
aria_share_print:
other: "print article button"

View File

@ -1,131 +0,0 @@
# Misc
credit_comment:
other: "<!-- bobatheme está disponible en GitHub basado en la licensia MIT: https://github.com/BBaoVanC/bobatheme. -->"
table_of_contents:
other: "Índice"
browser_no_video_support:
other: "Tu navegador de internet no admite video."
latest_posts:
other: "Artículos recientes"
see_also:
other: "Véase también:"
copy_to_clipboard:
other: "Copiar"
# Meta items
long_date:
other: "{{ .Date.Day }} de {{ index .Data.meses (printf `%d` .Date.Month) }} de {{ .Date.Year }}"
wordcount:
one: "{{ . }} palabra"
other: "{{ . }} palabras"
readingtime:
one: "{{ . }} min"
other: "{{ . }} mins"
edit_history:
other: "Historial de cambios"
# Post count
no_posts:
other: "¡No hay contenido para mostrar!"
post_count:
one: "{{ . }} publicación"
other: "{{ . }} publicaciones"
# Navigation
read_more:
other: "Leer más"
related_posts:
other: "Publicaciones similares"
older_post:
other: "Más antiguo"
newer_post:
other: "Más nuevo"
# ARIA labels
# aria_header_link:
# other: "header link"
# aria_back_to_top_button:
# other: "back to top button"
# aria_rss_link:
# other: "RSS feed link"
# aria_post_meta_edit_history:
# other: "link to page edit history"
# aria_post_meta_translations:
# other: "translations"
# aria_post_meta_categories:
# other: "categories"
# aria_post_meta_tags:
# other: "tags"
# aria_post_meta_reading_time:
# other: "reading time"
# aria_post_meta_authors:
# other: "authors"
# aria_post_meta_series:
# other: "series"
# aria_breadcrumbnav:
# other: "breadcrumb navigation bar"
# aria_post_metadata:
# other: "post metadata"
# aria_author_metadata:
# other: "author metadata"
# aria_taxonomy_metadata:
# other: "taxonomy metadata"
# aria_post_meta_date:
# other: "date"
# aria_post_meta_modified_date:
# other: "last modified date"
# aria_author_post_count:
# other: "post count"
# aria_author_word_count:
# other: "word count"
# aria_taxonomy_post_count:
# other: "post count"
# aria_series_metadata:
# other: "series metadata"
# aria_navbar:
# other: "navigation bar"
# aria_langpicker:
# other: "language picker"
# aria_langpicker_list:
# other: "language list"
# aria_table_of_contents:
# other: "table of contents"

View File

@ -1,7 +1,7 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="section-header">
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="section-heading">
{{ .Text | safeHTML }}
<a href="#{{ .Anchor | safeURL }}">
<span class="section-header-link" aria-label="{{ i18n "aria_header_link" }}">
<a class="heading-link" href="#{{ .Anchor | safeURL }}">
<span aria-label="{{ i18n "aria_heading_link" }}">
{{ partial "icon.html" "link" }}
</span>
</a>

View File

@ -1,49 +1,40 @@
{{ partial "credit.html" }}
{{ i18n "credit_comment" | safeHTML }}
<!DOCTYPE html>
<html lang="{{ .Language.Lang }}">
{{ partial "head.html" . }}
<body>
<a id="top" name="top" aria-hidden="true"></a>
<a id="skip-to-main" href="#main-content">Skip to main content</a>
<div class="top">
{{ partial "top.html" . }}
{{ partial "top.html" . }}
<div class="main-container">
{{ if not .IsHome }}
{{ partial "breadcrumb.html" . }}
{{ end }}
<main id="main-content">
{{ block "main" . }}
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
{{ end }}
</main>
</div>
{{ if not .IsHome }}
{{ partial "breadcrumb.html" . }}
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
<main>
{{ block "main" . }}
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
{{ end }}
</main>
{{ if or .Site.Copyright .Site.Params.footer }}
<footer>
<small>
{{ with .Site.Copyright }}
<p>{{ . | safeHTML }}</p>
{{ end }}
{{ with .Site.Copyright }}
{{ . | safeHTML }}
{{ end }}
{{ with .Site.Params.footer }}
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
</small>
{{ with .Site.Params.footer }}
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
</footer>
{{ end }}
<a id="back-to-top" href="#top" aria-label="{{ i18n "aria_back_to_top_button" }}">
{{ partial "icon.html" "chevron-up" }}
</a>
<noscript>
<style>
#back-to-top {
display: block;
}
</style>
</noscript>
</body>
</html>

View File

@ -9,11 +9,11 @@
{{ . }}
{{ end }}
<div class="list-page-content">
<div class="list-page-container">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary/section" }}
{{ .Render "summary" }}
{{ end }}
</div>
{{ end }}

View File

@ -1,12 +1,12 @@
{{ define "main" }}
<div class="post-title">
<div class="page-title">
<h1>
{{ .Title | markdownify }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h1>
</div>
{{ partial "post-metadata/full.html" . }}
{{ partial "page-metadata/post-full.html" . }}
{{ partial "series-box.html" . }}
{{ if .Params.Toc }}
@ -73,17 +73,16 @@
{{ partial "comments.html" . }}
</div>
{{ end }}
{{ end }}
{{ define "post-body" }}
{{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }}
<div class="related-posts full-width-page-list">
<div class="related-posts">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}
{{ if .Site.Params.latestPostsOnContent }}
{{ partialCached "latest-posts.html" . }}
{{ end }}
{{ end }}

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 -}}

View File

@ -1,10 +1,10 @@
<h2 class="post-title">
<h2 class="page-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/short.html" . }}
{{ partial "page-metadata/post-short.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
@ -12,7 +12,7 @@
</div>
{{ end }}
<div class="post-description">
<div class="page-description">
{{ partial "description-or-summary.html" . }}
</div>

View File

@ -1,16 +0,0 @@
<div class="author">
<h2 class="author-name">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/author.html" . }}
<div class="author-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
</div>

View File

@ -1,24 +0,0 @@
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/series.html" . }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="series-page-list">
{{ $i := 0 }}
{{ $total := len .Data.Pages }}
{{ range .Data.Pages.Reverse }}
{{ $i = add 1 $i }}
{{ .Scratch.Set "series_position" $i }}
{{ .Scratch.Set "series_total" $total }}
<article class="post">
{{ .Render "summary/series_post" }}
</article>
{{ end }}
</div>

View File

@ -1,27 +0,0 @@
<div class="post-series-position">
{{ if .Scratch.Get "series_position" }}
({{ .Scratch.Get "series_position" }}/{{ .Scratch.Get "series_total" }})
{{ end }}
</div>
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/short.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@ -11,8 +11,8 @@
<div class="page-list">
{{ with .Paginator.Pages }}
{{ range . }}
<article class="post">
{{ .Render "summary/author" }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}

View File

@ -0,0 +1,14 @@
<h2 class="page-title">
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/author.html" . }}
<div class="page-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@ -1,5 +1,5 @@
{{ define "main" }}
<div class="author-name">
<div class="page-title">
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
@ -7,7 +7,7 @@
</h1>
</div>
{{ partial "post-metadata/author.html" . }}
{{ partial "page-metadata/author.html" . }}
{{ with .Content }}
{{ . }}

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

@ -1 +0,0 @@
{{ i18n "credit_comment" | safeHTML }}

View File

@ -9,7 +9,7 @@
{{ with index . "src" }}
{{ $media := . }}
{{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
{{ else if eq .MediaType.MainType "video" }}
<video controls preload="metadata">
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">

View File

@ -7,17 +7,17 @@
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ with resources.Get "css/syntax.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
{{ end }}
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
{{ end }}
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ with .Site.Params.faviconSVG }}

View File

@ -1,11 +0,0 @@
<div class="latest-posts full-width-page-list">
<hr>
<h1>
{{ i18n "latest_posts" }}
{{ partial "rss-link.html" .Site.Home }}
</h1>
{{ with .Site.RegularPages | first 5 }}
{{ partial "page-list.html" . }}
{{ end }}
</div>

View File

@ -1,8 +1,8 @@
<div class="page-list">
{{ with . }}
{{ range . }}
<article class="post">
{{ .Render "summary/post" }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}

View File

@ -1,16 +1,16 @@
<div class="author-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
<div class="page-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
{{/* Calculate the total word count */}}
{{ $total_words := 0 }}
{{ range .Data.Pages }}
{{ $total_words = add $total_words .WordCount }}
{{ end }}
<span class="author-meta-item" aria-label="{{ i18n "aria_author_post_count" }}">
<span class="page-metadata-item" aria-label="{{ i18n "aria_author_post_count" }}">
{{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }}
</span>
<span class="author-meta-item" aria-label="{{ i18n "aria_author_word_count" }}">
<span class="page-metadata-item" aria-label="{{ i18n "aria_author_word_count" }}">
{{ partial "icon.html" "align-left" }}
{{ i18n "wordcount" $total_words }}
</span>

View File

@ -1,14 +1,14 @@
{{ with .Params.authors }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_authors" }}">
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_authors" }}">
{{ partial "icon.html" "user-circle" }}
{{ if index $.Site.Taxonomies "authors" }}
{{ $authors := slice }}
{{ range . }}
{{ $url := (printf "authors/%s" (. | anchorize)) | absLangURL }}
{{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url . | safeHTML) }}
{{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url .) }}
{{ end }}
{{ delimit $authors ", " }}
{{ delimit $authors ", " | safeHTML }}
{{ else }}
{{ delimit . ", " }}
{{ end }}

View File

@ -4,8 +4,8 @@
{{ $categories = $categories | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
<div class="page-metadata-section categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
{{ partial "icon.html" "folder" }}
{{ delimit $categories ", " }}
{{ delimit $categories ", " | safeHTML }}
</div>
{{ end }}

View File

@ -1,5 +1,5 @@
{{ if and .Site.Params.gitHistoryURL .File.Path }}
<span class="post-meta-item post-meta-edit-history" aria-label="{{ i18n "aria_post_meta_edit_history" }}">
<span class="page-metadata-item post-meta-edit-history" aria-label="{{ i18n "aria_post_meta_edit_history" }}">
{{ partial "icon.html" "history" }}
<a href="{{ printf "%s/content/%s" .Site.Params.gitHistoryURL .File.Path }}" target="_blank" rel="noopener">
{{- i18n "edit_history" -}}

View File

@ -1,5 +1,5 @@
{{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_reading_time" }}">
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_reading_time" }}">
{{ partial "icon.html" "clock" }}
{{ i18n "readingtime" .ReadingTime }}
</span>

View File

@ -4,8 +4,8 @@
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="series" aria-label="{{ i18n "aria_post_meta_series" }}">
<div class="page-metadata-section series" aria-label="{{ i18n "aria_post_meta_series" }}">
{{ partial "icon.html" "files" }}
{{ delimit $series ", " }}
{{ delimit $series ", " | safeHTML }}
</div>
{{ end }}

View File

@ -4,8 +4,8 @@
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="tags" aria-label="{{ i18n "aria_post_meta_tags" }}">
<div class="page-metadata-section tags" aria-label="{{ i18n "aria_post_meta_tags" }}">
{{ partial "icon.html" "tag" }}
{{ delimit $tags ", " }}
{{ delimit $tags ", " | safeHTML }}
</div>
{{ end }}

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

@ -0,0 +1,29 @@
{{ if or .Date .Params.authors .Site.Params.readingtime .Site.Params.gitFileURL }}
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_date" }}">
{{ partial "icon.html" "calendar" }}
{{ partial "time-element.html" .Date }}
</span>
{{/* TODO: make this be a tooltip */}}
{{/* DISABLED
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}">
{{ partial "icon.html" "pencil" }}
{{ partial "time-element.html" .Lastmod }}
{{ end }}
</span>
*/}}
{{ end }}
{{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/edithistory.html" . }}
{{ partial "page-metadata/item/viewraw.html" . }}
{{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }}
</div>
{{ end }}

View File

@ -0,0 +1,16 @@
{{ if or .Date .Params.authors .Site.Params.readingtime }}
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="page-metadata-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
{{ partial "time-element.html" .Date }}
</span>
{{ end }}
{{ 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" . }}
</div>
{{ end }}

View File

@ -1,11 +1,11 @@
<div class="post-metadata" aria-label="{{ i18n "aria_series_metadata" }}">
<span class="post-meta-item">
<div class="page-metadata" aria-label="{{ i18n "aria_series_metadata" }}">
<span class="page-metadata-item">
{{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }}
</span>
{{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item">
<span class="page-metadata-item">
{{ partial "icon.html" "clock" }}
{{ $readingtime := 0 }}
{{ range .Data.Pages }}
@ -14,6 +14,4 @@
{{ i18n "readingtime" $readingtime }}
</span>
{{ end }}
{{ partial "post-meta-item/translations.html" . }}
</div>

View File

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

View File

@ -1,8 +0,0 @@
{{ if .IsTranslated }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_translations" }}">
{{ partial "icon.html" "world" }}
{{ range .Translations }}
<a href="{{ .Permalink }}">{{ .Language }}</a>
{{ end }}
</span>
{{ end }}

View File

@ -1,31 +0,0 @@
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime .Site.Params.gitFileURL }}
<div class="post-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_date" }}">
{{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
</span>
{{/* TODO: make this be a tooltip */}}
{{/* DISABLED
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}">
{{ partial "icon.html" "pencil" }}
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
</time>
{{ end }}
</span>
*/}}
{{ end }}
{{ partial "post-meta-item/authors.html" . }}
{{ partial "post-meta-item/translations.html" . }}
{{ partial "post-meta-item/readingtime.html" . }}
{{ partial "post-meta-item/edithistory.html" . }}
{{ partial "post-meta-item/categories.html" . }}
{{ partial "post-meta-item/tags.html" . }}
</div>
{{ end }}

View File

@ -1,19 +0,0 @@
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime }}
<div class="post-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="post-meta-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
</span>
{{ end }}
{{ partial "post-meta-item/authors.html" . }}
{{ partial "post-meta-item/translations.html" . }}
{{ partial "post-meta-item/readingtime.html" . }}
{{ partial "post-meta-item/series.html" . }}
{{ partial "post-meta-item/categories.html" . }}
{{ partial "post-meta-item/tags.html" . }}
</div>
{{ end }}

View File

@ -10,7 +10,7 @@
{{ end }}
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" />
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
{{ else if eq $type "video" }}
<video controls preload="metadata">
<source src="{{ $src }}" alt="{{ $alt }}">

View File

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

View File

@ -24,6 +24,6 @@
<meta name="twitter:title" content="{{ .Title | 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="@{{ . }}">
{{ end }}

View File

@ -12,6 +12,6 @@
This post is part of a series:
{{ end }}
{{ delimit $series ", " }}
{{ delimit $series ", " | safeHTML }}
</div>
{{ end }}

View File

@ -3,6 +3,7 @@
<a class="twitter-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_twitter" }}"
onclick="share_event('Twitter');"
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
{{- partial "icon.html" "twitter" -}}
@ -13,6 +14,7 @@
<a class="facebook-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_facebook" }}"
onclick="share_event('Facebook');"
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
{{- partial "icon.html" "facebook" -}}
@ -23,6 +25,7 @@
<a class="linkedin-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_linkedin" }}"
onclick="share_event('LinkedIn');"
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
{{- partial "icon.html" "linkedin" -}}
@ -33,6 +36,7 @@
<a class="reddit-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_reddit" }}"
onclick="share_event('Reddit');"
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
{{- partial "icon.html" "reddit" -}}
@ -46,6 +50,7 @@
<a class="telegram-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_telegram" }}"
onclick="share_event('Telegram');"
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
{{- partial "icon.html" "telegram" -}}
@ -55,6 +60,7 @@
{{ if .Site.Params.shareButtons.print }}
<a class="print-share"
aria-label="{{ i18n "aria_share_print" }}"
href="javascript:void(0)"
onclick="window.print(); share_event('Print');">
{{- partial "icon.html" "printer" -}}

View File

@ -0,0 +1,3 @@
<time datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}" title="{{ . }}">
{{ .Format "January 2, 2006" }}
</time>

View File

@ -1,10 +1,10 @@
<header class="header">
<a href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }}
</a>
</header>
<div class="top">
<header class="header">
<a class="heading-link" href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }}
</a>
</header>
<div class="topbar">
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}">
{{ with .Site.Home }}
<a class="navbar-item{{ if $.IsHome }} active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
@ -12,7 +12,8 @@
{{ range .Site.Menus.main }}
{{ $isActive := false }}
{{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }}
{{/* https://discourse.gohugo.io/t/ismenucurrent-not-working-with-using-sectionpagesmenu/46687/2?u=bbaovanc */}}
{{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }}
{{ $isActive = true }}
{{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}"
@ -20,35 +21,4 @@
href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>
{{ if .Site.IsMultiLingual }}
<details class="langpicker" aria-label="{{ i18n "aria_langpicker" }}">
<summary>
{{- partial "icon.html" "world" -}}
</summary>
<ul class="languages" aria-label="{{ i18n "aria_langpicker_list" }}">
{{ range .AllTranslations }}
<li>
<a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end }}
{{ $site_translations := slice }}
{{ range .Site.Languages }}
{{ $site_translations = $site_translations | append .LanguageName }}
{{ end }}
{{ $translation_codes := slice }}
{{ range .AllTranslations }}
{{ $translation_codes = $translation_codes | append .Language }}
{{ end }}
{{ range (.Site.Languages | complement $translation_codes) }}
<li>
<a class="langpicker-item unavailable" aria-disabled="true">{{ .LanguageName }}</a>
</li>
{{ end }}
</ul>
</details>
{{ end }}
</div>

View File

@ -8,12 +8,12 @@
{{ . }}
{{ end }}
<div class="series-taxonomy-list">
{{ with .Pages }}
<div class="page-list series">
{{ with .Paginator.Pages }}
{{ range . }}
<article class="series-taxonomy">
{{ .Render "summary/series" }}
</article>
<div class="page series">
{{ .Render "summary" }}
</div>
{{ end }}
{{ else }}
<div>

View File

@ -0,0 +1,19 @@
<h2 class="page-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/series.html" . }}
<div class="page-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="page-list series-inner">
{{ range .Data.Pages.Reverse }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
</div>

View File

@ -5,7 +5,7 @@
{{ partial "rss-link.html" . }}
</h1>
{{ partial "post-metadata/series.html" . }}
{{ partial "page-metadata/series.html" . }}
{{ with .Content }}
{{ . }}

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 }}

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 | markdownify }}
{{ $new := printf `<table class="%s">` $class }}
{{ (replace $htmlTable "<table>" $new) | safeHTML }}

View File

@ -1,5 +1,5 @@
{{ define "main" }}
<div class="post-title">
<div class="page-title">
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
@ -26,7 +26,7 @@
<a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p>
</a>
{{ partial "post-metadata/taxonomy.html" . }}
{{ partial "page-metadata/taxonomy.html" . }}
</div>
{{ partial "description-or-summary.html" . }}
</article>

View File

@ -1,5 +1,5 @@
{{ define "main" }}
<div class="post-title">
<div class="page-title">
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
@ -14,7 +14,7 @@
</h1>
</div>
{{ partial "post-metadata/taxonomy.html" . }}
{{ partial "page-metadata/taxonomy.html" . }}
{{ with .Content }}
{{ . }}