80 Commits

Author SHA1 Message Date
0790ed94b9 WIP 2025-08-25 18:23:39 -05:00
c7c1ee0f0a Put title on series page in div.page-title like other taxonomy pages
This must've gotten out of sync somehow throughout the history. It
slightly changes the margins by disabling the default one on h1, which
is slightly larger than the breadcrumb nav margin-block's.
2025-08-25 13:44:08 -05:00
d90f64fb86 Only show hr on home if homepageLatestPosts enabled
Otherwise there's just a random line separator for no reason.
2025-08-24 04:05:10 -05:00
20f22b7926 Improve semantic HTML tag usage on content pages 2025-08-24 03:52:23 -05:00
267652a7e4 Use specific class for website footer instead of generic tag selector
Just in case I ever want to use the footer tag anywhere else on the
page. I'm not sure if I'm reading this right, but it sounds like it
would make sense to put all the buttons at the bottom of the content
pages as a footer as well. I will have to reconsider this again in the
future.
2025-08-24 03:49:54 -05:00
310961215e Rename list.html to taxonomy.html in authors and series
Matches the changes made in Hugo 0.146.0
2025-08-24 02:57:33 -05:00
741b3bc01b robots.txt: Stop Bing from complaining about md output not having title 2025-08-20 19:00:42 -05:00
df2fae9886 Update min_version because of template system refactor
I think this version has the newest features that I'm using. Hopefully I
didn't miss/forget about something when skimming through the Hugo
release history just now.
2025-08-16 03:21:27 -05:00
f38abfe73f archetype: Update blog to match figure shortcode revamp 2025-08-16 00:27:17 -05:00
3d55a7dabe Use individual <a> for each tag/category/etc in post metadata
Fixes #85
2025-08-09 22:34:11 -05:00
67de113bdf Change <header> to be entire top bar
This is more semantically correct.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/banner_role
2025-08-09 21:10:57 -05:00
349672bbad Hide comments counter when JavaScript disabled 2025-08-09 20:54:51 -05:00
ec382b2085 Remove unused .view-section rule
It was introduced in 906b6213fd but it
doesn't look like it was actually used for anything.
2025-08-09 20:15:44 -05:00
21f2a91b54 refactor: Move skip to main content CSS into baseof formatting section 2025-08-09 20:15:43 -05:00
0237c496ed refactor: Move components on both list & content pages to different fold 2025-08-09 20:15:38 -05:00
61d5ca29dd Set specific height of code block header
Otherwise it collapses to be too tiny if the copy button is removed.
2025-08-09 03:27:26 -05:00
8bb8720545 Hide code block copy button when JavaScript is disabled 2025-08-09 03:27:05 -05:00
bd8e34a381 Support opengraph structured properties on image and video 2025-08-09 02:53:46 -05:00
62cdcf5b11 Add warning if twitter username is missing
I don't know if the docs are correct, but they seem to say that
twitter:site is required for a card to render at all. Better safe than
sorry.

https://developer.x.com/en/docs/x-for-websites/cards/overview/markup
2025-08-09 02:40:03 -05:00
c9909762d6 Remove use of style attributes on top level comment section elements 2025-08-09 02:20:33 -05:00
cc4af0c385 Add comment explaining why comments.css is not in head 2025-08-09 02:13:15 -05:00
7aeb95a437 Add paragraph around comment section "Enable JavaScript" warning 2025-08-09 01:55:43 -05:00
14475c13f4 Remove full-width-hr shortcode
Not sure what I planned to use this for. It has since become outdated
and out of sync with the new margins I set on body recently in
4e753395ba and
6b729c6acf.
2025-08-08 14:10:20 -05:00
6b729c6acf Adjust margins on related-posts to match rest of body
Didn't notice this when writing 4e753395ba
2025-08-08 14:01:37 -05:00
f751c4b104 Remove unused .full-width-page-list rule 2025-08-08 13:51:50 -05:00
de20387b5a Fix useless scrollbar on related posts
When all related posts fit on the same screen, there was a useless
scrollbar. I never noticed this because Firefox incorrectly hides the
scrollbar automatically. The issue is visible on Chromium.
2025-08-08 13:45:30 -05:00
84004d3ac0 Change pagefind to only index the content of articles
Fixes #97
2025-08-08 01:42:25 -05:00
52a6440011 Remove heading-link class
It was used to make both website title and page titles in summaries not
have link color. Instead, just directly configure those elements.
2025-08-08 01:41:38 -05:00
322928ed7a Reorganize CSS to have better sections
- Separate baseof.html elements from styling code for general elements
  used everywhere
- Rename some of the fold titles
- Include related posts section styling in the content styling section
2025-08-08 01:28:28 -05:00
4e753395ba Align top bar with main horizontal margin
- Use a variable to make sure that top bar and body margins stay equal
- Lower side margins to 16px so that the gap in navbar-items fits right
2025-08-08 01:02:04 -05:00
5d335647d0 Remove description-or-summary partial and just use .Summary
I think this may have changed in Hugo's history, but now description and
summary are considered different things. The description is what goes in
metadata (and what search engines see), while the summary is the blurb
about the article that should be displayed when rendering a summary
(what I should've been using always here).
2025-08-07 02:17:24 -05:00
22fff1a9c5 Replace _internal subdirectory in partials
I originally put it there to mimic the old pattern before Hugo 0.148,
but it probably just makes things confusing.

Fixes #90
2025-08-07 01:05:06 -05:00
b79c956c07 Remove make figure images centered and remove border
Also use a generic .figure-media class instead of manually specifying
both img and video in the CSS

Fixes #36 and a draft issue
2025-08-05 21:49:28 -05:00
b15ca73977 Remove a few unnecessary elements when printing
- Hide clickable link icon on headings in articles
- Hide "Copy" button on code blocks
- Hide "View raw" button in page metadata
2025-07-30 01:45:11 -05:00
ccb5170d2b layouts: Rename list to section and single to page
This makes them more specific. For example, section.html can't
accidentally be a fallback for taxonomy.html, and page.html can't for
term.html.

Fixes #88
2025-07-30 01:19:19 -05:00
433dd125e2 Add comment counter to page metadata
Also move the Isso script tag from comments.html to the <head>, since it
essentially needs to load on all pages.

Fixes #94
2025-07-30 00:43:05 -05:00
d50a4dc6bd Import remaining template and styling code from bbaovanc.com
It's probably better structure-wise to have it all consolidated in
bobatheme. Then bbaovanc.com is only concerned about content, not stuff
that I declared to be specific to my site. This came from when I had
multiple sites running bobatheme in the background, so now it's just an
arbitrary, legacy distinction.

Fixes #86
2025-07-30 00:43:05 -05:00
bbe76a44bb Allow backticks in figure inline caption using \bt
Workaround for multline strings bounded with backtick not supporting any
way to escape one to type it inside the string.
2025-07-30 00:43:05 -05:00
8845272d4d Merge branch 'rewrite-figures'
Fixes #87
Fixes #61
2025-07-27 03:55:06 -05:00
5afaf2ce3e Fix fallback to resource title for figure caption 2025-07-27 03:33:44 -05:00
486fa65ad6 Finish video embed support 2025-07-27 03:33:25 -05:00
f371afe529 Support using src with custom caption parameter in figure shortcode 2025-07-27 02:34:44 -05:00
8f79d2af3a Allow using positional parameter for figure caption 2025-07-27 01:44:08 -05:00
d6cb2c12c8 Fix markdown rendering on caption of featured image 2025-07-27 01:43:59 -05:00
2fa53d1f2c Remove render-image override
We can just use the resource shortcode in content files
2025-07-27 00:44:45 -05:00
e0d2c536e4 WIP 2025-07-06 19:45:00 -05:00
8fafc843ef WIP 2025-07-06 19:44:46 -05:00
1f82ad4f0b Add support for twitter:creator tag
Put `twitter` metadata on an author
2025-07-05 02:06:39 -05:00
7e016547ec Remove redundant twitter tags since they falls back to opengraph 2025-07-05 01:46:42 -05:00
b4bff1e36d Use content view to customize <title> on author's page 2025-07-04 15:50:38 -05:00
1f9477759d Revert "debug: Show current template filename in bottom right"
This reverts commit ff4998f31b.

Not that useful. In the future, probably need to make an entire like
debug menu with a bunch of info about the current page rendering and a
bunch of variables.
2025-07-04 15:35:58 -05:00
cc7cec07df Revert "Set height and width specifically on img tag"
This reverts commit be12afb50d.

It causes issues with aspect ratio when the raw width of the image is
wider than the width in CSS pixels allowed by the body max-width.

Not reverting the refactor that removes {{ $img = . }} because I don't
know why that was there and will see if it works fine with it still
removed.
2025-07-03 20:15:17 -05:00
be12afb50d Set height and width specifically on img tag 2025-07-03 18:47:55 -05:00
9d761b2f81 Only index pages; add pagefind metadata based on series/tags/categories 2025-07-02 02:08:01 -05:00
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
92 changed files with 1050 additions and 655 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

@@ -24,7 +24,17 @@ series:
resources:
- name: feature
src: something.webp
title: Some image (image format can be anything; webp is just an example)
title: >-
Fallback title if one is not provided when calling figure shortcode with
this listed as the src
params:
alt: Write an accessible description of this image. Don't over-write.
- src: demonstration.webp
params:
alt: >-
Annotate an image without giving it an explicit name (the filename is
simply used as the `name` instead).
---

View File

@@ -158,61 +158,38 @@ pre > code {
/* }}} */
/* Basic elements {{{ */
/* Common distances/sizes {{{ */
html {
scroll-behavior: smooth;
:root {
--page-margin: 16px;
}
@media screen and (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}
/* }}} */
body {
background-color: var(--background-0);
color: var(--text-0);
overflow-wrap: break-word;
margin: 0;
}
.main-container {
margin: 20px auto;
padding: 0 20px;
max-width: 760px; /* 720px + 20px for left & right padding */
}
footer {
margin: 20px 0;
text-align: center;
font-size: smaller;
}
footer p {
margin: 0;
}
/* Common elements {{{ */
img,
video {
max-width: 100%;
}
.post-media > figure.border img,
.post-media > figure.border video {
figure > .figure-media {
padding: 5px;
border: 7px solid var(--figure-border);
}
figure.border img,
figure.border video {
padding: 5px;
figure > .figure-media.border {
border: 2px solid var(--figure-border);
}
.post-media > figure > .figure-media {
border: 7px solid var(--figure-border);
}
figure {
margin: auto;
display: inline-block;
display: block;
text-align: center;
margin: 0;
}
figcaption {
@@ -240,39 +217,31 @@ hr {
border: 1px solid var(--background-3);
}
@media (min-width: 720px) {
.full-width-hr {
/* see also: the related-posts section too */
margin-left: calc(-100vw / 2 + 760px / 2);
margin-right: calc(-100vw / 2 + 760px / 2);
}
}
table.markdown {
table.simple {
border-collapse: collapse;
border: 2px solid var(--text-1);
}
table.markdown thead {
table.simple thead {
background-color: var(--background-2);
color: var(--text-2);
border-bottom: 2px solid var(--text-1);
}
table.markdown th,
table.markdown td {
table.simple th,
table.simple td {
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);
}
table.markdown tbody tr:nth-child(odd) {
table.simple tbody tr:nth-child(odd) {
background-color: var(--background-0);
color: var(--text-0);
}
table.markdown tbody tr:nth-child(even) {
table.simple tbody tr:nth-child(even) {
background-color: var(--background-1);
color: var(--text-1);
}
@@ -291,33 +260,70 @@ table.markdown tbody tr:nth-child(even) {
/* Icons */
.icon {
width: 20px;
height: 20px;
width: 1em;
height: 1em;
color: var(--text-1);
text-align: center;
display: inline;
vertical-align: middle;
vertical-align: sub;
}
h1 svg.icon {
width: 30px;
height: 30px;
/* workarounds for some icons from jam-icons being non-square aspect ratio */
.icon-code {
width: 1.25em;
}
/* }}} */
/* Heading formatting (article section titles) {{{ */
/* Baseof formatting {{{ */
/* this is also used i.e. in page-title */
.heading-link {
color: inherit;
font-weight: bold;
html {
scroll-behavior: smooth;
}
.heading-link svg {
width: 15px;
height: 15px;
@media screen and (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}
body {
background-color: var(--background-0);
color: var(--text-0);
overflow-wrap: break-word;
margin: 0;
}
.main-container {
margin: var(--page-margin) auto;
/* use padding because otherwise there's no way to have margin be both auto, and a minimum value */
padding: 0 var(--page-margin);
max-width: calc(720px + 2 * var(--page-margin)); /* padding is included in the element's width */
}
.site-footer {
margin: var(--page-margin) 0;
text-align: center;
font-size: smaller;
}
.site-footer p {
margin: 0;
}
#skip-to-main {
position: absolute;
padding: 8px;
background-color: var(--text-0);
color: var(--background-0);
transform: translateY(-100%);
}
#skip-to-main:focus {
transform: translateY(0%);
}
#main-content:target {
animation: none; /* prevent it from turning yellow */
}
/* }}} */
@@ -330,23 +336,30 @@ h1 svg.icon {
flex-wrap: wrap;
justify-content: space-between;
background-color: var(--background-1);
/* padding can't be here because then the first navbar element will be shifted too far over,
* or it will need its hover background to be chopped off on the left */
}
.header {
.brand {
flex-grow: 1;
margin: 8px 16px;
margin: 8px var(--page-margin);
font-size: 1.25em;
display: flex;
align-items: center;
}
.brand a {
color: inherit;
font-weight: bold;
}
.navbar {
display: flex;
flex-wrap: wrap;
}
.navbar-item {
padding: 12px 16px;
padding: 12px var(--page-margin);
white-space: nowrap;
}
@@ -361,26 +374,10 @@ h1 svg.icon {
/* }}} */
/* Skip to main content {{{ */
#skip-to-main {
position: absolute;
padding: 8px;
background-color: var(--text-0);
color: var(--background-0);
transform: translateY(-100%);
}
#skip-to-main:focus {
transform: translateY(0%);
}
#main-content:target {
animation: none; /* prevent it from turning yellow */
}
/* }}} */
/* Breadcrumb navigation {{{ */
.breadcrumb {
margin: 20px 0;
margin: var(--page-margin) 0;
}
.breadcrumb ul {
@@ -488,6 +485,10 @@ h1 svg.icon {
margin-bottom: 10px;
}
.page-title a {
color: inherit;
}
.page-title h1 {
margin: 0;
}
@@ -505,6 +506,14 @@ h1 svg.icon {
margin-top: 10px;
}
:is(
.page-metadata-section:is(.categories, .tags, .series),
.page-metadata-item.authors
) > a:not(:last-child):after {
color: var(--text-0);
content: ",";
}
.post-media {
margin-top: 15px;
}
@@ -631,14 +640,10 @@ h1 svg.icon {
margin-bottom: 5px;
}
.view-section {
margin-top: 5px;
}
/* }}} */
/* Content (single) formatting {{{ */
/* Components exclusive to content/single pages {{{ */
.series-box {
background-color: var(--background-1);
@@ -676,6 +681,7 @@ h1 svg.icon {
display: flex;
gap: 8px;
justify-content: center;
font-size: 32px;
}
.share-buttons a {
@@ -690,8 +696,7 @@ h1 svg.icon {
}
.share-buttons svg {
width: 32px;
height: 32px;
display: block;
}
/* https://stackoverflow.com/a/72073682/19003757 */
@@ -702,19 +707,6 @@ h1 svg.icon {
}
*/
/* See also formating */
.see-also {
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 12px;
border-radius: 8px;
margin: 10px 0;
}
.see-also p {
margin: 0;
}
/* Previous and next page buttons {{{ */
.prevnext {
@@ -765,6 +757,45 @@ h1 svg.icon {
/* }}} */
/* Related posts section {{{ */
/* set the margins on the contents instead of the parent .related-posts
* so that the posts in the list clip off the edge of the screen,
* which makes a more obvious indicator that it's scrollable
*/
.related-posts > hr,
.related-posts > h1 {
margin: var(--page-margin);
}
.related-posts .page {
min-width: 300px;
max-width: 300px;
}
.related-posts .page:first-child {
margin-left: var(--page-margin);
}
.related-posts .page:last-child {
margin-right: var(--page-margin);
}
.related-posts .page-list {
display: flex;
flex-direction: row;
gap: 20px;
overflow-x: auto;
margin-bottom: var(--page-margin);
}
/* }}} */
/* }}} */
/* Content components (can appear both in single and list pages) {{{ */
/* Code & code blocks {{{ */
.code-block {
display: flex;
@@ -781,10 +812,13 @@ h1 svg.icon {
padding: 4px 8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
height: 2em;
}
.code-block > .code-header > * {
margin: auto 0;
}
.code-block > .code-header > .code-type {
border-top-left-radius: 8px;
margin: auto 0;
}
/* TODO: make the code copy button prettier */
.code-block > .code-header > .code-copy-button {
@@ -878,44 +912,23 @@ aside.quote {
/* }}} */
/* }}} */
/* Related posts section {{{ */
.full-width-page-list {
/* make left/right 0 margin so it takes up full width */
margin: 25px 0;
/* See also formating */
.see-also {
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 12px;
border-radius: 8px;
margin: 10px 0;
}
.related-posts > hr,
.related-posts > h1 {
margin-left: 20px;
margin-right: 20px;
}
.related-posts .page {
min-width: 300px;
max-width: 300px;
}
.related-posts .page:first-child {
margin-left: 20px;
}
.related-posts .page:last-child {
margin-right: 20px;
}
.related-posts .page-list {
display: flex;
flex-direction: row;
gap: 20px;
overflow-x: scroll;
.see-also p {
margin: 0;
}
/* }}} */
/* @media specializations {{{ */
/* Light mode */
@@ -929,8 +942,10 @@ aside.quote {
/* Print compatibility {{{ */
@media print {
.top > .navbar,
.section-header-link,
.content-heading-link,
.post-meta-edit-history,
.post-meta-view-markdown,
.code-copy-button,
.prevnext,
.share-buttons,
.related-posts {

132
assets/css/comments.css Normal file
View File

@@ -0,0 +1,132 @@
.comments > h2 {
margin-bottom: 0;
}
.comments .email-address-notice {
margin: 0;
font-size: smaller;
}
.comments .enable-javascript-notice {
font-style: italic;
}
/* Isso styling */
h4.isso-thread-heading {
color: var(--text-0);
margin-bottom: 8px;
}
.isso-comment:not(:first-of-type),
.isso-follow-up .isso-comment {
border-color: var(--background-3);
}
.isso-author,
.isso-page-author-suffix,
.isso-comment-footer,
.isso-comment-footer .isso-votes {
color: var(--text-gray-0);
}
.isso-comment-header .isso-spacer,
.isso-spacer:hover,
.isso-permalink,
.isso-permalink:hover {
color: var(--text-gray-1) !important;
}
a.isso-author:hover,
.isso-permalink:hover {
text-decoration: underline !important;
}
.isso-comment.isso-is-page-author > .isso-text-wrapper {
background-color: var(--background-accent-1);
}
.isso-feedlink:hover,
.isso-reply {
color: var(--link-0) !important;
text-shadow: unset !important;
}
.isso-reply:hover {
text-decoration: underline;
}
.isso-text pre,
.isso-text :not(pre) > code {
background-color: var(--background-2);
border: none;
padding: 2px 4px;
border-radius: 5px;
/* thanks isso.css for setting this to 85% for whatever reason */
font-size: 0.75em;
}
.isso-input-wrapper input,
.isso-post-action > input,
.isso-textarea,
.isso-preview {
color: var(--text-1);
background-color: var(--background-1);
border-color: var(--background-2) !important;
}
.isso-input-wrapper input:focus,
.isso-textarea:focus {
border-color: var(--background-3) !important;
}
.isso-post-action > input:hover {
background-color: var(--background-2);
}
.isso-post-action > input:focus,
.isso-post-action > input:active {
background-color: var(--background-3);
}
.isso-textarea {
margin-bottom: 4px;
}
.isso-input-wrapper {
display: inline-flex;
flex-direction: column;
margin-right: 4px;
max-width: 25%;
}
.isso-input-wrapper input {
order: 1;
}
.isso-input-wrapper label {
order: 2;
font-size: small;
}
.isso-post-action {
margin-left: 4px;
margin-top: 0;
}
@media screen and (max-width: 600px) {
.isso-input-wrapper {
display: block;
max-width: 100%;
}
}
@media print {
.comments {
break-before: always;
}
.isso-comment {
max-width: unset;
}
.isso-text-wrapper {
break-inside: avoid;
}
.isso-postbox,
.isso-feedlink {
display: none;
}
}
.isso-target {
animation: target-fade 10s ease-out; /* defined in bobatheme */
}

4
assets/css/noscript.css Normal file
View File

@@ -0,0 +1,4 @@
.page-meta-comments-counter,
.code-copy-button {
display: none;
}

9
assets/css/search.css Normal file
View File

@@ -0,0 +1,9 @@
/* put on body so it overrides the defaults set in :root by pagefind.css */
body {
/* https://pagefind.app/docs/ui-usage/#customising-the-styles */
--pagefind-ui-background: var(--background-1);
--pagefind-ui-border: var(--background-2);
--pagefind-ui-primary: var(--link-0);
--pagefind-ui-tag: var(--background-1);
--pagefind-ui-text: var(--text-1);
}

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,3 +1,3 @@
function share_event(service) {
// this function does nothing by default
plausible("Share", {props: {Network: service}});
}

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

@@ -7,6 +7,8 @@ table_of_contents:
browser_no_video_support:
other: "Your browser does not support video."
browser_no_video_support_link:
other: "Click here to download it instead."
latest_posts:
other: "Latest Posts"
@@ -30,6 +32,9 @@ readingtime:
edit_history:
other: "Edit history"
view_markdown:
other: "View raw"
# Post count
no_posts:
@@ -67,6 +72,9 @@ aria_rss_link:
aria_post_meta_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:
other: "categories"

View File

@@ -1,25 +0,0 @@
{{ define "main" }}
<h1>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="list-page-container">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary" }}
{{ end }}
</div>
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "pagination.html" . }}
{{ end }}

View File

@@ -1,88 +0,0 @@
{{ define "main" }}
<div class="page-title">
<h1>
{{ .Title | markdownify }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h1>
</div>
{{ partial "page-metadata/post-full.html" . }}
{{ partial "series-box.html" . }}
{{ if .Params.Toc }}
<div class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
<details>
<summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }}
</details>
</div>
<div class="table-of-contents print">
{{ i18n "table_of_contents" }}
{{ .TableOfContents }}
</div>
{{ end }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}
<article class="post-content">
{{ .Content }}
</article>
{{ partial "series-box.html" . }}
{{ if or .NextInSection .PrevInSection }}
<div class="prevnext">
{{ with .NextInSection }}
<a class="prev" href="{{ .Permalink }}">
<div class="prev-caption">
&larr; {{ i18n "newer_post" }}
</div>
<div class="prev-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="prev"></div>
{{ end }}
{{ with .PrevInSection }}
<a class="next" href="{{ .Permalink }}">
<div class="next-caption">
{{ i18n "older_post" }} &rarr;
</div>
<div class="next-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="next"></div>
{{ end }}
</div>
{{ end }}
{{ if .Site.Params.shareButtons }}
{{ partial "share.html" . }}
{{ end }}
{{ if .Params.comments }}
<div class="comments">
{{ partial "comments.html" . }}
</div>
{{ end }}
{{ end }}
{{ define "post-body" }}
{{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }}
<div class="related-posts">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}
{{ end }}

View File

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

View File

@@ -0,0 +1,20 @@
{{/* put comments CSS here instead of in <head> so that it doesn't get
* loaded unnecessarily on regular pages
*/}}
{{ with resources.Get "css/comments.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
<h2>Comments</h2>
<p class="email-address-notice">
If you provide an email address, you can enable notifications for
replies to your comment. It will not be shown publicly.
</p>
<noscript>
<p class="enable-javascript-notice">
Enable JavaScript to see the comment section.
</p>
</noscript>
<section id="isso-thread" data-title="{{ .Title }}"></section>

View File

@@ -0,0 +1,23 @@
{{ if eq .ResourceType "image" }}
{{/* TODO: figure out whether loading="lazy" should be set because MDN
* claims that images won't work with JS disabled since it would
* make tracking possible, but my experience says otherwise
*/}}
<img class="figure-media" src="{{ .Permalink }}" {{ with .Params.alt }}alt="{{ . }}"{{ end }} />
{{ else if eq .ResourceType "video" }}
<video class="figure-media" controls preload="metadata">
{{ with .Params.alt }}
{{ warnf "video does not support alt text, '%s'" . }}
{{ end }}
<source src="{{ .Permalink }}" />
{{ i18n "browser_no_video_support" }}
<a href="{{ .Permalink }}" target="_blank" rel="noopener">
{{ i18n "browser_no_video_support_link" }}
</a>
</video>
{{ else }}
{{/* TODO: could consider implementing more types, listed at:
* https://www.iana.org/assignments/media-types/media-types.xhtml
*/}}
{{ errorf "Handling %q resource not supported" .ResourceType }}
{{ end }}

View File

@@ -0,0 +1,10 @@
{{ with .Resources.Get "feature" }}
<div class="post-media">
<figure>
{{ partial "embed-resource.html" . }}
{{ with .Title }}
<figcaption>{{ . | markdownify }}</figcaption>
{{ end }}
</figure>
</div>
{{ end }}

106
layouts/_partials/head.html Normal file
View File

@@ -0,0 +1,106 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ hugo.Generator }}
{{ with resources.Get "css/bobastyle.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ with resources.Get "css/noscript.css" | fingerprint "sha512" }}
<noscript>
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
</noscript>
{{ end }}
{{ with resources.Get "css/syntax.css" | fingerprint "sha512" }}
<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" media="print" onload="this.media='all'">
{{ end }}
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ if not hugo.IsServer }}
<script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.outbound-links.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ end }}
{{ $isso_url := .Permalink }}
{{ if .IsTranslated }}
{{ with index .AllTranslations 0 }}
{{ $isso_url = .Permalink }}
{{ end }}
{{ end }}
<script defer src="https://isso.bbaovanc.com/js/embed.min.js"
data-isso-id="{{ $isso_url }}"
data-isso-default-lang="{{ .Language.Lang }}"
data-isso-css="true"
data-isso-max-comments-top="inf"
data-isso-max-comments-nested="inf"
data-isso-reveal-on-click="5"
{{/*
data-isso-avatar-bg="#111"
data-isso-avatar-fg="#9abf88 #5698c4 #e279a3 #9163b6 ..."
*/}}
data-isso-vote="true"
{{/*
data-isso-vote-levels=""
*/}}
data-isso-feed="true"
data-isso-require-email="false"
data-isso-reply-notifications="true"
data-isso-reply-notifications-default-enabled="true"
{{ with (.GetTerms "authors") }}
{{ $authorHashes := slice }}
{{ range . }}
{{ with .Params.issoUserID }}
{{ $authorHashes = $authorHashes | append . }}
{{ end }}
{{ end }}
data-isso-page-author-hashes="{{ delimit $authorHashes "," }}"
{{ end }}
>
</script>
{{ if eq .Layout "search" }}
{{ with resources.Get "css/search.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
<link rel="stylesheet" type="text/css" href="{{ absURL "pagefind/pagefind-ui.css" }}" crossorigin="anonymous">
<script src="{{ absURL "pagefind/pagefind-ui.js" }}" crossorigin="anonymous"></script>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search-box", showSubResults: true });
});
</script>
{{ end }}
{{ with .Site.Params.faviconSVG }}
<link rel="icon" href="{{ . | absURL }}" />
{{ end }}
{{ with .Site.Params.appleTouchPNG }}
<link rel="apple-touch-icon" href="{{ . | absURL }}" />
{{ end }}
<title>{{ .Render "head_title" }}</title>
{{ range .Site.Params.rel_me }}
<link rel="me" href="{{ . }}" />
{{ end }}
{{ partial "seo-tags/opengraph.html" . }}
{{ partial "seo-tags/twitter-cards.html" . }}
{{ partial "seo-tags/schema.html" . }}
{{ partial "seo-tags/link.html" . }}
{{ partial "seo-tags/author.html" . }}
<meta name="language" content="{{ .Language.Lang }}">
<meta name="description" content="{{ (partial "seo-description.html" .) | plainify }}">
</head>

View File

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

View File

@@ -0,0 +1,9 @@
{{ with .GetTerms "authors" }}
<span class="page-metadata-item authors" aria-label="{{ i18n "aria_post_meta_authors" }}">
{{ partial "icon.html" "user-circle" }}
{{ range . }}
<a href="{{ .Permalink }}" data-pagefind-filter="author">{{ .LinkTitle }}</a>
{{ end }}
</span>
{{ end }}

View File

@@ -6,6 +6,8 @@
<div class="page-metadata-section categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
{{ partial "icon.html" "folder" }}
{{ delimit $categories ", " | safeHTML }}
{{ range . }}
<a href="{{ .Permalink }}" data-pagefind-filter="category">{{ .LinkTitle }}</a>
{{ end }}
</div>
{{ end }}

View File

@@ -0,0 +1,8 @@
<span class="page-metadata-item page-meta-comments-counter" aria-label="comments counter">
{{ partial "icon.html" "message" }}
{{/* TODO: figure out if there's a nicer way to generate this URL
* the current issue is that we can't use RelRef, since content view means that we don't
* have access to the original page context
*/}}
<a href="{{ .RelPermalink }}#isso-thread">comments</a>
</span>

View File

@@ -0,0 +1,8 @@
{{ with (.GetTerms "series") }}
<div class="page-metadata-section series" aria-label="{{ i18n "aria_post_meta_series" }}">
{{ partial "icon.html" "files" }}
{{ range . }}
<a href="{{ .Permalink }}" data-pagefind-filter="series">{{ .LinkTitle }}</a>
{{ end }}
</div>
{{ end }}

View File

@@ -1,11 +1,10 @@
{{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="page-metadata-section tags" aria-label="{{ i18n "aria_post_meta_tags" }}">
{{ partial "icon.html" "tag" }}
{{ delimit $tags ", " | safeHTML }}
{{ range . }}
<a href="{{ .Permalink }}" data-pagefind-filter="tag">{{ .LinkTitle }}</a>
{{ end }}
</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

@@ -1,5 +1,5 @@
{{ if or .Date .Params.authors .Site.Params.readingtime .Site.Params.gitFileURL }}
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
<section 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" }}
@@ -20,7 +20,11 @@
{{ 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/comments-counter.html" . }}
{{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }}
</div>
</section>
{{ end }}

View File

@@ -1,5 +1,5 @@
{{ if or .Date .Params.authors .Site.Params.readingtime }}
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
<section class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="page-metadata-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
@@ -9,8 +9,10 @@
{{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/comments-counter.html" . }}
{{ partial "page-metadata/item/series.html" . }}
{{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }}
</div>
</section>
{{ end }}

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

@@ -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 "pagination-hugo.html" . }}
</nav>
{{ end }}

View File

@@ -3,16 +3,6 @@
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ with $featured }}
<meta property="og:image" content="{{ $featured.Permalink }}">
{{ end }}
{{ with .Section }}
<meta property="article:section" content="{{ . }}">
{{ end }}
@@ -33,16 +23,42 @@
<meta property="og:locale" content="{{ . }}">
{{ end }}
{{ with .Site.Params.title }}
{{ with .Site.Title }}
<meta property="og:site_name" content="{{ . }}">
{{ end }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ with $featured }}
<meta property="og:image" content="{{ $featured.Permalink }}">
{{ with .Params.alt }}
<meta property="og:image:alt" content="{{ . }}">
{{ end }}
{{ with .MediaType }}
<meta property="og:image:type" content="{{ . }}">
{{ end }}
{{ with .Width }}
<meta property="og:image:width" content="{{ . }}">
{{ end }}
{{ with .Height }}
<meta property="og:image:height" content="{{ . }}">
{{ end }}
{{ end }}
{{ $videos := $.Resources.ByType "video" }}
{{ $featured_video := $videos.GetMatch "*feature*" }}
{{ if not $featured_video }}
{{ $featured_video = $videos.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ with $featured_video }}
<meta property="og:video" content="{{ $featured_video.Permalink | absURL }}">
{{ with .MediaType }}
<meta property="og:video:type" content="{{ . }}">
{{ end }}
{{ end }}

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

@@ -0,0 +1,43 @@
{{/* we do not need to duplicate what's already covered by OpenGraph tags
* see: https://demo.bbaovanc.com/test/remove-twitter-tags/blog/swapfile-guide/
* so, no twitter:image/title/description
*/}}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ with $featured }}
{{ $ratio := 0 }}
{{ if gt .Width .Height }}
{{ $ratio = div (float .Width) .Height }}
{{ else }}
{{ $ratio = div (float .Height) .Width }}
{{ end }}
{{ if lt $ratio 1.75 }}
<meta name="twitter:card" content="summary_large_image">
{{ else }}
<meta name="twitter:card" content="summary">
{{ end }}
{{ else }}
<meta name="twitter:card" content="summary">
{{ end }}
{{/* twitter:site is the site author; twitter:creator is page author
* https://developer.x.com/en/docs/x-for-websites/cards/guides/getting-started
* "Card and Content Attribution"
*/}}
{{ with .Site.Params.social.twitter }}
<meta name="twitter:site" content="@{{ . }}">
{{ else }}
{{ errorf "a twitter username is required for twitter cards to work" }}
{{ end }}
{{ with .GetTerms "authors" }}
{{ range . }}
{{ with .Params.twitter }}
<meta name="twitter:creator" content="@{{ . }}">
{{ end }}
{{ end }}
{{ end }}

View File

@@ -1,4 +1,4 @@
<div class="share-buttons">
<section class="share-buttons">
{{ if .Site.Params.shareButtons.twitter }}
<a class="twitter-share"
target="_blank"
@@ -66,4 +66,4 @@
{{- partial "icon.html" "printer" -}}
</a>
{{ end }}
</div>
</section>

View File

@@ -1,9 +1,9 @@
<div class="top">
<header class="header">
<a class="heading-link" href="{{ .Site.Home.Permalink | absLangURL }}">
<header class="top">
<div class="brand">
<a href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }}
</a>
</header>
</div>
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}">
{{ with .Site.Home }}
@@ -21,4 +21,4 @@
href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>
</div>
</header>

View File

@@ -0,0 +1,17 @@
<figure>
{{ $resource_title := "" }}
{{ with .Get "src" }}
{{ with $.Page.Resources.Get . }}
{{ $resource_title = .Title }}
{{ partial "embed-resource.html" . }}
{{ else }}
{{ errorf "resource %q not found" . }}
{{ end }}
{{ else }}
{{ .Inner }}
{{ end }}
{{ with or (.Get "caption") (.Get 0) $resource_title }}
<figcaption>{{ (replace . "\\bt" "`") | markdownify }}</figcaption>
{{ end }}
</figure>

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

@@ -0,0 +1,9 @@
{{ with .Get 0 }}
{{ with $.Page.Resources.Get . }}
{{ partial "embed-resource.html" . }}
{{ else }}
{{ errorf "resource %q not found" . }}
{{ end }}
{{ else }}
{{ errorf "resource name not provided as first parameter" }}
{{ end }}

View File

@@ -1,24 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
{{ range . }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ end }}

View File

@@ -1,13 +1,15 @@
<h2 class="page-title">
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<a 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>
{{ with .Summary }}
<div class="page-description">
{{ . }}
</div>
{{ end }}
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>

View File

@@ -0,0 +1,30 @@
{{ define "main" }}
<section>
{{ if .Content }}<article>{{ end }}
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
{{ if .Content }}</article>{{ end }}
<section class="page-list">
{{ with .Paginator.Pages }}
{{ range . }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</section>
</section>
{{ end }}

View File

@@ -0,0 +1 @@
{{ (print .Title "'s Posts | " .Site.Title) | plainify }}

View File

@@ -18,23 +18,23 @@
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 class="site-footer">
{{ with .Site.Copyright }}
{{ . | safeHTML }}
{{ end }}
{{ with .Site.Params.footer }}
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
</footer>
{{ end }}
</div>
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
{{ if or .Site.Copyright .Site.Params.footer }}
<footer>
{{ with .Site.Copyright }}
<p>{{ . | safeHTML }}</p>
{{ end }}
{{ with .Site.Params.footer }}
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
</footer>
{{ end }}
</body>
</html>

1
layouts/head_title.html Normal file
View File

@@ -0,0 +1 @@
{{ (print .Title " | " .Site.Title) | plainify }}

View File

@@ -0,0 +1 @@
{{ .Site.Title | plainify }}

View File

@@ -3,11 +3,11 @@
<article class="homepage-content">
{{ . }}
</article>
<hr>
{{ end }}
{{ if .Site.Params.homepageLatestPosts }}
<div class="homepage-latest-posts">
<hr>
<section class="homepage-latest-posts">
<h1>
{{ i18n "latest_posts" }}
{{ partial "rss-link.html" . }}
@@ -16,6 +16,6 @@
{{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }}
{{ partial "pagination.html" . }}
</div>
</section>
{{ end }}
{{ end }}

86
layouts/page.html Normal file
View File

@@ -0,0 +1,86 @@
{{ define "main" }}
<article>
<div class="page-title">
<h1>
{{ .Title | markdownify }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h1>
</div>
{{ partial "page-metadata/post-full.html" . }}
{{ partial "series-box.html" . }}
{{ if .Params.Toc }}
<section class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
<details>
<summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }}
</details>
</section>
<div class="table-of-contents print">
{{ i18n "table_of_contents" }}
{{ .TableOfContents }}
</div>
{{ end }}
{{ partial "feature-figure.html" . }}
<div class="post-content" data-pagefind-body>
{{ .Content }}
</div>
{{ partial "series-box.html" . }}
{{ if or .NextInSection .PrevInSection }}
<nav class="prevnext">
{{ with .NextInSection }}
<a class="prev" href="{{ .Permalink }}">
<div class="prev-caption">
&larr; {{ i18n "newer_post" }}
</div>
<div class="prev-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="prev"></div>
{{ end }}
{{ with .PrevInSection }}
<a class="next" href="{{ .Permalink }}">
<div class="next-caption">
{{ i18n "older_post" }} &rarr;
</div>
<div class="next-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="next"></div>
{{ end }}
</nav>
{{ end }}
{{ if .Site.Params.shareButtons }}
{{ partial "share.html" . }}
{{ end }}
{{ if .Params.comments }}
<section class="comments">
{{ partial "comments.html" . }}
</section>
{{ end }}
</article>
{{ end }}
{{ define "post-body" }}
{{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }}
<div class="related-posts">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}
{{ end }}

9
layouts/page.markdown.md Normal file
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,4 +0,0 @@
{{/*
Create a file named `layouts/partials/comments.html` at your site root to
add a comment system. Page variables are passed.
*/}}

View File

@@ -1,7 +0,0 @@
{{ with .Description }}
<p>{{ . | markdownify }}</p>
{{ else }}
{{ with .Summary }}
{{ . }}
{{ end }}
{{ end }}

View File

@@ -1,28 +0,0 @@
{{ $hidecaption := index . "hidecaption" }}
{{ if index . "noborder" }}
<figure>
{{ else }}
<figure class="border">
{{ end }}
{{ with index . "src" }}
{{ $media := . }}
{{ if eq .MediaType.MainType "image" }}
<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 }}">
{{ i18n "browser_no_video_support" }}
</video>
{{ end }}
{{ if not $hidecaption }}
{{ with $media.Title }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
{{ end }}
{{ end }}
</figure>

View File

@@ -1,46 +0,0 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ hugo.Generator }}
{{ with resources.Get "css/bobastyle.css" | fingerprint "sha512" }}
<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" 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" media="print" onload="this.media='all'">
{{ end }}
{{ 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 }}" />
{{ end }}
{{ with .Site.Params.appleTouchPNG }}
<link rel="apple-touch-icon" href="{{ . | absURL }}" />
{{ end }}
{{ if .IsHome }}
<title>{{ .Site.Title | plainify }}</title>
{{ else }}
<title>{{ (print .Title " | " .Site.Title) | plainify }}</title>
{{ end }}
{{ partial "seo-tags/opengraph.html" . }}
{{ partial "seo-tags/twitter-cards.html" . }}
{{ partial "seo-tags/schema.html" . }}
{{ partial "seo-tags/link.html" . }}
{{ partial "seo-tags/author.html" . }}
<meta name="language" content="{{ .Language.Lang }}">
<meta name="description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ partial "additional-head.html" . }}
</head>

View File

@@ -1,16 +0,0 @@
{{ with .Params.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 .) }}
{{ end }}
{{ delimit $authors ", " | safeHTML }}
{{ else }}
{{ delimit . ", " }}
{{ end }}
</span>
{{ end }}

View File

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

View File

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

View File

@@ -1,28 +0,0 @@
{{ $hidecaption := index . "hidecaption" }}
{{ $type := index . "type" }}
{{ $src := index . "src" }}
{{ $alt := index . "alt" }}
{{ if index . "border" }}
<figure class="border">
{{ else }}
<figure>
{{ end }}
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
{{ else if eq $type "video" }}
<video controls preload="metadata">
<source src="{{ $src }}" alt="{{ $alt }}">
{{ i18n "browser_no_video_support" }}
</video>
{{ end }}
{{ if not $hidecaption }}
{{ with $alt }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
{{ end }}
</figure>

View File

@@ -1,29 +0,0 @@
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ with $featured }}
{{ $ratio := 0 }}
{{ if gt .Width .Height }}
{{ $ratio = div (float .Width) .Height }}
{{ else }}
{{ $ratio = div (float .Height) .Width }}
{{ end }}
{{ if lt $ratio 1.75 }}
<meta name="twitter:card" content="summary_large_image">
{{ else }}
<meta name="twitter:card" content="summary">
{{ end }}
<meta name="twitter:image" content="{{ $featured.Permalink }}">
{{ end }}
<meta name="twitter:title" content="{{ .Title | plainify }}">
<meta name="twitter:description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ with .Site.Social.twitter }}
<meta name="twitter:site" content="@{{ . }}">
{{ end }}

View File

@@ -1,2 +1,6 @@
User-Agent: *
Sitemap: {{ "sitemap.xml" | absLangURL }}
{{/* It complains about the raw markdown output having no title tag */ -}}
User-Agent: Bingbot
Disallow: /blog/*.md$

3
layouts/search.html Normal file
View File

@@ -0,0 +1,3 @@
{{ define "main" }}
<div id="search-box"></div>
{{ end }}

27
layouts/section.html Normal file
View File

@@ -0,0 +1,27 @@
{{ define "main" }}
<section>
<h1>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="list-page-container">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary" }}
{{ end }}
</div>
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "pagination.html" . }}
</section>
{{ end }}

View File

@@ -5,8 +5,10 @@
{{ .Title | markdownify }}
</h2>
<div class="section-description">
{{ partial "description-or-summary.html" . }}
</div>
{{ with .Summary }}
<div class="section-description">
{{ . }}
</div>
{{ end }}
</div>
</a>

View File

@@ -1,14 +1,16 @@
<h2 class="page-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<a 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>
{{ with .Summary }}
<div class="page-description">
{{ . }}
</div>
{{ end }}
<div class="page-list series-inner">
{{ range .Data.Pages.Reverse }}

View File

@@ -1,8 +1,10 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "files" }}
{{ .Title | markdownify }}
</h1>
<div class="page-title">
<h1>
{{ partial "icon.html" "files" }}
{{ .Title | markdownify }}
</h1>
</div>
{{ with .Content }}
{{ . }}

View File

@@ -1,15 +0,0 @@
{{ $resource := .Page.Resources.GetMatch (.Get "src") }}
{{ $noborder := false }}
{{ if .Get "noborder" }}
{{ $noborder = true }}
{{ end }}
{{ $hidecaption := false }}
{{ if .Get "hidecaption" }}
{{ $hidecaption = true }}
{{ end }}
<p>
{{ partial "figure.html" (dict "src" $resource "noborder" $noborder "hidecaption" $hidecaption) }}
</p>

View File

@@ -1 +0,0 @@
<hr class="full-width-hr">

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,13 +0,0 @@
{{ $border := false }}
{{ if .Get "border" }}
{{ $border = true }}
{{ end }}
{{ $hidecaption := false }}
{{ if .Get "hidecaption" }}
{{ $hidecaption = true }}
{{ end }}
<p>
{{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" (.Get "type") "alt" (.Get "alt")) }}
</p>

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

@@ -1,21 +1,19 @@
<h2 class="page-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/post-short.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" .) }}
{{ partial "feature-figure.html" . }}
{{ with .Summary }}
<div class="page-description">
{{ . }}
</div>
{{ end }}
<div class="page-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@@ -28,7 +28,7 @@
</a>
{{ partial "page-metadata/taxonomy.html" . }}
</div>
{{ partial "description-or-summary.html" . }}
{{ .Summary }}
</article>
{{ end }}
{{ end }}

View File

@@ -8,7 +8,7 @@ description = "Simple Hugo theme for boba.best and bbaovanc.com"
homepage = "https://bbaovanc.com"
tags = []
features = []
min_version = "0.93.0"
min_version = "0.146.0"
[author]
name = "bbaovanc"