2 Commits

9 changed files with 68 additions and 36 deletions

View File

@ -361,6 +361,23 @@ 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 content {{{ */
#skip-to-main { #skip-to-main {
position: absolute; position: absolute;
@ -858,22 +875,22 @@ aside {
} }
aside.note { aside.note {
background-color: var(--accent-blue-1); background-color: var(--background-blue-1);
} }
aside.info { aside.info {
background-color: var(--accent-green-1); background-color: var(--background-green-1);
} }
aside.tip { aside.tip {
background-color: var(--accent-teal-1); background-color: var(--background-teal-1);
} }
aside.warning { aside.warning {
background-color: var(--accent-yellow-1); background-color: var(--background-yellow-1);
} }
aside.example { aside.example {
background-color: var(--accent-purple-1); background-color: var(--background-purple-1);
} }
aside.quote { aside.quote {
background-color: var(--accent-1); background-color: var(--background-1);
} }
/* }}} */ /* }}} */
@ -973,32 +990,8 @@ aside.quote {
display: block; display: block;
} }
/* #back-to-top {
* reduce usage of background colors display: none !important;
*/
aside {
background-color: unset !important;
border: 4px solid;
}
aside.note {
border-color: var(--background-blue-1);
}
aside.info {
border-color: var(--background-green-1);
}
aside.tip {
border-color: var(--background-teal-1);
}
aside.warning {
border-color: var(--background-yellow-1);
}
aside.example {
border-color: var(--background-purple-1);
}
aside.quote {
border-color: var(--background-1);
} }
} }

View File

@ -1,3 +1,13 @@
// 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 // code block copy to clipboard
window.onload = () => { window.onload = () => {
document.querySelectorAll(".code-block").forEach(codeBlock => { document.querySelectorAll(".code-block").forEach(codeBlock => {

View File

@ -13,6 +13,9 @@ taxonomies:
markup: # this just keeps the bobatheme markup styling markup: # this just keeps the bobatheme markup styling
_merge: deep _merge: deep
outputs:
_merge: deep
params: params:
author: author:
name: bbaovanc name: bbaovanc

View File

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

View File

@ -4,8 +4,20 @@
{{ partial "head.html" . }} {{ partial "head.html" . }}
<body> <body>
<a id="top" aria-hidden="true"></a>
<a id="skip-to-main" href="#main-content">Skip to main content</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" . }} {{ partial "top.html" . }}
<div class="main-container"> <div class="main-container">

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" }} {{ with index . "src" }}
{{ $media := . }} {{ $media := . }}
{{ if eq .MediaType.MainType "image" }} {{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" /> <img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
{{ else if eq .MediaType.MainType "video" }} {{ else if eq .MediaType.MainType "video" }}
<video controls preload="metadata"> <video controls preload="metadata">
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}"> <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"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{ end }}
{{ with resources.Get "css/syntax.css" | fingerprint "sha512" }} {{ 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'"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{ end }}
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }} {{ 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'"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{ end }}
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }} {{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}

View File

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