mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-12 17:57:28 -05:00
Compare commits
50 Commits
v1.0.1
...
684769df5a
Author | SHA1 | Date | |
---|---|---|---|
684769df5a
|
|||
9bee463a3c
|
|||
805dc65ccb
|
|||
a9d1c25ee4
|
|||
fe08bdc93c
|
|||
026d5ab2c3
|
|||
311d846cb8
|
|||
0888356292
|
|||
bcf0b68df9
|
|||
034ef462a2
|
|||
56610009e9
|
|||
76b0383c2c
|
|||
0877a9d400
|
|||
2731d9795f
|
|||
87a6da5c41
|
|||
e450f3fbc7
|
|||
cba6dd0a2f
|
|||
fa5c014a1b
|
|||
a172b1ea21
|
|||
93d9164c6a
|
|||
72ebcf134a
|
|||
effd3a265b
|
|||
d41f3facd7
|
|||
c82d5602bb
|
|||
219f97bc00
|
|||
2f6d67a03f
|
|||
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 }}
|
||||
date: {{ .Date }}
|
||||
lastmod: {{ .Date }}
|
||||
toc: true
|
||||
comments: true
|
||||
draft: true
|
||||
@ -9,11 +10,14 @@ draft: true
|
||||
authors:
|
||||
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
|
||||
|
||||
categories:
|
||||
- archetype-stuff
|
||||
|
||||
tags:
|
||||
- awesome
|
||||
|
||||
series:
|
||||
- Archetype
|
||||
- archetype
|
||||
|
||||
# this will be shown for the article in list pages and in the page metadata
|
||||
# it can be either an image or video (this might change in the future, however)
|
||||
|
15
archetypes/categories/_index.md
Normal file
15
archetypes/categories/_index.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
title: {{ replace .Name "-" " " | title }}
|
||||
|
||||
---
|
||||
|
||||
A short summary of what the category is about.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Optionally provide more information about the category here. This part will only
|
||||
show on the category page, not on the category list page.
|
||||
|
||||
If you delete this section, DO NOT delete the summary separator (`<!--more-->`)
|
||||
or else the summary won't be shown.
|
@ -8,6 +8,7 @@
|
||||
--background-3: #282828;
|
||||
--background-4: #333;
|
||||
--background-5: #444;
|
||||
--background-accent: #111d2f;
|
||||
--text-normal: #d3d3d3;
|
||||
--link-color: #4da6ff;
|
||||
--figure-border: #1b5b9b;
|
||||
@ -24,6 +25,7 @@
|
||||
--background-3: #d8d8d8;
|
||||
--background-4: #bbb;
|
||||
--background-5: #aaa;
|
||||
--background-accent: #aec9ee;
|
||||
--text-normal: #000;
|
||||
--link-color: #0057bf;
|
||||
--figure-border: #2e7bc9;
|
||||
@ -52,6 +54,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Post layout (in list pages) */
|
||||
.list-page-content {
|
||||
display: flex;
|
||||
@ -68,6 +71,10 @@
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.series-taxonomy ul {
|
||||
gap: 80px;
|
||||
}
|
||||
|
||||
.page-list li,
|
||||
.series-taxonomy li {
|
||||
padding-top: 8px;
|
||||
@ -84,24 +91,29 @@
|
||||
opacity: .75;
|
||||
}
|
||||
|
||||
.post-title {
|
||||
.post-title,
|
||||
.author-name {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.post-title a {
|
||||
.post-title a,
|
||||
.author-name a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.post-meta-item {
|
||||
.post-meta-item,
|
||||
.author-meta-item {
|
||||
margin-right: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.post-metadata {
|
||||
.post-metadata,
|
||||
.author-metadata {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.categories,
|
||||
.tags,
|
||||
.series {
|
||||
margin-top: 10px;
|
||||
@ -111,7 +123,8 @@
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.post-description {
|
||||
.post-description,
|
||||
.author-description {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@ -121,6 +134,46 @@
|
||||
|
||||
|
||||
|
||||
/* Category list format */
|
||||
.category-list ul {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
list-style: none;
|
||||
gap: 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.category-list li {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 20px;
|
||||
background-color: var(--background-2);
|
||||
padding: 8px 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@media (max-width: 360px) {
|
||||
.category-list li {
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.category-list p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.category-list .category-metadata {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.category-list a,
|
||||
.category-list .category-metadata {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Tags list format */
|
||||
.tag-list ul {
|
||||
display: flex;
|
||||
@ -149,7 +202,6 @@
|
||||
gap: 10px;
|
||||
flex-flow: row wrap;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
background-color: var(--background);
|
||||
padding: 8px;
|
||||
border-radius: 16px;
|
||||
@ -202,10 +254,6 @@
|
||||
|
||||
|
||||
/* Header formatting (website title and article section headers) */
|
||||
.top {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.header a,
|
||||
.section-header a {
|
||||
color: inherit;
|
||||
@ -242,15 +290,106 @@
|
||||
padding: 8px 15px;
|
||||
}
|
||||
|
||||
.content,
|
||||
footer {
|
||||
margin: 20px;
|
||||
|
||||
/* Related posts */
|
||||
.full-width-page-list {
|
||||
/* make left/right 0 margin so it takes up full width */
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
.full-width-page-list > hr,
|
||||
.full-width-page-list > h1 {
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.full-width-page-list li {
|
||||
min-width: 300px;
|
||||
max-width: 300px;
|
||||
|
||||
}
|
||||
|
||||
.full-width-page-list li:first-child {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.full-width-page-list li:last-child {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
/* when the screen is smaller than max size, make sure that the .related div
|
||||
* still reaches the screen edge. then if the posts overflow and require
|
||||
* scrolling, you can see it cut off on the side of your phone screen
|
||||
*/
|
||||
.full-width-page-list {
|
||||
margin-left: -20px;
|
||||
margin-right: -20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 720px) {
|
||||
.full-width-page-list {
|
||||
/* this makes it full width -- 720px max-width on body it is exactly 720px
|
||||
* so .related takes up full width
|
||||
*/
|
||||
margin-left: calc(-100vw / 2 + 720px / 2);
|
||||
margin-right: calc(-100vw / 2 + 720px / 2);
|
||||
}
|
||||
}
|
||||
|
||||
.full-width-page-list .page-list ul {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 20px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
|
||||
/* Social media share buttons */
|
||||
.share-buttons {
|
||||
background: var(--background-2);
|
||||
margin: 25px 0;
|
||||
padding: 8px 0;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.share-buttons a {
|
||||
background-color: var(--background-4);
|
||||
padding: 4px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.share-buttons svg {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
/* https://stackoverflow.com/a/72073682/19003757 */
|
||||
/*
|
||||
.telegram-share > svg {
|
||||
transform: scale(1.5);
|
||||
margin: 9px -9px -9px 9px;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* See also formating */
|
||||
.see-also {
|
||||
background-color: var(--background-2);
|
||||
padding: 8px 12px;
|
||||
border-radius: 8px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.see-also p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
/* Back to top */
|
||||
#back-to-top {
|
||||
position: fixed;
|
||||
float: right;
|
||||
@ -278,9 +417,6 @@ footer {
|
||||
|
||||
.navbar {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
flex-grow: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
@ -288,6 +424,7 @@ footer {
|
||||
.navbar a {
|
||||
padding: 8px 12px;
|
||||
border-radius: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.navbar-item:hover,
|
||||
@ -350,11 +487,25 @@ body {
|
||||
background-color: var(--background);
|
||||
color: var(--text-normal);
|
||||
font-family: "Open Sans", "Noto Sans", sans-serif;
|
||||
margin: auto;
|
||||
margin: 20px;
|
||||
max-width: 720px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
@media (min-width: 760px) {
|
||||
body {
|
||||
margin: 20px auto;
|
||||
}
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
@ -408,6 +559,27 @@ hr {
|
||||
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;
|
||||
}
|
||||
@ -504,9 +676,7 @@ li.disabled > .page-link:hover {
|
||||
|
||||
/* Breadcrumb navigation */
|
||||
.breadcrumb {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 20px;
|
||||
margin-left: 20px;
|
||||
margin: 30px 0 20px;
|
||||
}
|
||||
|
||||
.breadcrumb ul {
|
||||
@ -572,7 +742,8 @@ li.disabled > .page-link:hover {
|
||||
|
||||
|
||||
/* Light mode */
|
||||
@media print, (prefers-color-scheme: light) {
|
||||
@media print,
|
||||
(prefers-color-scheme: light) {
|
||||
/* Basic elements */
|
||||
.section:hover {
|
||||
color: inherit;
|
||||
|
3
assets/js/share-event.js
Normal file
3
assets/js/share-event.js
Normal file
@ -0,0 +1,3 @@
|
||||
function share_event(service) {
|
||||
// this function does nothing by default
|
||||
}
|
@ -4,11 +4,10 @@ markup:
|
||||
lineNos: true
|
||||
|
||||
params:
|
||||
faviconICO: favicon.ico
|
||||
faviconPNG: favicon.png
|
||||
readingtime: true
|
||||
|
||||
taxonomies:
|
||||
category: categories
|
||||
tag: tags
|
||||
author: authors
|
||||
series: series
|
||||
|
@ -20,9 +20,9 @@ params:
|
||||
# these are for the OpenGraph/Twitter embeds in Hugo
|
||||
description: Example website for bobatheme
|
||||
|
||||
# these are for favicons in bobatheme (defaults are shown here)
|
||||
# faviconICO: favicon.ico
|
||||
# faviconPNG: favicon.png
|
||||
# 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
|
||||
@ -31,6 +31,24 @@ params:
|
||||
# gitFileURL: https://github.com/BBaoVanC/bobatheme/blob/master
|
||||
# gitFileIcon: github-circle
|
||||
|
||||
# display a "Latest Posts" section on the homepage below its content
|
||||
homepageLatestPosts: true
|
||||
|
||||
# social media share icons
|
||||
# shareButtons:
|
||||
# twitter: true
|
||||
# facebook: true
|
||||
# linkedin: true
|
||||
# reddit: true
|
||||
# telegram: 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:
|
||||
|
19
i18n/en.yaml
19
i18n/en.yaml
@ -8,6 +8,12 @@ table_of_contents:
|
||||
browser_no_video_support:
|
||||
other: "Your browser does not support video."
|
||||
|
||||
latest_posts:
|
||||
other: "Latest Posts"
|
||||
|
||||
see_also:
|
||||
other: "SEE ALSO:"
|
||||
|
||||
|
||||
# Meta items
|
||||
long_date:
|
||||
@ -35,8 +41,8 @@ post_count:
|
||||
read_more:
|
||||
other: "Read more"
|
||||
|
||||
see_also:
|
||||
other: "See also"
|
||||
related_posts:
|
||||
other: "Related Posts"
|
||||
|
||||
older_post:
|
||||
other: "Older"
|
||||
@ -61,6 +67,9 @@ aria_post_meta_view_source:
|
||||
aria_post_meta_translations:
|
||||
other: "translations"
|
||||
|
||||
aria_post_meta_categories:
|
||||
other: "categories"
|
||||
|
||||
aria_post_meta_tags:
|
||||
other: "tags"
|
||||
|
||||
@ -82,6 +91,9 @@ aria_post_metadata:
|
||||
aria_author_metadata:
|
||||
other: "author metadata"
|
||||
|
||||
aria_category_metadata:
|
||||
other: "category metadata"
|
||||
|
||||
aria_post_meta_date:
|
||||
other: "date"
|
||||
|
||||
@ -94,6 +106,9 @@ aria_author_post_count:
|
||||
aria_author_word_count:
|
||||
other: "word count"
|
||||
|
||||
aria_category_post_count:
|
||||
other: "post count"
|
||||
|
||||
aria_series_metadata:
|
||||
other: "series metadata"
|
||||
|
||||
|
25
i18n/es.yaml
25
i18n/es.yaml
@ -8,6 +8,12 @@ table_of_contents:
|
||||
browser_no_video_support:
|
||||
other: "Tu navegador de internet no admite video."
|
||||
|
||||
latest_posts:
|
||||
other: "Artículos recientes"
|
||||
|
||||
see_also:
|
||||
other: "Véase también:"
|
||||
|
||||
|
||||
# Meta items
|
||||
long_date:
|
||||
@ -26,17 +32,17 @@ readingtime:
|
||||
no_posts:
|
||||
other: "¡No hay contenido para mostrar!"
|
||||
|
||||
# post_count:
|
||||
# one: "{{ . }} post"
|
||||
# other: "{{ . }} posts"
|
||||
post_count:
|
||||
one: "{{ . }} publicación"
|
||||
other: "{{ . }} publicaciones"
|
||||
|
||||
|
||||
# Navigation
|
||||
read_more:
|
||||
other: "Leer más"
|
||||
|
||||
see_also:
|
||||
other: "Véase también"
|
||||
related_posts:
|
||||
other: "Publicaciones similares"
|
||||
|
||||
older_post:
|
||||
other: "Más antiguo"
|
||||
@ -61,6 +67,9 @@ newer_post:
|
||||
# aria_post_meta_translations:
|
||||
# other: "translations"
|
||||
|
||||
# aria_post_meta_categories:
|
||||
# other: "categories"
|
||||
|
||||
# aria_post_meta_tags:
|
||||
# other: "tags"
|
||||
|
||||
@ -82,6 +91,9 @@ newer_post:
|
||||
# aria_author_metadata:
|
||||
# other: "author metadata"
|
||||
|
||||
# aria_category_metadata:
|
||||
# other: "category metadata"
|
||||
|
||||
# aria_post_meta_date:
|
||||
# other: "date"
|
||||
|
||||
@ -94,6 +106,9 @@ newer_post:
|
||||
# aria_author_word_count:
|
||||
# other: "word count"
|
||||
|
||||
# aria_category_post_count:
|
||||
# other: "post count"
|
||||
|
||||
# aria_series_metadata:
|
||||
# other: "series metadata"
|
||||
|
||||
|
@ -14,17 +14,23 @@
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="content">
|
||||
<main>
|
||||
{{ block "main" . }}
|
||||
{{ .Content }}
|
||||
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
|
||||
{{ end }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{{ with .Site.Copyright }}
|
||||
{{ if or .Site.Copyright .Site.Params.footer }}
|
||||
<hr>
|
||||
<footer>
|
||||
<hr>
|
||||
<small>
|
||||
{{ . | safeHTML }}
|
||||
{{ with .Site.Copyright }}
|
||||
<p>{{ . | safeHTML }}</p>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.footer }}
|
||||
{{ . | $.RenderString (dict "display" "block") }}
|
||||
{{ end }}
|
||||
</small>
|
||||
</footer>
|
||||
{{ end }}
|
||||
|
@ -14,19 +14,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="page-list">
|
||||
{{ with .Paginator.Pages }}
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ partial "page-list.html" .Paginator.Pages }}
|
||||
</div>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
|
@ -7,25 +7,7 @@
|
||||
</div>
|
||||
|
||||
{{ partial "post-metadata/full.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 }}
|
||||
|
||||
{{ partial "series-box.html" . }}
|
||||
|
||||
{{ if .Params.Toc }}
|
||||
<div class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
|
||||
@ -46,23 +28,11 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
<div class="post-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||
{{ 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 }}
|
||||
{{ partial "series-box.html" . }}
|
||||
|
||||
{{ if or .NextInSection .PrevInSection }}
|
||||
<div class="prevnext">
|
||||
@ -94,9 +64,26 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.shareButtons }}
|
||||
{{ partial "share.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.comments }}
|
||||
<div class="comments">
|
||||
{{ partial "comments.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ $related := .Site.RegularPages.Related . | first 10 }}
|
||||
{{ with $related }}
|
||||
<div class="related-posts full-width-page-list">
|
||||
<hr>
|
||||
<h1>{{ i18n "related_posts" }}</h1>
|
||||
{{ partial "page-list.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.latestPostsOnContent }}
|
||||
{{ partialCached "latest-posts.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -1,12 +1,12 @@
|
||||
<div class="post">
|
||||
<h2 class="post-title">
|
||||
<div class="author">
|
||||
<h2 class="author-name">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
|
||||
</h2>
|
||||
|
||||
{{ partial "post-metadata/author.html" . }}
|
||||
|
||||
<div class="post-description">
|
||||
<div class="author-description">
|
||||
{{ partial "description-or-summary.html" . }}
|
||||
</div>
|
||||
|
||||
|
@ -7,21 +7,11 @@
|
||||
|
||||
{{ partial "post-metadata/author.html" . }}
|
||||
|
||||
{{ .Content }}
|
||||
{{ with .Content }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="page-list">
|
||||
{{ with .Paginator.Pages }}
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ partial "page-list.html" .Paginator.Pages }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
|
28
layouts/categories/list.html
Normal file
28
layouts/categories/list.html
Normal file
@ -0,0 +1,28 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ partial "icon.html" "folder" }}
|
||||
{{ .Title | markdownify }}
|
||||
</h1>
|
||||
|
||||
<div class="category-list">
|
||||
{{ with .Data.Terms.Alphabetical }}
|
||||
<ul>
|
||||
{{ range . }}
|
||||
{{ with .Page }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">
|
||||
<p>{{ .Title | markdownify }}</p>
|
||||
</a>
|
||||
{{ partial "description-or-summary.html" . }}
|
||||
{{ partial "post-metadata/category.html" . }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
17
layouts/categories/term.html
Normal file
17
layouts/categories/term.html
Normal file
@ -0,0 +1,17 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ partial "icon.html" "folder" }}
|
||||
{{ .Title | markdownify }}
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ partial "post-metadata/category.html" . }}
|
||||
|
||||
{{ with .Content }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "page-list.html" .Paginator.Pages }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
@ -1,2 +1,21 @@
|
||||
{{ define "main" }}
|
||||
{{ with .Content }}
|
||||
<div class="homepage-content">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.homepageLatestPosts }}
|
||||
<div class="homepage-latest-posts">
|
||||
<hr>
|
||||
<h1>
|
||||
{{ i18n "latest_posts" }}
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
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" }}
|
||||
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
|
||||
{{ else if eq .MediaType.MainType "video" }}
|
||||
<video controls>
|
||||
<video controls preload="metadata">
|
||||
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
||||
{{ i18n "browser_no_video_support" }}
|
||||
</video>
|
||||
|
@ -12,15 +12,19 @@
|
||||
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
|
||||
{{ with resources.Get "js/back-to-top.js" | fingerprint "sha512" }}
|
||||
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.faviconICO }}
|
||||
<link rel="icon" type="image/x-icon" href="{{ . | absURL }}" />
|
||||
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
|
||||
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.faviconPNG }}
|
||||
<link rel="icon" type="image/png" href="{{ . | absURL }}" />
|
||||
|
||||
{{ with .Site.Params.faviconSVG }}
|
||||
<link rel="icon" href="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.appleTouchPNG }}
|
||||
<link rel="apple-touch-icon" href="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsHome }}
|
||||
@ -37,4 +41,6 @@
|
||||
|
||||
<meta name="language" content="{{ .Language.Lang }}">
|
||||
<meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
|
||||
|
||||
{{ partial "additional-head.html" . }}
|
||||
</head>
|
||||
|
@ -1,5 +1 @@
|
||||
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
|
||||
{{- $icon := $icon_resource.Content -}}
|
||||
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
|
||||
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
|
||||
{{- $icon | safeHTML -}}
|
||||
{{ partialCached "icon_code.html" . . }}
|
||||
|
6
layouts/partials/icon_code.html
Normal file
6
layouts/partials/icon_code.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
|
||||
{{- $icon := $icon_resource.Content -}}
|
||||
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
|
||||
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
|
||||
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
|
||||
{{- $icon | safeHTML -}}
|
11
layouts/partials/latest-posts.html
Normal file
11
layouts/partials/latest-posts.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="latest-posts full-width-page-list">
|
||||
<hr>
|
||||
<h1>
|
||||
{{ i18n "latest_posts" }}
|
||||
{{ partial "rss-link.html" .Site.Home }}
|
||||
</h1>
|
||||
|
||||
{{ with .Site.RegularPages | first 5 }}
|
||||
{{ partial "page-list.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
13
layouts/partials/page-list.html
Normal file
13
layouts/partials/page-list.html
Normal file
@ -0,0 +1,13 @@
|
||||
<div class="page-list">
|
||||
{{ with . }}
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
11
layouts/partials/post-meta-item/categories.html
Normal file
11
layouts/partials/post-meta-item/categories.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{ with (.GetTerms "categories") }}
|
||||
{{ $categories := slice }}
|
||||
{{ range . }}
|
||||
{{ $categories = $categories | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
<div class="categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
|
||||
{{ partial "icon.html" "folder" }}
|
||||
{{ delimit $categories ", " }}
|
||||
</div>
|
||||
{{ end }}
|
@ -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 */}}
|
||||
{{ $total_words := 0 }}
|
||||
{{ range .Data.Pages }}
|
||||
{{ $total_words = add $total_words .WordCount }}
|
||||
{{ 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" }}
|
||||
{{ i18n "post_count" (len .Data.Pages) }}
|
||||
</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" }}
|
||||
{{ i18n "wordcount" $total_words }}
|
||||
</span>
|
||||
|
6
layouts/partials/post-metadata/category.html
Normal file
6
layouts/partials/post-metadata/category.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="category-metadata" aria-label="{{ i18n "aria_category_metadata" }}">
|
||||
<span class="category-meta-item" aria-label="{{ i18n "aria_category_post_count" }}">
|
||||
{{ partial "icon.html" "newspaper" }}
|
||||
{{ i18n "post_count" (len .Data.Pages) }}
|
||||
</span>
|
||||
</div>
|
@ -9,6 +9,7 @@
|
||||
</span>
|
||||
|
||||
{{/* TODO: make this be a tooltip */}}
|
||||
{{/* DISABLED
|
||||
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
|
||||
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}">
|
||||
{{ partial "icon.html" "pencil" }}
|
||||
@ -17,12 +18,14 @@
|
||||
</time>
|
||||
{{ end }}
|
||||
</span>
|
||||
*/}}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "post-meta-item/authors.html" . }}
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
{{ partial "post-meta-item/readingtime.html" . }}
|
||||
{{ partial "post-meta-item/viewsource.html" . }}
|
||||
{{ partial "post-meta-item/categories.html" . }}
|
||||
{{ partial "post-meta-item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -13,6 +13,7 @@
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
{{ partial "post-meta-item/readingtime.html" . }}
|
||||
{{ partial "post-meta-item/series.html" . }}
|
||||
{{ partial "post-meta-item/categories.html" . }}
|
||||
{{ partial "post-meta-item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -12,7 +12,7 @@
|
||||
{{ if eq $type "image" }}
|
||||
<img src="{{ $src }}" alt="{{ $alt }}" />
|
||||
{{ else if eq $type "video" }}
|
||||
<video controls>
|
||||
<video controls preload="metadata">
|
||||
<source src="{{ $src }}" alt="{{ $alt }}">
|
||||
{{ i18n "browser_no_video_support" }}
|
||||
</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 }}
|
55
layouts/partials/share.html
Normal file
55
layouts/partials/share.html
Normal file
@ -0,0 +1,55 @@
|
||||
<div class="share-buttons">
|
||||
{{ if .Site.Params.shareButtons.twitter }}
|
||||
<a class="twitter-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Twitter');"
|
||||
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
|
||||
{{- partial "icon.html" "twitter" -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.shareButtons.facebook }}
|
||||
<a class="facebook-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Facebook');"
|
||||
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
|
||||
{{- partial "icon.html" "facebook" -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.shareButtons.linkedin }}
|
||||
<a class="linkedin-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('LinkedIn');"
|
||||
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
|
||||
{{- partial "icon.html" "linkedin" -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.shareButtons.reddit }}
|
||||
<a class="reddit-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Reddit');"
|
||||
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
|
||||
{{- partial "icon.html" "reddit" -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
{{/* Telegram icon doesn't have `viewbox` set, which breaks the sizing.
|
||||
https://stackoverflow.com/q/72073399/19003757
|
||||
https://github.com/michaelampr/jam/issues/39
|
||||
{{ if .Site.Params.shareButtons.telegram }}
|
||||
<a class="telegram-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Telegram');"
|
||||
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
|
||||
{{- partial "icon.html" "telegram" -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
*/}}
|
||||
</div>
|
@ -13,7 +13,9 @@
|
||||
{{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }}
|
||||
{{ $isActive = true }}
|
||||
{{ end }}
|
||||
<a class="navbar-item{{ if $isActive }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
|
||||
<a class="navbar-item{{ if $isActive }} active{{ end }}"
|
||||
{{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
|
||||
href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
|
||||
|
@ -7,26 +7,14 @@
|
||||
|
||||
{{ partial "post-metadata/series.html" . }}
|
||||
|
||||
{{ partial "description-or-summary.html" . }}
|
||||
{{ with .Content }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Paginator.Pages.Reverse }}
|
||||
{{ partial "page-list.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="page-list">
|
||||
{{ with .Paginator.Pages.Reverse }}
|
||||
<ul>
|
||||
{{ $i := 0 }}
|
||||
{{ $total := len $.Pages }}
|
||||
{{ range . }}
|
||||
{{ $i = add 1 $i }}
|
||||
{{ .Scratch.Set "series_position" $i }}
|
||||
{{ .Scratch.Set "series_total" $total }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
|
1
layouts/shortcodes/abbr.html
Normal file
1
layouts/shortcodes/abbr.html
Normal file
@ -0,0 +1 @@
|
||||
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>
|
7
layouts/shortcodes/see-also.html
Normal file
7
layouts/shortcodes/see-also.html
Normal file
@ -0,0 +1,7 @@
|
||||
<div class="see-also">
|
||||
{{ with .Site.GetPage (.Get 0) }}
|
||||
<p>{{ i18n "see_also" }} <a href="{{ .Permalink }}">{{ .Title }}</a></p>
|
||||
{{ else }}
|
||||
{{ errorf "Page could not be found for see-also shortcode: %s" .Position }}
|
||||
{{ end }}
|
||||
</div>
|
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 }}
|
@ -5,20 +5,11 @@
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ partial "description-or-summary.html" . }}
|
||||
<div class="page-list">
|
||||
{{ with .Paginator.Pages }}
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ with .Content }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "page-list.html" .Paginator.Pages }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
|
@ -1,11 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ if eq .Data.Singular "tag" }}
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "filter" }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "icon.html" "filter" }}
|
||||
{{ .Title | markdownify }}
|
||||
</h1>
|
||||
|
||||
|
@ -1,29 +1,15 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ if eq .Data.Singular "tag" }}
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "filter" }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "icon.html" "filter" }}
|
||||
{{ .Title | markdownify }}
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ partial "description-or-summary.html" . }}
|
||||
<div class="page-list">
|
||||
{{ with .Paginator.Pages }}
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ with .Content }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "page-list.html" .Paginator.Pages }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user