Compare commits

...

13 Commits

Author SHA1 Message Date
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 f33492ef8ec0c1fe8ab769dfcad267040bb2070b and 5c87c2b0694dd3ba410eaad6cad10f677d66809f.

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
13 changed files with 45 additions and 63 deletions

View File

@ -361,23 +361,6 @@ h1 svg.icon {
/* }}} */
/* Back to top {{{ */
#top {
font-size: 0;
}
#back-to-top {
position: fixed;
float: right;
bottom: 25px;
right: 25px;
background-color: var(--background-1);
color: var(--text-1);
border-radius: 100%;
padding: 12px;
display: none;
}
/* }}} */
/* Skip to main content {{{ */
#skip-to-main {
position: absolute;
@ -989,10 +972,6 @@ aside.quote {
.table-of-contents.print {
display: block;
}
#back-to-top {
display: none !important;
}
}
/* }}} */

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

@ -4,15 +4,20 @@ 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
pagination:
pagerSize: 5
taxonomies:
_merge: deep
markup: # this just keeps the bobatheme markup styling
_merge: deep
outputs:
_merge: deep
params:
author:
name: bbaovanc

View File

@ -12,6 +12,11 @@ taxonomies:
author: authors
series: series
outputs:
page:
- html
- markdown
privacy:
googleAnalytics:
disable: true

View File

@ -4,20 +4,8 @@
{{ partial "head.html" . }}
<body>
<a id="top" aria-hidden="true"></a>
<a id="skip-to-main" href="#main-content">Skip to main content</a>
<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>
{{ partial "top.html" . }}
<div class="main-container">
@ -39,7 +27,7 @@
{{ if or .Site.Copyright .Site.Params.footer }}
<footer>
{{ with .Site.Copyright }}
<p>{{ . | safeHTML }}</p>
{{ . | safeHTML }}
{{ end }}
{{ with .Site.Params.footer }}

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

@ -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,10 +7,10 @@
<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" }}

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