mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-05 03:27:33 -05:00
Compare commits
24 Commits
v1.0.1
...
e97d4f921d
Author | SHA1 | Date | |
---|---|---|---|
e97d4f921d
|
|||
5ffca36b84
|
|||
f4c056b99c
|
|||
3713fdae5b
|
|||
1127795717
|
|||
1db48c3101
|
|||
430139d292
|
|||
ac9ca6f97e
|
|||
8cadf8e735
|
|||
42a7e27d09
|
|||
2371f1de13
|
|||
81e141cef9
|
|||
2113c7a4e9
|
|||
b14e0e90fd
|
|||
2742bac9ff
|
|||
e8f9d1c5df
|
|||
dff23045a8
|
|||
4f450374cf
|
|||
a3a7f50a5b
|
|||
2cc4f45d4f
|
|||
33d0f81444
|
|||
5668feed1d
|
|||
586bea37d5
|
|||
37c04460b5
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
title: {{ replace .Name "-" " " | humanize }}
|
title: {{ replace .Name "-" " " | humanize }}
|
||||||
date: {{ .Date }}
|
date: {{ .Date }}
|
||||||
|
lastmod: {{ .Date }}
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
draft: true
|
draft: true
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
--background-3: #282828;
|
--background-3: #282828;
|
||||||
--background-4: #333;
|
--background-4: #333;
|
||||||
--background-5: #444;
|
--background-5: #444;
|
||||||
|
--background-accent: #111d2f;
|
||||||
--text-normal: #d3d3d3;
|
--text-normal: #d3d3d3;
|
||||||
--link-color: #4da6ff;
|
--link-color: #4da6ff;
|
||||||
--figure-border: #1b5b9b;
|
--figure-border: #1b5b9b;
|
||||||
@ -24,6 +25,7 @@
|
|||||||
--background-3: #d8d8d8;
|
--background-3: #d8d8d8;
|
||||||
--background-4: #bbb;
|
--background-4: #bbb;
|
||||||
--background-5: #aaa;
|
--background-5: #aaa;
|
||||||
|
--background-accent: #aec9ee;
|
||||||
--text-normal: #000;
|
--text-normal: #000;
|
||||||
--link-color: #0057bf;
|
--link-color: #0057bf;
|
||||||
--figure-border: #2e7bc9;
|
--figure-border: #2e7bc9;
|
||||||
@ -52,6 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Post layout (in list pages) */
|
/* Post layout (in list pages) */
|
||||||
.list-page-content {
|
.list-page-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -68,8 +71,13 @@
|
|||||||
gap: 40px;
|
gap: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.series-taxonomy ul {
|
||||||
|
gap: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
.page-list li,
|
.page-list li,
|
||||||
.series-taxonomy li {
|
.series-taxonomy li,
|
||||||
|
.related-posts .post {
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
padding-right: 24px;
|
padding-right: 24px;
|
||||||
@ -84,21 +92,25 @@
|
|||||||
opacity: .75;
|
opacity: .75;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-title {
|
.post-title,
|
||||||
|
.author-name {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-title a {
|
.post-title a,
|
||||||
|
.author-name a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: inherit;
|
text-decoration: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-meta-item {
|
.post-meta-item,
|
||||||
|
.author-meta-item {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-metadata {
|
.post-metadata,
|
||||||
|
.author-metadata {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +123,8 @@
|
|||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-description {
|
.post-description,
|
||||||
|
.author-description {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +162,6 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
flex-flow: row wrap;
|
flex-flow: row wrap;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
@ -202,10 +214,6 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Header formatting (website title and article section headers) */
|
/* Header formatting (website title and article section headers) */
|
||||||
.top {
|
|
||||||
margin: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header a,
|
.header a,
|
||||||
.section-header a {
|
.section-header a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@ -242,15 +250,31 @@
|
|||||||
padding: 8px 15px;
|
padding: 8px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content,
|
|
||||||
footer {
|
/* Related posts */
|
||||||
margin: 20px;
|
.related hr {
|
||||||
|
margin: 25px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
@media (min-width: 720px) {
|
||||||
text-align: center;
|
.related {
|
||||||
|
/* this makes it full width -- 720px max-width on body
|
||||||
|
* add an extra 40px to give a 20px margin on left and right */
|
||||||
|
margin-left: calc(-100vw / 2 + 760px / 2);
|
||||||
|
margin-right: calc(-100vw / 2 + 760px / 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.related-posts {
|
||||||
|
display: grid;
|
||||||
|
gap: 20px;
|
||||||
|
grid-auto-flow: column;
|
||||||
|
grid-auto-columns: 300px;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Back to top */
|
||||||
#back-to-top {
|
#back-to-top {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
float: right;
|
float: right;
|
||||||
@ -278,9 +302,6 @@ footer {
|
|||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
|
||||||
|
|
||||||
.navbar {
|
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
@ -338,6 +359,7 @@ footer {
|
|||||||
/* Basic elements */
|
/* Basic elements */
|
||||||
html {
|
html {
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
|
margin: 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (prefers-reduced-motion: reduce) {
|
@media screen and (prefers-reduced-motion: reduce) {
|
||||||
@ -350,11 +372,19 @@ body {
|
|||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
color: var(--text-normal);
|
color: var(--text-normal);
|
||||||
font-family: "Open Sans", "Noto Sans", sans-serif;
|
font-family: "Open Sans", "Noto Sans", sans-serif;
|
||||||
margin: auto;
|
margin: 0 auto 20px;
|
||||||
max-width: 720px;
|
max-width: 720px;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
img,
|
img,
|
||||||
video {
|
video {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@ -408,6 +438,27 @@ hr {
|
|||||||
border-color: var(--background-5);
|
border-color: var(--background-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.markdown {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border: 2px solid var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown thead {
|
||||||
|
background-color: var(--background-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown th,
|
||||||
|
.markdown td {
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown tbody tr:nth-child(odd) {
|
||||||
|
background-color: var(--background);
|
||||||
|
}
|
||||||
|
.markdown tbody tr:nth-child(even) {
|
||||||
|
background-color: var(--background-2);
|
||||||
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
@ -504,9 +555,7 @@ li.disabled > .page-link:hover {
|
|||||||
|
|
||||||
/* Breadcrumb navigation */
|
/* Breadcrumb navigation */
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-top: 40px;
|
margin: 30px 0 20px;
|
||||||
margin-bottom: 20px;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb ul {
|
.breadcrumb ul {
|
||||||
@ -572,7 +621,8 @@ li.disabled > .page-link:hover {
|
|||||||
|
|
||||||
|
|
||||||
/* Light mode */
|
/* Light mode */
|
||||||
@media print, (prefers-color-scheme: light) {
|
@media print,
|
||||||
|
(prefers-color-scheme: light) {
|
||||||
/* Basic elements */
|
/* Basic elements */
|
||||||
.section:hover {
|
.section:hover {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
@ -35,8 +35,8 @@ post_count:
|
|||||||
read_more:
|
read_more:
|
||||||
other: "Read more"
|
other: "Read more"
|
||||||
|
|
||||||
see_also:
|
related_posts:
|
||||||
other: "See also"
|
other: "Related posts"
|
||||||
|
|
||||||
older_post:
|
older_post:
|
||||||
other: "Older"
|
other: "Older"
|
||||||
|
@ -35,8 +35,8 @@ no_posts:
|
|||||||
read_more:
|
read_more:
|
||||||
other: "Leer más"
|
other: "Leer más"
|
||||||
|
|
||||||
see_also:
|
related_posts:
|
||||||
other: "Véase también"
|
other: "Publicaciones similares"
|
||||||
|
|
||||||
older_post:
|
older_post:
|
||||||
other: "Más antiguo"
|
other: "Más antiguo"
|
||||||
|
@ -14,17 +14,23 @@
|
|||||||
{{ partial "breadcrumb.html" . }}
|
{{ partial "breadcrumb.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="content">
|
<main>
|
||||||
{{ block "main" . }}
|
{{ block "main" . }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</main>
|
||||||
|
|
||||||
{{ with .Site.Copyright }}
|
{{ if or .Site.Copyright .Site.Params.footer }}
|
||||||
|
<hr>
|
||||||
<footer>
|
<footer>
|
||||||
<hr>
|
|
||||||
<small>
|
<small>
|
||||||
{{ . | safeHTML }}
|
{{ with .Site.Copyright }}
|
||||||
|
<p>{{ . | safeHTML }}</p>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ with .Site.Params.footer }}
|
||||||
|
{{ . | $.RenderString (dict "display" "block") }}
|
||||||
|
{{ end }}
|
||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -7,25 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ partial "post-metadata/full.html" . }}
|
{{ partial "post-metadata/full.html" . }}
|
||||||
|
{{ partial "series-box.html" . }}
|
||||||
{{ with (.GetTerms "series") }}
|
|
||||||
{{ $series := slice }}
|
|
||||||
{{ range . }}
|
|
||||||
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<div class="series-box">
|
|
||||||
{{ partial "icon.html" "info" }}
|
|
||||||
{{ if gt (len $series) 1 }}
|
|
||||||
This post is part of multiple series:
|
|
||||||
{{ else }}
|
|
||||||
This post is part of a series:
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ delimit $series ", " }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
|
|
||||||
{{ if .Params.Toc }}
|
{{ if .Params.Toc }}
|
||||||
<div class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
|
<div class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
|
||||||
@ -46,23 +28,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ .Content }}
|
<div class="post-content">
|
||||||
|
{{ .Content }}
|
||||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
</div>
|
||||||
{{ with $related }}
|
|
||||||
<div class="see-also">
|
|
||||||
<h2>{{ i18n "see_also" }}</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{{ range . }}
|
|
||||||
<li>
|
|
||||||
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
|
|
||||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ if or .NextInSection .PrevInSection }}
|
{{ if or .NextInSection .PrevInSection }}
|
||||||
<div class="prevnext">
|
<div class="prevnext">
|
||||||
@ -94,6 +62,22 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "series-box.html" . }}
|
||||||
|
|
||||||
|
{{ $related := .Site.RegularPages.Related . | first 10 }}
|
||||||
|
{{ with $related }}
|
||||||
|
<div class="related">
|
||||||
|
<hr>
|
||||||
|
<h2>{{ i18n "related_posts" }}</h2>
|
||||||
|
<div class="related-posts">
|
||||||
|
{{ range . }}
|
||||||
|
{{ .Render "summary/post" }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Params.comments }}
|
{{ if .Params.comments }}
|
||||||
<div class="comments">
|
<div class="comments">
|
||||||
{{ partial "comments.html" . }}
|
{{ partial "comments.html" . }}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<div class="post">
|
<div class="author">
|
||||||
<h2 class="post-title">
|
<h2 class="author-name">
|
||||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||||
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
|
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{{ partial "post-metadata/author.html" . }}
|
{{ partial "post-metadata/author.html" . }}
|
||||||
|
|
||||||
<div class="post-description">
|
<div class="author-description">
|
||||||
{{ partial "description-or-summary.html" . }}
|
{{ partial "description-or-summary.html" . }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
4
layouts/partials/additional-head.html
Normal file
4
layouts/partials/additional-head.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{{/*
|
||||||
|
Create a file named `layouts/partials/additional-head.html` at your site root to
|
||||||
|
add extra tags into <head>. Page variables are passed.
|
||||||
|
*/}}
|
@ -11,7 +11,7 @@
|
|||||||
{{ if eq .MediaType.MainType "image" }}
|
{{ if eq .MediaType.MainType "image" }}
|
||||||
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
|
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
|
||||||
{{ else if eq .MediaType.MainType "video" }}
|
{{ else if eq .MediaType.MainType "video" }}
|
||||||
<video controls>
|
<video controls preload="metadata">
|
||||||
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
||||||
{{ i18n "browser_no_video_support" }}
|
{{ i18n "browser_no_video_support" }}
|
||||||
</video>
|
</video>
|
||||||
|
@ -37,4 +37,6 @@
|
|||||||
|
|
||||||
<meta name="language" content="{{ .Language.Lang }}">
|
<meta name="language" content="{{ .Language.Lang }}">
|
||||||
<meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
|
<meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
|
||||||
|
|
||||||
|
{{ partial "additional-head.html" . }}
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
<div class="post-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
|
<div class="author-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
|
||||||
{{/* Calculate the total word count */}}
|
{{/* Calculate the total word count */}}
|
||||||
{{ $total_words := 0 }}
|
{{ $total_words := 0 }}
|
||||||
{{ range .Data.Pages }}
|
{{ range .Data.Pages }}
|
||||||
{{ $total_words = add $total_words .WordCount }}
|
{{ $total_words = add $total_words .WordCount }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<span class="post-meta-item" aria-label="{{ i18n "aria_author_post_count" }}">
|
<span class="author-meta-item" aria-label="{{ i18n "aria_author_post_count" }}">
|
||||||
{{ partial "icon.html" "newspaper" }}
|
{{ partial "icon.html" "newspaper" }}
|
||||||
{{ i18n "post_count" (len .Data.Pages) }}
|
{{ i18n "post_count" (len .Data.Pages) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="post-meta-item" aria-label="{{ i18n "aria_author_word_count" }}">
|
<span class="author-meta-item" aria-label="{{ i18n "aria_author_word_count" }}">
|
||||||
{{ partial "icon.html" "align-left" }}
|
{{ partial "icon.html" "align-left" }}
|
||||||
{{ i18n "wordcount" $total_words }}
|
{{ i18n "wordcount" $total_words }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
{{ if eq $type "image" }}
|
{{ if eq $type "image" }}
|
||||||
<img src="{{ $src }}" alt="{{ $alt }}" />
|
<img src="{{ $src }}" alt="{{ $alt }}" />
|
||||||
{{ else if eq $type "video" }}
|
{{ else if eq $type "video" }}
|
||||||
<video controls>
|
<video controls preload="metadata">
|
||||||
<source src="{{ $src }}" alt="{{ $alt }}">
|
<source src="{{ $src }}" alt="{{ $alt }}">
|
||||||
{{ i18n "browser_no_video_support" }}
|
{{ i18n "browser_no_video_support" }}
|
||||||
</video>
|
</video>
|
||||||
|
17
layouts/partials/series-box.html
Normal file
17
layouts/partials/series-box.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{ with (.GetTerms "series") }}
|
||||||
|
{{ $series := slice }}
|
||||||
|
{{ range . }}
|
||||||
|
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<div class="series-box">
|
||||||
|
{{ partial "icon.html" "info" }}
|
||||||
|
{{ if gt (len $series) 1 }}
|
||||||
|
This post is part of multiple series:
|
||||||
|
{{ else }}
|
||||||
|
This post is part of a series:
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ delimit $series ", " }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
1
layouts/shortcodes/abbr.html
Normal file
1
layouts/shortcodes/abbr.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>
|
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 | markdownify }}
|
||||||
|
{{ $new := printf `<table class="%s">` $class }}
|
||||||
|
{{ (replace $htmlTable "<table>" $new) | safeHTML }}
|
Reference in New Issue
Block a user