mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-13 09:57:30 -05:00
Compare commits
25 Commits
0b3b160e87
...
master
Author | SHA1 | Date | |
---|---|---|---|
6e7160efbb
|
|||
04c3c007a8
|
|||
ad7432155f
|
|||
0aaf865b75
|
|||
c9095e948b
|
|||
ddb57e0120
|
|||
9b851ce0e4
|
|||
f34cffb849
|
|||
91994df910
|
|||
e84f334591
|
|||
ebf39263a6
|
|||
77afe66aa6
|
|||
788583ea23
|
|||
4216b9ed6f
|
|||
54e639ecc3
|
|||
c980ced2fb
|
|||
9ca15a198f
|
|||
5c87c2b069
|
|||
6c42ae9518
|
|||
f33492ef8e
|
|||
ffcae79156
|
|||
a59a87374b
|
|||
88adfbdf89
|
|||
0f717e81c0
|
|||
ede5958a46
|
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,4 +1,4 @@
|
|||||||
[submodule "assets/jam"]
|
[submodule "assets/jam"]
|
||||||
path = assets/jam
|
path = assets/jam
|
||||||
url = https://github.com/michaelampr/jam.git
|
url = https://github.com/BBaoVanC/jam.git
|
||||||
branch = master
|
branch = master
|
||||||
|
@ -8,7 +8,7 @@ comments: true
|
|||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
|
- {{ with .Site.Params.author.name }}{{ . }}{{ else }}John Doe{{ end }}
|
||||||
|
|
||||||
categories:
|
categories:
|
||||||
- archetype-stuff
|
- archetype-stuff
|
||||||
|
@ -6,7 +6,7 @@ toc: true
|
|||||||
comments: false
|
comments: false
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
|
- {{ with .Site.params.author.name }}{{ . }}{{ else }}John Doe{{ end }}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -248,31 +248,31 @@ hr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table.markdown {
|
table.simple {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border: 2px solid var(--text-1);
|
border: 2px solid var(--text-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
table.markdown thead {
|
table.simple thead {
|
||||||
background-color: var(--background-2);
|
background-color: var(--background-2);
|
||||||
color: var(--text-2);
|
color: var(--text-2);
|
||||||
border-bottom: 2px solid var(--text-1);
|
border-bottom: 2px solid var(--text-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
table.markdown th,
|
table.simple th,
|
||||||
table.markdown td {
|
table.simple td {
|
||||||
padding: 8px;
|
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);
|
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);
|
background-color: var(--background-0);
|
||||||
color: var(--text-0);
|
color: var(--text-0);
|
||||||
}
|
}
|
||||||
table.markdown tbody tr:nth-child(even) {
|
table.simple tbody tr:nth-child(even) {
|
||||||
background-color: var(--background-1);
|
background-color: var(--background-1);
|
||||||
color: var(--text-1);
|
color: var(--text-1);
|
||||||
}
|
}
|
||||||
@ -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 content {{{ */
|
||||||
#skip-to-main {
|
#skip-to-main {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -969,6 +952,7 @@ aside.quote {
|
|||||||
.main-container {
|
.main-container {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
@ -988,10 +972,6 @@ aside.quote {
|
|||||||
.table-of-contents.print {
|
.table-of-contents.print {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#back-to-top {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
@ -5,16 +5,17 @@
|
|||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Background */ .bg { background-color: #f8f8f8 }
|
/* Background */ .bg { background-color: #f8f8f8; }
|
||||||
/* PreWrapper */ .chroma { background-color: #f8f8f8; }
|
/* PreWrapper */ .chroma { background-color: #f8f8f8; }
|
||||||
/* Other */ .chroma .x { color: #000000 }
|
/* Other */ .chroma .x { color: #000000 }
|
||||||
/* Error */ .chroma .err { color: #a40000 }
|
/* Error */ .chroma .err { color: #a40000 }
|
||||||
/* CodeLine */ .chroma .cl { }
|
/* 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; }
|
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||||
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||||
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
|
/* LineHighlight */ .chroma .hl { background-color: #dfdfdf }
|
||||||
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
/* 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; 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; }
|
/* Line */ .chroma .line { display: flex; }
|
||||||
/* Keyword */ .chroma .k { color: #204a87; font-weight: bold }
|
/* Keyword */ .chroma .k { color: #204a87; font-weight: bold }
|
||||||
/* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold }
|
/* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold }
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
/* native style */
|
/* native style */
|
||||||
|
|
||||||
/* Background */ .bg { color: #d0d0d0; background-color: #202020 }
|
/* Background */ .bg { color: #d0d0d0; background-color: #202020; }
|
||||||
/* PreWrapper */ .chroma { color: #d0d0d0; background-color: #202020; }
|
/* PreWrapper */ .chroma { color: #d0d0d0; background-color: #202020; }
|
||||||
/* Other */ .chroma .x { }
|
/* Other */ .chroma .x { }
|
||||||
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }
|
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }
|
||||||
/* CodeLine */ .chroma .cl { }
|
/* 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; }
|
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||||
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||||
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
|
/* LineHighlight */ .chroma .hl { background-color: #363636 }
|
||||||
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 }
|
/* 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; 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; }
|
/* Line */ .chroma .line { display: flex; }
|
||||||
/* Keyword */ .chroma .k { color: #6ab825; font-weight: bold }
|
/* Keyword */ .chroma .k { color: #6ab825; font-weight: bold }
|
||||||
/* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold }
|
/* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold }
|
||||||
|
@ -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
|
// code block copy to clipboard
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
document.querySelectorAll(".code-block").forEach(codeBlock => {
|
document.querySelectorAll(".code-block").forEach(codeBlock => {
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
baseURL: https://example.com
|
|
||||||
theme: bobatheme
|
|
||||||
defaultContentLanguage: en
|
|
||||||
copyright: '© 2021 bbaovanc <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>'
|
|
||||||
sectionPagesMenu: main
|
|
||||||
enableRobotsTXT: true
|
|
||||||
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
|
|
||||||
|
|
||||||
# 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
|
|
@ -2,6 +2,12 @@ markup:
|
|||||||
highlight:
|
highlight:
|
||||||
noClasses: false
|
noClasses: false
|
||||||
lineNos: true
|
lineNos: true
|
||||||
|
goldmark:
|
||||||
|
parser:
|
||||||
|
attribute:
|
||||||
|
block: true
|
||||||
|
# this is enabled by default already
|
||||||
|
#title: true
|
||||||
|
|
||||||
params:
|
params:
|
||||||
readingtime: true
|
readingtime: true
|
||||||
@ -12,11 +18,20 @@ taxonomies:
|
|||||||
author: authors
|
author: authors
|
||||||
series: series
|
series: series
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
page:
|
||||||
|
- html
|
||||||
|
- markdown
|
||||||
|
|
||||||
|
outputFormats:
|
||||||
|
markdown:
|
||||||
|
ugly: true
|
||||||
|
|
||||||
privacy:
|
privacy:
|
||||||
googleAnalytics:
|
googleAnalytics:
|
||||||
disable: true
|
disable: true
|
||||||
|
|
||||||
twitter:
|
x:
|
||||||
enableDNT: true
|
enableDNT: true
|
||||||
|
|
||||||
vimeo:
|
vimeo:
|
@ -30,6 +30,9 @@ readingtime:
|
|||||||
edit_history:
|
edit_history:
|
||||||
other: "Edit history"
|
other: "Edit history"
|
||||||
|
|
||||||
|
view_markdown:
|
||||||
|
other: "View raw"
|
||||||
|
|
||||||
|
|
||||||
# Post count
|
# Post count
|
||||||
no_posts:
|
no_posts:
|
||||||
@ -67,6 +70,9 @@ aria_rss_link:
|
|||||||
aria_post_meta_edit_history:
|
aria_post_meta_edit_history:
|
||||||
other: "link to page 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:
|
aria_post_meta_categories:
|
||||||
other: "categories"
|
other: "categories"
|
||||||
|
|
||||||
|
@ -4,20 +4,8 @@
|
|||||||
{{ 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">
|
||||||
@ -39,7 +27,7 @@
|
|||||||
{{ if or .Site.Copyright .Site.Params.footer }}
|
{{ if or .Site.Copyright .Site.Params.footer }}
|
||||||
<footer>
|
<footer>
|
||||||
{{ with .Site.Copyright }}
|
{{ with .Site.Copyright }}
|
||||||
<p>{{ . | safeHTML }}</p>
|
{{ . | safeHTML }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Site.Params.footer }}
|
{{ with .Site.Params.footer }}
|
||||||
|
9
layouts/_default/single.markdown.md
Normal file
9
layouts/_default/single.markdown.md
Normal 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 -}}
|
154
layouts/partials/_internal/pagination.html
Normal file
154
layouts/partials/_internal/pagination.html
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
{{- $validFormats := slice "default" "terse" }}
|
||||||
|
|
||||||
|
{{- $msg1 := "When passing a map to the internal pagination template, one of the elements must be named 'page', and it must be set to the context of the current page." }}
|
||||||
|
{{- $msg2 := "The 'format' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }}
|
||||||
|
|
||||||
|
{{- $page := . }}
|
||||||
|
{{- $format := "default" }}
|
||||||
|
|
||||||
|
{{- if reflect.IsMap . }}
|
||||||
|
{{- with .page }}
|
||||||
|
{{- $page = . }}
|
||||||
|
{{- else }}
|
||||||
|
{{- errorf $msg1 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .format }}
|
||||||
|
{{- $format = lower . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if in $validFormats $format }}
|
||||||
|
{{- if gt $page.Paginator.TotalPages 1 }}
|
||||||
|
<ul class="pagination pagination-{{ $format }}">
|
||||||
|
{{- partial (printf "inline/pagination/%s.html" $format) $page }}
|
||||||
|
</ul>
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- errorf $msg2 (delimit $validFormats ", ") }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Format: default
|
||||||
|
{{/* --------------------------------------------------------------------- */}}
|
||||||
|
{{- define "_partials/inline/pagination/default.html" }}
|
||||||
|
{{- with .Paginator }}
|
||||||
|
{{- $currentPageNumber := .PageNumber }}
|
||||||
|
|
||||||
|
{{- with .First }}
|
||||||
|
{{- if ne $currentPageNumber .PageNumber }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">««</span></a>
|
||||||
|
</li>
|
||||||
|
{{- else }}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<a aria-disabled="true" aria-label="First" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">««</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Prev }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">«</span></a>
|
||||||
|
</li>
|
||||||
|
{{- else }}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<a aria-disabled="true" aria-label="Previous" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">«</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $slots := 5 }}
|
||||||
|
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
|
||||||
|
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
|
||||||
|
{{- if lt (add (sub $end $start) 1) $slots }}
|
||||||
|
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- range $k := seq $start $end }}
|
||||||
|
{{- if eq $.Paginator.PageNumber $k }}
|
||||||
|
<li class="page-item active">
|
||||||
|
<a aria-current="page" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||||
|
</li>
|
||||||
|
{{- else }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Next }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- else }}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<a aria-disabled="true" aria-label="Next" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Last }}
|
||||||
|
{{- if ne $currentPageNumber .PageNumber }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">»»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- else }}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<a aria-disabled="true" aria-label="Last" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Format: terse
|
||||||
|
{{/* --------------------------------------------------------------------- */}}
|
||||||
|
{{- define "_partials/inline/pagination/terse.html" }}
|
||||||
|
{{- with .Paginator }}
|
||||||
|
{{- $currentPageNumber := .PageNumber }}
|
||||||
|
|
||||||
|
{{- with .First }}
|
||||||
|
{{- if ne $currentPageNumber .PageNumber }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">««</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Prev }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">«</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $slots := 3 }}
|
||||||
|
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
|
||||||
|
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
|
||||||
|
{{- if lt (add (sub $end $start) 1) $slots }}
|
||||||
|
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- range $k := seq $start $end }}
|
||||||
|
{{- if eq $.Paginator.PageNumber $k }}
|
||||||
|
<li class="page-item active">
|
||||||
|
<a aria-current="page" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||||
|
</li>
|
||||||
|
{{- else }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Next }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Last }}
|
||||||
|
{{- if ne $currentPageNumber .PageNumber }}
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">»»</span></a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
@ -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 }}" />
|
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
|
||||||
{{ 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 }}">
|
||||||
|
@ -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">
|
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
|
||||||
{{ 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">
|
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
|
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
{{ $authors := slice }}
|
{{ $authors := slice }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
{{ $url := (printf "authors/%s" (. | anchorize)) | absLangURL }}
|
{{ $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 }}
|
{{ end }}
|
||||||
{{ delimit $authors ", " }}
|
{{ delimit $authors ", " | safeHTML }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ delimit . ", " }}
|
{{ delimit . ", " }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
<div class="page-metadata-section 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" }}
|
{{ partial "icon.html" "folder" }}
|
||||||
{{ delimit $categories ", " }}
|
{{ delimit $categories ", " | safeHTML }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
<div class="page-metadata-section 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" }}
|
{{ partial "icon.html" "files" }}
|
||||||
{{ delimit $series ", " }}
|
{{ delimit $series ", " | safeHTML }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
<div class="page-metadata-section 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" }}
|
{{ partial "icon.html" "tag" }}
|
||||||
{{ delimit $tags ", " }}
|
{{ delimit $tags ", " | safeHTML }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
8
layouts/partials/page-metadata/item/viewraw.html
Normal file
8
layouts/partials/page-metadata/item/viewraw.html
Normal 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 }}
|
@ -20,7 +20,10 @@
|
|||||||
{{ partial "page-metadata/item/authors.html" . }}
|
{{ partial "page-metadata/item/authors.html" . }}
|
||||||
{{ partial "page-metadata/item/readingtime.html" . }}
|
{{ partial "page-metadata/item/readingtime.html" . }}
|
||||||
{{ partial "page-metadata/item/edithistory.html" . }}
|
{{ partial "page-metadata/item/edithistory.html" . }}
|
||||||
|
{{ partial "page-metadata/item/viewraw.html" . }}
|
||||||
|
|
||||||
{{ partial "page-metadata/item/categories.html" . }}
|
{{ partial "page-metadata/item/categories.html" . }}
|
||||||
|
|
||||||
{{ partial "page-metadata/item/tags.html" . }}
|
{{ partial "page-metadata/item/tags.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{{ if gt .Paginator.TotalPages 1 }}
|
{{ if gt .Paginator.TotalPages 1 }}
|
||||||
<nav class="pagination">
|
<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>
|
</nav>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if eq $type "image" }}
|
{{ if eq $type "image" }}
|
||||||
<img src="{{ $src }}" alt="{{ $alt }}" />
|
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
|
||||||
{{ 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 }}">
|
||||||
|
@ -21,10 +21,14 @@
|
|||||||
<meta itemprop="image" content="{{ $featured.Permalink }}">
|
<meta itemprop="image" content="{{ $featured.Permalink }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with (.GetTerms "tags") }}
|
{{ with .Keywords }}
|
||||||
{{ $tags := slice }}
|
<meta itemprop="keywords" content="{{ delimit . ", " }}">
|
||||||
{{ range . }}
|
{{ else }}
|
||||||
{{ $tags = $tags | append .LinkTitle }}
|
{{ with (.GetTerms "tags") }}
|
||||||
|
{{ $tags := slice }}
|
||||||
|
{{ range . }}
|
||||||
|
{{ $tags = $tags | append .LinkTitle }}
|
||||||
|
{{ end }}
|
||||||
|
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -24,6 +24,6 @@
|
|||||||
<meta name="twitter:title" content="{{ .Title | plainify }}">
|
<meta name="twitter:title" content="{{ .Title | plainify }}">
|
||||||
<meta name="twitter:description" content="{{ (partial "seo-description.html" .) | 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="@{{ . }}">
|
<meta name="twitter:site" content="@{{ . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -12,6 +12,6 @@
|
|||||||
This post is part of a series:
|
This post is part of a series:
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ delimit $series ", " }}
|
{{ delimit $series ", " | safeHTML }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -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 }}
|
|
Reference in New Issue
Block a user