28 Commits

Author SHA1 Message Date
8c0b3a7268 WIP breadcrumb style
See #52
2022-05-18 14:55:03 -05:00
73ef9cc7a6 Update README.md 2022-05-18 12:45:32 -05:00
4adb754ae3 Fix inline code links 2022-05-15 18:26:17 -05:00
81709bb47e Set default cursor when hovering over current pagination page 2022-05-14 23:22:41 -05:00
9c3a076e96 Overhaul color scheme 2022-05-14 23:19:52 -05:00
833edacc1f Update aside shortcode with types and new accent colors 2022-05-14 00:13:01 -05:00
121a67a1fc Remove unreachable errorf in aside shortcode 2022-05-13 14:34:43 -05:00
8e3fb4038a Small shortcode cleanuo & use .IsNamedParams 2022-05-13 14:34:42 -05:00
e9266cdead Use h1 for website header 2022-05-09 20:03:13 -05:00
3a4cb538f7 Add markdownify to see-also shortcode 2022-05-09 19:53:00 -05:00
de84bc5ddf Update tags and categories to both use the same layouts 2022-05-09 19:25:11 -05:00
466c91a980 Improve categories list page layout 2022-05-09 18:56:40 -05:00
8d81f5e37c Replace "View source" with "Edit history" 2022-05-08 16:13:46 -05:00
7dd01894da Add print button 2022-05-08 15:21:41 -05:00
9665133ba4 Make hr color solid 2022-05-08 15:15:20 -05:00
b272ed6181 Hide "View source" button when printing 2022-05-08 15:12:13 -05:00
17918a5617 Update hidden elements when printing 2022-05-08 14:59:25 -05:00
493ee2da96 Redo color scheme 2022-05-08 00:46:05 -05:00
3d83e9fbdf Remove extra <hr> when no content set for homepage 2022-05-07 22:24:09 -05:00
684769df5a Prevent some elements on categories taxonomy from wrapping 2022-05-06 22:15:48 -05:00
9bee463a3c Add post count to category taxonomy 2022-05-06 21:47:24 -05:00
805dc65ccb Split duplicated .page-list div into separate partial 2022-05-06 21:14:42 -05:00
a9d1c25ee4 Update i18n files 2022-05-06 20:34:48 -05:00
fe08bdc93c Prevent navbar items from wrapping 2022-05-06 20:19:45 -05:00
026d5ab2c3 Remove an empty CSS rule I accidentally left in 2022-05-06 20:18:14 -05:00
311d846cb8 Support categories again, but hopefully a bit better 2022-05-06 20:16:41 -05:00
0888356292 Show full content on tag term page 2022-05-06 19:44:27 -05:00
bcf0b68df9 Don't check for "tag" in generic taxonomy list 2022-05-06 15:06:36 -05:00
34 changed files with 462 additions and 273 deletions

View File

@ -1,2 +1,4 @@
# bobatheme
Simple Hugo theme
The (boba) best Hugo theme. Contains everything I need for bbaovanc.com and
boba.best.

View File

@ -10,6 +10,9 @@ draft: true
authors:
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
categories:
- archetype-stuff
tags:
- awesome

View 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.

View File

@ -3,53 +3,114 @@
*/
:root {
--background: #111;
--background-2: #222;
--background-3: #282828;
--background-4: #333;
--background-5: #444;
--background-accent: #111d2f;
--text-normal: #d3d3d3;
--link-color: #4da6ff;
--figure-border: #1b5b9b;
--background-0: #111111; /* lch(5, 0, X) */
--background-1: #212121; /* lch(12.5, 0, X) */
--background-2: #303030; /* lch(20, 0, X) */
--background-3: #414141; /* lch(27.5, 0, X) */
--background-pink-1: #331821; /* lch(12.5, 15, 0) */
--background-red-1: #331917; /* lch(12.5, 15, 30) */
--background-orange-1: #2e1c0e; /* lch(12.5, 15, 60) */
--background-yellow-1: #262008; /* lch(12.5, 15, 90) */
--background-lime-1: #1b230c; /* lch(12.5, 15, 120) */
--background-green-1: #0e2516; /* lch(12.5, 15, 150) */
--background-turquoise-1: #012620; /* lch(12.5, 15, 180) */
--background-teal-1: #00262b; /* lch(12.5, 15, 210) -- out of sRGB */
--background-cerulean-1: #032432; /* lch(12.5, 15, 240) */
--background-blue-1: #152135; /* lch(12.5, 15, 270) */
--background-purple-1: #241d33; /* lch(12.5, 15, 300) */
--background-magenta-1: #2e1a2b; /* lch(12.5, 15, 330) */
--background-pink-2: #4b2431; /* lch(20, 20, 0) */
--background-red-2: #4a2623; /* lch(20, 20, 30) */
--background-orange-2: #432a17; /* lch(20, 20, 60) */
--background-yellow-2: #373012; /* lch(20, 20, 90) */
--background-lime-2: #283416; /* lch(20, 20, 120) */
--background-green-2: #163721; /* lch(20, 20, 150) */
--background-turquoise-2: #003830; /* lch(20, 20, 180) -- out of sRGB */
--background-teal-2: #00373e; /* lch(20, 20, 210) -- out of sRGB */
--background-cerulean-2: #013549; /* lch(20, 20, 240) */
--background-blue-2: #1f314e; /* lch(20, 20, 270) */
--background-purple-2: #352c4a; /* lch(20, 20, 300) */
--background-magenta-2: #43263f; /* lch(20, 20, 330) */
--background-accent-1: var(--background-blue-1);
--background-accent-2: var(--background-blue-2);
--text-0: #d4d4d4; /* lch(85, 0, X) */
--text-1: #d4d4d4; /* lch(85, 0, X) */
--text-2: #d4d4d4; /* lch(85, 0, X) */
--text-3: #e9e9e9; /* lch(92.5, 0, X) */
--text-gray-0: #ababab; /* lch(70, 0, X) */
--text-gray-1: #919191; /* lch(60, 0, X) */
--link-0: #3a94fb; /* lch(60, 60, 270) */
--figure-border: #1f5593; /* lch(35, 40, 270) */
--pagination-active-hover-text: black;
--pagination-active-background: #163b64;
--pagination-active-hover-background: #286ab2;
--pagination-active-background: #1a3d69; /* lch(25, 30, 270) */
--pagination-active-hover-background: #2061a8; /* lch(40, 45, 270) */
}
@media (prefers-color-scheme: light) {
@media print, (prefers-color-scheme: light) {
:root {
--background: #eee;
--background-2: #ddd;
--background-3: #d8d8d8;
--background-4: #bbb;
--background-5: #aaa;
--background-accent: #aec9ee;
--text-normal: #000;
--link-color: #0057bf;
--figure-border: #2e7bc9;
--background-0: #f1f1f1; /* lch(95, 0, X) */
--background-1: #dbdbdb; /* lch(87.5, 0, X) */
--background-2: #c6c6c6; /* lch(80, 0, X) */
--background-3: #b2b2b2; /* lch(72.5, 0, X) */
--background-pink-1: #f7d1dc; /* lch(87.5, 15, 0) */
--background-red-1: #f8d2ce; /* lch(87.5, 15, 30) */
--background-orange-1: #f1d6c3; /* lch(87.5, 15, 60) */
--background-yellow-1: #e4dbbf; /* lch(87.5, 15, 90) */
--background-lime-1: #d5dfc2; /* lch(87.5, 15, 120) */
--background-green-1: #c6e3cc; /* lch(87.5, 15, 150) */
--background-turquoise-1: #bce4db; /* lch(87.5, 15, 180) */
--background-teal-1: #bae3e9; /* lch(87.5, 15, 210) */
--background-cerulean-1: #c2e0f4; /* lch(87.5, 15, 240) */
--background-blue-1: #d0dcf8; /* lch(87.5, 15, 270) */
--background-purple-1: #e1d7f4; /* lch(87.5, 15, 300) */
--background-magenta-1: #efd3ea; /* lch(87.5, 15, 330) */
--background-pink-2: #fbb1c8; /* lch(80, 30, 0) */
--background-red-2: #fbb4ac; /* lch(80, 30, 30) */
--background-orange-2: #eebc97; /* lch(80, 30, 60) */
--background-yellow-2: #d6c58e; /* lch(80, 30, 90) */
--background-lime-2: #b8ce95; /* lch(80, 30, 120) */
--background-green-2: #9ad4a9; /* lch(80, 30, 150) */
--background-turquoise-2: #81d6c5; /* lch(80, 30, 180) */
--background-teal-2: #7ad5e1; /* lch(80, 30, 210) */
--background-cerulean-2: #8cd0f6; /* lch(80, 30, 240) */
--background-blue-2: #adc8fe; /* lch(80, 30, 270) */
--background-purple-2: #d0bef7; /* lch(80, 30, 300) */
--background-magenta-2: #ecb5e3; /* lch(80, 30, 330) */
--background-accent-1: var(--background-blue-1);
--background-accent-2: var(--background-blue-2);
--text-0: #262626; /* lch(15, 0, X) */
--text-1: #262626; /* lch(15, 0, X) */
--text-2: #262626; /* lch(15, 0, X) */
--text-3: #171717; /* lch(72.5, 0, X) */
--text-gray-0: #474747; /* lch(30, 0, X) */
--text-gray-1: #5e5e5e; /* lch(40, 0, X) */
--link-0: #2061a8; /* lch(40, 45, 270) */
--figure-border: #367acd; /* lch(50, 50, 270) */
--pagination-active-hover-text: white;
--pagination-active-background: #3977bd;
--pagination-active-hover-background: #154172;
--pagination-active-background: #9fbaf0; /* lch(75, 30, 270) */
--pagination-active-hover-background: #6193e0; /* lch(60, 45, 270) */
}
}
@media print {
:root {
--background: #fff;
--background-2: #ddd;
--background-3: #d8d8d8;
--background-4: #bbb;
--background-5: #aaa;
--text-normal: #000;
--link-color: #0057bf;
--figure-border: #2e7bc9;
--pagination-active-hover-text: white;
--pagination-active-background: #3977bd;
--pagination-active-hover-background: #154172;
--background-0: #fff;
}
}
@ -82,7 +143,8 @@
padding-right: 24px;
padding-bottom: 24px;
border-radius: 12px;
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
}
.post-series-position {
@ -113,6 +175,7 @@
margin-bottom: 15px;
}
.categories,
.tags,
.series {
margin-top: 10px;
@ -133,24 +196,49 @@
/* Tags list format */
.tag-list ul {
display: flex;
/* Taxonomy list format */
.taxonomy-list a,
.taxonomy-list .taxonomy-metadata {
white-space: nowrap;
}
.taxonomy-list p {
margin: 0;
}
.taxonomy-list ul {
list-style: none;
gap: 10px;
flex-flow: row wrap;
padding: 0;
display: flex;
flex-direction: column;
gap: 10px;
}
.tag-list a {
background-color: var(--background-2);
.taxonomy-list li {
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 12px;
border-radius: 12px;
border-radius: 8px;
display: flex;
flex-direction: row;
gap: 20px;
}
.tag-list a:hover {
text-decoration: none;
background-color: var(--background-4);
.taxonomy-list-left {
display: flex;
flex-direction: column;
}
@media (max-width: 480px) {
.taxonomy-list li {
flex-direction: column;
gap: 4px;
}
.taxonomy-list-left {
flex-direction: row;
justify-content: space-between;
}
}
@ -161,7 +249,8 @@
gap: 10px;
flex-flow: row wrap;
list-style: none;
background-color: var(--background);
background-color: var(--background-0);
color: var(--text-0);
padding: 8px;
border-radius: 16px;
}
@ -181,13 +270,15 @@
}
.section {
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
border-radius: 12px;
padding: 1px 25px;
}
.section:hover {
background-color: var(--background-4);
background-color: var(--background-2);
color: var(--text-2);
}
.section-title {
@ -213,6 +304,10 @@
/* Header formatting (website title and article section headers) */
h1.header {
font-size: 1.5em;
}
.header a,
.section-header a {
color: inherit;
@ -227,14 +322,16 @@
/* Content formatting */
.series-box {
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 16px;
border-radius: 8px;
margin: 15px 0;
}
.table-of-contents {
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 20px;
border-radius: 8px;
margin: 10px 0;
@ -306,7 +403,8 @@
/* Social media share buttons */
.share-buttons {
background: var(--background-2);
background: var(--background-1);
color: var(--text-1);
margin: 25px 0;
padding: 8px 0;
border-radius: 8px;
@ -315,12 +413,18 @@
justify-content: center;
}
.share-buttons button,
.share-buttons a {
background-color: var(--background-4);
background-color: var(--background-2);
color: var(--text-2);
padding: 4px;
border-radius: 8px;
}
.share-buttons button {
border: none;
}
.share-buttons svg {
width: 32px;
height: 32px;
@ -337,7 +441,8 @@
/* See also formating */
.see-also {
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 12px;
border-radius: 8px;
margin: 10px 0;
@ -354,7 +459,8 @@
float: right;
bottom: 25px;
right: 25px;
background-color: var(--background-3);
background-color: var(--background-1);
color: var(--text-1);
border-radius: 100%;
padding: 12px;
display: none;
@ -367,7 +473,8 @@
display: flex;
flex-wrap: nowrap;
flex-direction: row;
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
border-radius: 8px;
margin-top: 5px;
padding: 4px;
@ -383,15 +490,21 @@
.navbar a {
padding: 8px 12px;
border-radius: 12px;
white-space: nowrap;
}
.navbar-item:hover,
.langpicker summary:hover,
.langpicker[open] summary {
background-color: var(--background-5);
background-color: var(--background-3);
text-decoration: none;
}
.langpicker summary:hover,
.langpicker[open] summary {
color: var(--text-3);
}
.topbar .active {
font-weight: bold;
}
@ -412,8 +525,9 @@
position: absolute;
margin-top: 8px;
right: 0;
background-color: var(--background-2);
border: 2px solid var(--background-4);
background-color: var(--background-1);
color: var(--text-1);
border: 2px solid var(--background-2);
padding: 8px 12px;
border-radius: 8px;
list-style: none;
@ -442,8 +556,8 @@ html {
}
body {
background-color: var(--background);
color: var(--text-normal);
background-color: var(--background-0);
color: var(--text-0);
font-family: "Open Sans", "Noto Sans", sans-serif;
margin: 20px;
max-width: 720px;
@ -492,15 +606,8 @@ figcaption {
text-align: center;
}
aside {
background-color: var(--background-2);
padding: 12px 16px;
margin: 16px 0;
border-radius: 8px;
}
a {
color: var(--link-color);
color: var(--link-0);
text-decoration: inherit;
}
@ -509,21 +616,22 @@ a:hover {
}
blockquote {
border-left: 5px solid var(--background-4);
border-left: 5px solid var(--background-2);
padding-left: 15px;
}
hr {
border-color: var(--background-5);
border: 1px solid var(--background-3);
}
table.markdown {
border-collapse: collapse;
border: 2px solid var(--text-normal);
border: 2px solid var(--text-1);
}
.markdown thead {
background-color: var(--background-4);
background-color: var(--background-2);
color: var(--text-2);
}
.markdown th,
@ -532,10 +640,12 @@ table.markdown {
}
.markdown tbody tr:nth-child(odd) {
background-color: var(--background);
background-color: var(--background-0);
color: var(--text-0);
}
.markdown tbody tr:nth-child(even) {
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
}
* {
@ -555,7 +665,11 @@ table.markdown {
}
:not(pre) > code {
background-color: var(--background-3);
background-color: var(--background-2);
/* Disable this because it overrides inline code blocks that are
* also links
color: var(--text-2);
*/
padding: 2px 4px;
overflow-wrap: break-word;
}
@ -570,11 +684,53 @@ code {
/* Asides */
aside {
padding: 8px 16px;
margin: 16px 0;
border-radius: 8px;
color: var(--text-1);
}
.aside-title {
margin-bottom: 8px;
padding-bottom: 4px;
font-weight: bold;
}
.aside-content > :first-child {
margin-top: 0;
}
.aside-content > :last-child {
margin-bottom: 0;
}
aside.note {
background-color: var(--background-blue-1);
}
aside.info {
background-color: var(--background-green-1);
}
aside.tip {
background-color: var(--background-teal-1);
}
aside.warning {
background-color: var(--background-yellow-1);
}
aside.example {
background-color: var(--background-purple-1);
}
aside.quote {
background-color: var(--background-1);
}
/* Icons */
.icon {
width: 20px;
height: 20px;
color: var(--text-normal);
color: var(--text-1);
text-align: center;
display: inline;
vertical-align: middle;
@ -601,7 +757,7 @@ h1 svg.icon {
.page-link {
padding: 8px 16px;
border-radius: 5px;
color: var(--text-normal);
color: var(--text-1);
}
.page-item.active .page-link {
@ -612,6 +768,7 @@ h1 svg.icon {
.page-item.active .page-link:hover {
background-color: var(--pagination-active-hover-background);
color: var(--pagination-active-hover-text);
cursor: default;
}
.page-link:hover {
@ -619,7 +776,7 @@ h1 svg.icon {
}
:not(li.disabled) > .page-link:hover {
background-color: var(--background-5);
background-color: var(--background-3);
}
li.disabled {
@ -634,20 +791,45 @@ li.disabled > .page-link:hover {
/* Breadcrumb navigation */
.breadcrumb {
margin: 30px 0 20px;
margin: 16px 0;
}
.breadcrumb ul {
padding: 0;
list-style: none;
display: flex;
justify-content: space-between;
flex-grow: 1;
}
.breadcrumb li {
display: inline;
padding: 8px;
background-color: var(--background-1);
}
.breadcrumb li+li:before {
content: "»"
.breadcrumb li:hover {
background-color: var(--background-2);
cursor: pointer;
}
.breadcrumb li a:hover {
text-decoration: none;
}
.breadcrumb li.active:hover {
cursor: default;
}
.breadcrumb li:first-child {
border-top-left-radius: 12px;
border-bottom-left-radius: 12px;
padding-left: 12px;
}
.breadcrumb li:last-child {
border-top-right-radius: 12px;
border-bottom-right-radius: 12px;
padding-right: 12px;
}
@ -665,12 +847,14 @@ li.disabled > .page-link:hover {
display: flex;
flex-direction: column;
color: inherit;
background-color: var(--background-2);
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 16px;
}
.prevnext > a:hover {
background-color: var(--background-4);
background-color: var(--background-2);
color: var(--text-2);
text-decoration: none;
}
@ -702,11 +886,6 @@ li.disabled > .page-link:hover {
/* Light mode */
@media print,
(prefers-color-scheme: light) {
/* Basic elements */
.section:hover {
color: inherit;
}
li.disabled {
opacity: .25;
}
@ -717,10 +896,12 @@ li.disabled > .page-link:hover {
/* Print compatibility */
@media print {
.top,
.breadcrumb,
.section-header-link,
.post-meta-edit-history,
.prevnext,
.comments {
.share-buttons,
.related-posts,
.latest-posts {
display: none;
}

View File

@ -7,6 +7,7 @@ params:
readingtime: true
taxonomies:
category: categories
tag: tags
author: authors
series: series

View File

@ -30,6 +30,7 @@ params:
# 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
# display a "Latest Posts" section on the homepage below its content
homepageLatestPosts: true
@ -41,6 +42,7 @@ params:
# linkedin: true
# reddit: true
# telegram: true
# print: true
# show "Latest Posts" section at bottom of content pages
# latestPostsOnContent: true

View File

@ -27,6 +27,9 @@ readingtime:
one: "{{ . }} min"
other: "{{ . }} mins"
edit_history:
other: "Edit history"
# Post count
no_posts:
@ -61,12 +64,15 @@ aria_back_to_top_button:
aria_rss_link:
other: "RSS feed link"
aria_post_meta_view_source:
other: "link to page source"
aria_post_meta_edit_history:
other: "link to page edit history"
aria_post_meta_translations:
other: "translations"
aria_post_meta_categories:
other: "categories"
aria_post_meta_tags:
other: "tags"
@ -88,6 +94,9 @@ aria_post_metadata:
aria_author_metadata:
other: "author metadata"
aria_taxonomy_metadata:
other: "taxonomy metadata"
aria_post_meta_date:
other: "date"
@ -100,6 +109,9 @@ aria_author_post_count:
aria_author_word_count:
other: "word count"
aria_taxonomy_post_count:
other: "post count"
aria_series_metadata:
other: "series metadata"

View File

@ -8,6 +8,9 @@ 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:"
@ -24,14 +27,17 @@ readingtime:
one: "{{ . }} min"
other: "{{ . }} mins"
edit_history:
other: "Historial de cambios"
# Post count
no_posts:
other: "¡No hay contenido para mostrar!"
# post_count:
# one: "{{ . }} post"
# other: "{{ . }} posts"
post_count:
one: "{{ . }} publicación"
other: "{{ . }} publicaciones"
# Navigation
@ -58,12 +64,15 @@ newer_post:
# aria_rss_link:
# other: "RSS feed link"
# aria_post_meta_view_source:
# other: "link to page source"
# aria_post_meta_edit_history:
# other: "link to page edit history"
# aria_post_meta_translations:
# other: "translations"
# aria_post_meta_categories:
# other: "categories"
# aria_post_meta_tags:
# other: "tags"
@ -85,6 +94,9 @@ newer_post:
# aria_author_metadata:
# other: "author metadata"
# aria_taxonomy_metadata:
# other: "taxonomy metadata"
# aria_post_meta_date:
# other: "date"
@ -97,6 +109,9 @@ newer_post:
# aria_author_word_count:
# other: "word count"
# aria_taxonomy_post_count:
# other: "post count"
# aria_series_metadata:
# other: "series metadata"

View File

@ -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" . }}

View File

@ -24,7 +24,7 @@
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}
@ -79,13 +79,7 @@
<div class="related-posts full-width-page-list">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
<div class="page-list">
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
</div>
{{ partial "page-list.html" . }}
</div>
{{ end }}

View File

@ -9,7 +9,7 @@
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}

View File

@ -15,7 +15,7 @@
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}

View File

@ -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 }}

View File

@ -3,29 +3,17 @@
<div class="homepage-content">
{{ . }}
</div>
<hr>
{{ end }}
{{ if .Site.Params.homepageLatestPosts }}
<div class="homepage-latest-posts">
<hr>
<h1>
{{ i18n "latest_posts" }}
{{ partial "rss-link.html" . }}
</h1>
{{ with (.Paginate .Site.RegularPages).Pages }}
<div class="page-list">
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
</div>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
{{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }}
{{ partial "pagination.html" . }}
</div>

View File

@ -6,16 +6,6 @@
</h1>
{{ with .Site.RegularPages | first 5 }}
<div class="page-list">
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
</div>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ partial "page-list.html" . }}
{{ end }}
</div>

View 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>

View 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 }}

View File

@ -0,0 +1,8 @@
{{ if and .Site.Params.gitHistoryURL .File.Path }}
<span class="post-meta-item post-meta-edit-history" aria-label="{{ i18n "aria_post_meta_edit_history" }}">
{{ partial "icon.html" "history" }}
<a href="{{ printf "%s/content/%s" .Site.Params.gitHistoryURL .File.Path }}" target="_blank" rel="noopener">
{{- i18n "edit_history" -}}
</a>
</span>
{{ end }}

View File

@ -1,13 +0,0 @@
{{ if and .Site.Params.gitFileURL .File.Path }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_view_source" }}">
{{ with .Site.Params.gitFileIcon }}
{{ partial "icon.html" . }}
{{ else }}
{{ partial "icon.html" "file" }}
{{ end }}
<a href="{{ printf "%s/content/%s" .Site.Params.gitFileURL .File.Path }}" target="_blank" rel="noopener">
View source
</a>
</span>
{{ end }}

View File

@ -24,7 +24,8 @@
{{ 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/edithistory.html" . }}
{{ partial "post-meta-item/categories.html" . }}
{{ partial "post-meta-item/tags.html" . }}
</div>
{{ end }}

View File

@ -16,7 +16,4 @@
{{ end }}
{{ partial "post-meta-item/translations.html" . }}
{{ if .File }}
{{ partial "post-meta-item/viewsource.html" . }}
{{ end }}
</div>

View File

@ -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 }}

View File

@ -0,0 +1,6 @@
<div class="taxonomy-metadata" aria-label="{{ i18n "aria_taxonomy_metadata" }}">
<span class="taxonomy-meta-item" aria-label="{{ i18n "aria_taxonomy_post_count" }}">
{{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }}
</span>
</div>

View File

@ -52,4 +52,11 @@
</a>
{{ end }}
*/}}
{{ if .Site.Params.shareButtons.print }}
<button class="print-share"
onclick="window.print(); share_event('Print');">
{{- partial "icon.html" "printer" -}}
</button>
{{ end }}
</div>

View File

@ -1,6 +1,6 @@
<h2 class="header">
<h1 class="header">
<a href="{{ .Site.Home.Permalink | absLangURL }}">{{ .Site.Title | markdownify }}</a>
</h2>
</h1>
<div class="topbar">
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}">

View File

@ -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 }}

View File

@ -1 +1,5 @@
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>
{{ if .IsNamedParams }}
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>
{{ else }}
<abbr title="{{ .Get 0 }}">{{ .Inner }}</abbr>
{{ end }}

View File

@ -1,7 +1,28 @@
<aside>
{{ with .Inner }}
{{ . | markdownify }}
{{ else }}
{{ errorf "The aside shortcode needs to be a closing one (similar to the highlight shortcode, see https://gohugo.io/templates/shortcode-templates/#inner" }}
{{ end }}
{{ $type := "" }}
{{ if .IsNamedParams }}
{{ $type = .Get "type" | default "note" }}
{{ else }}
{{ $type = .Get 0 | default "note" }}
{{ end }}
{{/* This idea comes from the LoveIt theme:
https://github.com/dillonzq/LoveIt/blob/aa834e89af8349f6c18d4c7ad50a73fd5f1e40e0/layouts/shortcodes/admonition.html#L3-L14
*/}}
{{ $icons := dict "note" "pencil" }}
{{ $icons = dict "info" "info" | merge $icons }}
{{ $icons = dict "tip" "lightbulb" | merge $icons }}
{{ $icons = dict "warning" "info" | merge $icons }}
{{ $icons = dict "example" "flask" | merge $icons }}
{{ $icons = dict "quote" "quote" | merge $icons }}
<aside class="{{ $type }}">
<div class="aside-title">
{{ partial "icon.html" (index $icons $type) }}
{{ title $type }}
</div>
<div class="aside-content">
{{ .Inner | .Page.RenderString (dict "display" "block") }}
</div>
</aside>

View File

@ -1,4 +1,9 @@
{{ $resource := $.Page.Resources.GetMatch (.Get "src") }}
{{ $resource := "" }}
{{ if .IsNamedParams }}
{{ $resource = $.Page.Resources.GetMatch (.Get "src") }}
{{ else }}
{{ $resource = $.Page.Resources.GetMatch (.Get 0) }}
{{ end }}
{{ $noborder := false }}
{{ if .Get "noborder" }}

View File

@ -1,6 +1,6 @@
<div class="see-also">
{{ with .Site.GetPage (.Get 0) }}
<p>{{ i18n "see_also" }} <a href="{{ .Permalink }}">{{ .Title }}</a></p>
<p>{{ i18n "see_also" }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></p>
{{ else }}
{{ errorf "Page could not be found for see-also shortcode: %s" .Position }}
{{ end }}

View File

@ -1,22 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "tag" }}
{{ .Title | markdownify }}
</h1>
<div class="tag-list">
{{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }}
<a href="{{ .Page.Permalink }}">
<li>{{ .Page.Title | markdownify }}</li>
</a>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ end }}

View File

@ -1,24 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "tag" }}
{{ .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>
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -2,6 +2,8 @@
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
{{ else if eq .Data.Singular "category" }}
{{ partial "icon.html" "folder" }}
{{ else }}
{{ partial "icon.html" "filter" }}
{{ end }}
@ -9,13 +11,21 @@
{{ .Title | markdownify }}
</h1>
<div class="taxonomy">
<div class="taxonomy-list">
{{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }}
<li>
<a href="{{ .Page.Permalink }}">{{ .Page.Title | markdownify }}</a>
</li>
{{ with .Page }}
<li>
<div class="taxonomy-list-left">
<a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p>
</a>
{{ partial "post-metadata/taxonomy.html" . }}
</div>
{{ partial "description-or-summary.html" . }}
</li>
{{ end }}
{{ end }}
</ul>
{{ else }}

View File

@ -2,6 +2,8 @@
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
{{ else if eq .Data.Singular "category" }}
{{ partial "icon.html" "folder" }}
{{ else }}
{{ partial "icon.html" "filter" }}
{{ end }}
@ -10,20 +12,13 @@
{{ 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>
{{ partial "post-metadata/taxonomy.html" . }}
{{ with .Content }}
{{ . }}
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}