mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-13 09:57:30 -05:00
Compare commits
1 Commits
hugo-0.146
...
reduce-pri
Author | SHA1 | Date | |
---|---|---|---|
98d03cd803
|
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,4 +1,4 @@
|
||||
[submodule "assets/jam"]
|
||||
path = assets/jam
|
||||
url = https://github.com/BBaoVanC/jam.git
|
||||
url = https://github.com/michaelampr/jam.git
|
||||
branch = master
|
||||
|
@ -248,31 +248,31 @@ hr {
|
||||
}
|
||||
}
|
||||
|
||||
table.simple {
|
||||
table.markdown {
|
||||
border-collapse: collapse;
|
||||
border: 2px solid var(--text-1);
|
||||
}
|
||||
|
||||
table.simple thead {
|
||||
table.markdown thead {
|
||||
background-color: var(--background-2);
|
||||
color: var(--text-2);
|
||||
border-bottom: 2px solid var(--text-1);
|
||||
}
|
||||
|
||||
table.simple th,
|
||||
table.simple td {
|
||||
table.markdown th,
|
||||
table.markdown td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.simple :is(th, td) + :is(th, td) {
|
||||
table.markdown :is(th, td) + :is(th, td) {
|
||||
border-left: 2px solid var(--text-1);
|
||||
}
|
||||
|
||||
table.simple tbody tr:nth-child(odd) {
|
||||
table.markdown tbody tr:nth-child(odd) {
|
||||
background-color: var(--background-0);
|
||||
color: var(--text-0);
|
||||
}
|
||||
table.simple tbody tr:nth-child(even) {
|
||||
table.markdown tbody tr:nth-child(even) {
|
||||
background-color: var(--background-1);
|
||||
color: var(--text-1);
|
||||
}
|
||||
@ -858,22 +858,22 @@ aside {
|
||||
}
|
||||
|
||||
aside.note {
|
||||
background-color: var(--background-blue-1);
|
||||
background-color: var(--accent-blue-1);
|
||||
}
|
||||
aside.info {
|
||||
background-color: var(--background-green-1);
|
||||
background-color: var(--accent-green-1);
|
||||
}
|
||||
aside.tip {
|
||||
background-color: var(--background-teal-1);
|
||||
background-color: var(--accent-teal-1);
|
||||
}
|
||||
aside.warning {
|
||||
background-color: var(--background-yellow-1);
|
||||
background-color: var(--accent-yellow-1);
|
||||
}
|
||||
aside.example {
|
||||
background-color: var(--background-purple-1);
|
||||
background-color: var(--accent-purple-1);
|
||||
}
|
||||
aside.quote {
|
||||
background-color: var(--background-1);
|
||||
background-color: var(--accent-1);
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
@ -972,6 +972,34 @@ aside.quote {
|
||||
.table-of-contents.print {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* reduce usage of background colors
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
@ -5,17 +5,16 @@
|
||||
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: #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 }
|
||||
/* 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 }
|
||||
/* Line */ .chroma .line { display: flex; }
|
||||
/* Keyword */ .chroma .k { color: #204a87; font-weight: bold }
|
||||
/* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold }
|
||||
|
@ -1,16 +1,15 @@
|
||||
/* 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: #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 }
|
||||
/* 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 }
|
||||
/* Line */ .chroma .line { display: flex; }
|
||||
/* Keyword */ .chroma .k { color: #6ab825; font-weight: bold }
|
||||
/* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold }
|
||||
|
@ -4,23 +4,15 @@ 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
|
||||
|
||||
pagination:
|
||||
pagerSize: 5
|
||||
|
||||
taxonomies:
|
||||
_merge: deep
|
||||
|
||||
markup: # this just keeps the bobatheme markup styling
|
||||
_merge: deep
|
||||
|
||||
outputs:
|
||||
_merge: deep
|
||||
|
||||
outputFormats:
|
||||
_merge: deep
|
||||
|
||||
params:
|
||||
author:
|
||||
name: bbaovanc
|
||||
|
17
hugo.yaml
17
hugo.yaml
@ -2,12 +2,6 @@ markup:
|
||||
highlight:
|
||||
noClasses: false
|
||||
lineNos: true
|
||||
goldmark:
|
||||
parser:
|
||||
attribute:
|
||||
block: true
|
||||
# this is enabled by default already
|
||||
#title: true
|
||||
|
||||
params:
|
||||
readingtime: true
|
||||
@ -18,20 +12,11 @@ taxonomies:
|
||||
author: authors
|
||||
series: series
|
||||
|
||||
outputs:
|
||||
page:
|
||||
- html
|
||||
- markdown
|
||||
|
||||
outputFormats:
|
||||
markdown:
|
||||
ugly: true
|
||||
|
||||
privacy:
|
||||
googleAnalytics:
|
||||
disable: true
|
||||
|
||||
x:
|
||||
twitter:
|
||||
enableDNT: true
|
||||
|
||||
vimeo:
|
||||
|
@ -30,9 +30,6 @@ readingtime:
|
||||
edit_history:
|
||||
other: "Edit history"
|
||||
|
||||
view_markdown:
|
||||
other: "View raw"
|
||||
|
||||
|
||||
# Post count
|
||||
no_posts:
|
||||
@ -70,9 +67,6 @@ 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"
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
{{ if or .Site.Copyright .Site.Params.footer }}
|
||||
<footer>
|
||||
{{ with .Site.Copyright }}
|
||||
{{ . | safeHTML }}
|
||||
<p>{{ . | safeHTML }}</p>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.footer }}
|
||||
|
@ -1,9 +0,0 @@
|
||||
{{ with .File -}}
|
||||
{{ with (.Path | readFile) -}}
|
||||
{{ . -}}
|
||||
{{ else -}}
|
||||
{{ errorf "file not found: %s" .Path -}}
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ errorf "no file available for markdown template?" -}}
|
||||
{{ end -}}
|
@ -1,154 +0,0 @@
|
||||
{{- $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 -}}
|
@ -1,8 +0,0 @@
|
||||
{{ 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,10 +20,7 @@
|
||||
{{ partial "page-metadata/item/authors.html" . }}
|
||||
{{ partial "page-metadata/item/readingtime.html" . }}
|
||||
{{ partial "page-metadata/item/edithistory.html" . }}
|
||||
{{ partial "page-metadata/item/viewraw.html" . }}
|
||||
|
||||
{{ partial "page-metadata/item/categories.html" . }}
|
||||
|
||||
{{ partial "page-metadata/item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -1,6 +1,5 @@
|
||||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<nav class="pagination">
|
||||
{{/* https://github.com/gohugoio/hugo/blob/a88b488181279befd50e1d127f9f67604f2f9854/tpl/tplimpl/embedded/templates/_partials/pagination.html */}}
|
||||
{{ partial "_internal/pagination.html" . }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
@ -21,14 +21,10 @@
|
||||
<meta itemprop="image" content="{{ $featured.Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
{{ 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 ", " }}">
|
||||
{{ with (.GetTerms "tags") }}
|
||||
{{ $tags := slice }}
|
||||
{{ range . }}
|
||||
{{ $tags = $tags | append .LinkTitle }}
|
||||
{{ end }}
|
||||
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
|
||||
{{ end }}
|
||||
|
@ -24,6 +24,6 @@
|
||||
<meta name="twitter:title" content="{{ .Title | plainify }}">
|
||||
<meta name="twitter:description" content="{{ (partial "seo-description.html" .) | plainify }}">
|
||||
|
||||
{{ with .Site.Params.social.twitter }}
|
||||
{{ with .Site.Social.twitter }}
|
||||
<meta name="twitter:site" content="@{{ . }}">
|
||||
{{ end }}
|
||||
|
10
layouts/shortcodes/table.html
Normal file
10
layouts/shortcodes/table.html
Normal file
@ -0,0 +1,10 @@
|
||||
{{/* 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