47 Commits

Author SHA1 Message Date
72b5479472 bruh
it's not variable font
2023-01-22 20:25:20 -06:00
4d1a0d6be2 Jost 2023-01-22 20:01:33 -06:00
ac580e1995 WIP 2023-01-22 18:57:52 -06:00
cee1cd3a82 WIP 2023-01-22 18:57:52 -06:00
3fae019148 Finish support for list page subtitle
Fixes #27 (as long as I didn't miss anything)
2023-01-22 16:43:09 -06:00
8ef1e3840a Change color when hovering over share buttons 2023-01-22 16:31:08 -06:00
629b3758b9 Change print button to an <a> to match the rest of the buttons
Also makes it have pointer cursor
2023-01-22 16:28:24 -06:00
9412906b4f Make the left bar of blockquote lined up with rest of text 2023-01-22 16:26:43 -06:00
f8cfad647f Fix contrast of code block Copy button 2023-01-22 16:23:03 -06:00
b200623dca Fix keyboard accessibility of code block copy button 2023-01-22 16:22:51 -06:00
80f5994d96 Improve code block copy text
- Use JS to get it directly from the code block instead of needing a
  separate `pre.code-raw` to get it from. That makes it possible to:
- bashsession: Don't copy prompt or command output
2023-01-22 00:09:34 -06:00
342710a755 Reduce gap between elements in subsections list 2023-01-21 23:34:34 -06:00
8eb642dbc8 Remove <hr> separator before footer 2023-01-21 23:32:32 -06:00
a4be8b395b Remove video and add remote-figure shortcodes 2023-01-21 21:32:02 -06:00
47d6d02186 Add copy to clipboard to code blocks 2023-01-20 17:14:18 -06:00
a26ea62b60 Refresh the code block design 2023-01-20 16:25:28 -06:00
7cff045cb3 Website header title should not be h1 2023-01-07 20:50:01 -06:00
9f080377e7 Allow adding descriptions to taxonomies 2023-01-07 20:40:46 -06:00
fb40c8a4c3 Small spacing tweaks with page titles 2022-07-20 21:48:55 -05:00
0c248a4ca5 Prevent prompt symbol in console code blocks from being highlighted 2022-07-19 00:09:16 -05:00
56d8a07893 Fix syntax highlighting background 2022-07-02 19:01:01 -05:00
8aab2ca693 Fix chroma CSS overrides 2022-07-02 18:58:48 -05:00
e46288dc45 Update chroma (syntax highlighting) styles 2022-06-18 16:18:08 -05:00
637ffc12f5 Rename seo-tags/description.html partial to seo-description.html 2022-06-12 19:01:05 -05:00
2a40664bb6 Rename index.html to home.html in layouts 2022-06-12 18:51:30 -05:00
e34d2109ec Small semantic HTML tweaks 2022-05-23 01:33:24 -05:00
54f89dad51 Make .post-content an <article> instead of <div> 2022-05-22 19:51:16 -05:00
04b5017279 Add full-width-hr shortcode 2022-05-22 18:19:16 -05:00
a65a435b1d Replace <li> in page lists with semantic HTML <article> 2022-05-21 23:20:22 -05:00
73dc916d5a Add animation to :target 2022-05-21 20:56:26 -05:00
e8be3ae45b Use tag name in keywords meta tag 2022-05-18 15:01:06 -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
63 changed files with 780 additions and 392 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

@ -1,28 +1,55 @@
/* bobatheme is available under the MIT license at
/* vim: foldmethod=marker
*
* bobatheme is available under the MIT license at
* https://github.com/BBaoVanC/bobatheme.
*/
/* color notes:
* accent is 15 chroma, 270 hue
*
* lightness (dark):
* background-0: 5
* background-1: 12.5
* background-2: 20
* background-highlight: 27.5
* text-0: 92.5
* text-1: 85
*/
:root {
--background-0: #111111;
--background-1: #212121;
--background-2: #303030;
--background-highlight: #414141;
--background-accent: #101c30; /* lch(10, 15, 270) */
--text-0: #e9e9e9;
--text-1: #d4d4d4;
--link-color: #3a94fb; /* lch(60, 60, 270) */
--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) */
--link-1: #4ea1ff; /* lch(65, 60, 270) -- out of sRGB */
--figure-border: #1f5593; /* lch(35, 40, 270) */
--pagination-active-hover-text: black;
@ -32,14 +59,50 @@
@media print, (prefers-color-scheme: light) {
:root {
--background-0: #f1f1f1;
--background-1: #dbdbdb;
--background-2: #c6c6c6;
--background-highlight: #c6c6c6;
--background-accent: #d7e3ff;
--text-0: #171717;
--text-1: #262626;
--link-color: #2061a8; /* lch(40, 45, 270) */
--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;
@ -56,6 +119,166 @@
/* Fonts */
/* Open Sans {{{ */
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4taVIGxA.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4kaVIGxA.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4saVIGxA.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4jaVIGxA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* hebrew */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4iaVIGxA.woff2) format('woff2');
unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4vaVIGxA.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4uaVIGxA.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(/font/opensans/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVI.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* }}} */
/* JetBrains Mono {{{ */
/* cyrillic-ext */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/font/jetbrainsmono/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTN1OVgaY.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/font/jetbrainsmono/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTPlOVgaY.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/font/jetbrainsmono/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOVOVgaY.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/font/jetbrainsmono/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTNVOVgaY.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/font/jetbrainsmono/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTNFOVgaY.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/font/jetbrainsmono/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOlOV.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* }}} */
:root {
--font-sans: "Open Sans", "Noto Sans", sans-serif;
--font-mono: "JetBrains Mono", monospace;
}
html {
font-family: var(--font-sans);
}
pre, code, kbd, samp {
font-family: var(--font-mono);
font-size: 0.75em;
}
pre > code {
/* otherwise it ends up being 0.75^2 em */
font-size: unset;
}
/* Post layout (in list pages) */
.list-page-content {
display: flex;
@ -63,8 +286,8 @@
gap: 40px;
}
.page-list ul,
.series-taxonomy ul {
.page-list,
.series-taxonomy-list {
display: flex;
flex-direction: column;
list-style: none;
@ -72,18 +295,20 @@
gap: 40px;
}
.series-taxonomy ul {
.series-taxonomy-list {
gap: 80px;
}
.page-list li,
.series-taxonomy li {
.page-list .post,
.series-taxonomy-list .series-taxonomy,
.series-taxonomy .post {
padding-top: 8px;
padding-left: 24px;
padding-right: 24px;
padding-bottom: 24px;
border-radius: 12px;
background-color: var(--background-1);
color: var(--text-1);
}
.post-series-position {
@ -97,6 +322,11 @@
margin-bottom: 10px;
}
.post-title h1,
.author-name h1 {
margin: 0;
}
.post-title a,
.author-name a {
color: inherit;
@ -111,7 +341,7 @@
.post-metadata,
.author-metadata {
margin-bottom: 15px;
margin-bottom: 24px;
}
.categories,
@ -135,80 +365,66 @@
/* 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-1);
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 {
/* Taxonomy list format */
.taxonomy-list a,
.taxonomy-list .taxonomy-metadata {
white-space: nowrap;
}
.taxonomy-list p {
margin: 0;
}
/* Tags list format */
.tag-list ul {
display: flex;
.taxonomy-list {
list-style: none;
gap: 10px;
flex-flow: row wrap;
padding: 0;
display: flex;
flex-direction: column;
gap: 10px;
}
.tag-list a {
.taxonomy-list .taxonomy-term {
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-2);
.taxonomy-list-left {
display: flex;
flex-direction: column;
}
@media (max-width: 480px) {
.taxonomy-list .taxonomy-term {
flex-direction: column;
gap: 4px;
}
.taxonomy-list-left {
flex-direction: row;
justify-content: space-between;
}
}
/* Series list format */
.series-pages ul {
.series-page-list {
display: flex;
gap: 10px;
flex-flow: row wrap;
list-style: none;
background-color: var(--background-0);
color: var(--text-0);
padding: 8px;
border-radius: 16px;
}
.series-pages li {
.series-page-list .post {
flex: 1;
min-width: 49%;
}
@ -219,17 +435,19 @@
.sections {
display: flex;
flex-direction: column;
gap: 40px;
gap: 10px;
}
.section {
background-color: var(--background-1);
color: var(--text-1);
border-radius: 12px;
padding: 1px 25px;
}
.section:hover {
background-color: var(--background-2);
color: var(--text-2);
}
.section-title {
@ -255,9 +473,15 @@
/* Header formatting (website title and article section headers) */
.header {
margin: 16px 0;
}
.header a,
.section-header a {
color: inherit;
font-size: 1.5em;
font-weight: bold;
}
.section-header-link svg {
@ -270,6 +494,7 @@
/* Content formatting */
.series-box {
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 16px;
border-radius: 8px;
margin: 15px 0;
@ -277,6 +502,7 @@
.table-of-contents {
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 20px;
border-radius: 8px;
margin: 10px 0;
@ -292,6 +518,7 @@
}
/* Related posts */
.full-width-page-list {
/* make left/right 0 margin so it takes up full width */
@ -304,16 +531,16 @@
margin-right: 20px;
}
.full-width-page-list li {
.full-width-page-list .post {
min-width: 300px;
max-width: 300px;
}
.full-width-page-list li:first-child {
.full-width-page-list .post:first-child {
margin-left: 20px;
}
.full-width-page-list li:last-child {
.full-width-page-list .post:last-child {
margin-right: 20px;
}
@ -338,7 +565,7 @@
}
}
.full-width-page-list .page-list ul {
.full-width-page-list .page-list {
display: flex;
flex-direction: row;
gap: 20px;
@ -346,9 +573,11 @@
}
/* Social media share buttons */
.share-buttons {
background: var(--background-1);
color: var(--text-1);
margin: 25px 0;
padding: 8px 0;
border-radius: 8px;
@ -359,9 +588,14 @@
.share-buttons a {
background-color: var(--background-2);
color: var(--text-2);
padding: 4px;
border-radius: 8px;
}
.share-buttons a:hover {
background-color: var(--background-3);
color: var(--text-3);
}
.share-buttons svg {
width: 32px;
@ -377,9 +611,11 @@
*/
/* See also formating */
.see-also {
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 12px;
border-radius: 8px;
margin: 10px 0;
@ -390,6 +626,7 @@
}
/* Back to top */
#back-to-top {
position: fixed;
@ -397,6 +634,7 @@
bottom: 25px;
right: 25px;
background-color: var(--background-1);
color: var(--text-1);
border-radius: 100%;
padding: 12px;
display: none;
@ -410,6 +648,7 @@
flex-wrap: nowrap;
flex-direction: row;
background-color: var(--background-1);
color: var(--text-1);
border-radius: 8px;
margin-top: 5px;
padding: 4px;
@ -431,10 +670,15 @@
.navbar-item:hover,
.langpicker summary:hover,
.langpicker[open] summary {
background-color: var(--background-highlight);
background-color: var(--background-3);
text-decoration: none;
}
.langpicker summary:hover,
.langpicker[open] summary {
color: var(--text-3);
}
.topbar .active {
font-weight: bold;
}
@ -456,6 +700,7 @@
margin-top: 8px;
right: 0;
background-color: var(--background-1);
color: var(--text-1);
border: 2px solid var(--background-2);
padding: 8px 12px;
border-radius: 8px;
@ -486,8 +731,7 @@ html {
body {
background-color: var(--background-0);
color: var(--text-1);
font-family: "Open Sans", "Noto Sans", sans-serif;
color: var(--text-0);
margin: 20px;
max-width: 720px;
overflow-wrap: break-word;
@ -500,6 +744,7 @@ body {
}
footer {
margin-top: 20px;
text-align: center;
}
@ -535,15 +780,8 @@ figcaption {
text-align: center;
}
aside {
background-color: var(--background-1);
padding: 12px 16px;
margin: 16px 0;
border-radius: 8px;
}
a {
color: var(--link-color);
color: var(--link-0);
text-decoration: inherit;
}
@ -554,10 +792,19 @@ a:hover {
blockquote {
border-left: 5px solid var(--background-2);
padding-left: 15px;
margin-left: 0;
}
hr {
border-color: var(--background-highlight);
border: 1px solid var(--background-3);
}
@media (min-width: 720px) {
.full-width-hr {
/* see also: the related-posts section too */
margin-left: calc(-100vw / 2 + 760px / 2);
margin-right: calc(-100vw / 2 + 760px / 2);
}
}
table.markdown {
@ -567,6 +814,7 @@ table.markdown {
.markdown thead {
background-color: var(--background-2);
color: var(--text-2);
}
.markdown th,
@ -576,9 +824,18 @@ table.markdown {
.markdown tbody tr:nth-child(odd) {
background-color: var(--background-0);
color: var(--text-0);
}
.markdown tbody tr:nth-child(even) {
background-color: var(--background-1);
color: var(--text-1);
}
:target {
animation: target-fade 10s ease-out;
}
@keyframes target-fade {
0% { background-color: var(--background-yellow-2); }
}
* {
@ -588,21 +845,65 @@ table.markdown {
/* Code blocks */
.highlight {
.code-block {
display: flex;
flex-direction: column;
margin: 16px 0;
background-color: var(--background-1);
border-radius: 8px;
}
.code-block > .code-header {
display: flex;
flex-direction: row;
justify-content: space-between;
background-color: var(--background-2);
padding: 4px 8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.code-block > .code-header > .code-type {
border-top-left-radius: 8px;
margin: auto 0;
}
/* TODO: make the code copy button prettier */
.code-block > .code-header > .code-copy-button {
color: var(--link-1);
}
.code-block > .code-header > .code-copy-button:hover {
cursor: pointer;
}
.code-block > .highlight {
margin: 8px 4px;
}
.highlight > pre {
padding: 12px 8px;
.highlight > .chroma {
overflow: auto;
}
.chroma {
/* the syntax highlight CSS adds a border */
background-color: transparent !important;
margin: 0;
}
.chroma .gp {
/* Generic Prompt symbol */
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
:not(pre) > code {
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;
}
.code-block > .code-header > .code-type,
code {
border-radius: 5px;
}
@ -613,6 +914,48 @@ 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;
@ -655,6 +998,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 {
@ -662,7 +1006,7 @@ h1 svg.icon {
}
:not(li.disabled) > .page-link:hover {
background-color: var(--background-highlight);
background-color: var(--background-3);
}
li.disabled {
@ -676,7 +1020,7 @@ li.disabled > .page-link:hover {
/* Breadcrumb navigation */
.breadcrumb {
.breadcrumb ul {
margin: 30px 0 20px;
}
@ -709,11 +1053,13 @@ li.disabled > .page-link:hover {
flex-direction: column;
color: inherit;
background-color: var(--background-1);
color: var(--text-1);
padding: 8px 16px;
}
.prevnext > a:hover {
background-color: var(--background-2);
color: var(--text-2);
text-decoration: none;
}
@ -745,11 +1091,6 @@ li.disabled > .page-link:hover {
/* Light mode */
@media print,
(prefers-color-scheme: light) {
/* Basic elements */
.section:hover {
color: inherit;
}
li.disabled {
opacity: .25;
}
@ -760,10 +1101,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

@ -1,14 +1,21 @@
/* tango style */
@media print, (prefers-color-scheme: light) {
.chroma {
color: black;
}
/* Background */ .bg { background-color: #f8f8f8 }
/* PreWrapper */ .chroma { background-color: #f8f8f8; }
/* Other */ .chroma .x { color: #000000 }
/* Error */ .chroma .err { color: #a40000 }
/* CodeLine */ .chroma .cl { }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* 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 }
/* KeywordDeclaration */ .chroma .kd { color: #204a87; font-weight: bold }
@ -83,6 +90,7 @@
/* GenericTraceback */ .chroma .gt { color: #a40000; font-weight: bold }
/* GenericUnderline */ .chroma .gl { color: #000000; text-decoration: underline }
/* TextWhitespace */ .chroma .w { color: #f8f8f8; text-decoration: underline }
}
@media (prefers-color-scheme: light) {

View File

@ -1,11 +1,16 @@
/* Background */ .chroma { color: #d0d0d0; background-color: #202020 }
/* native style */
/* 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 { }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #363636 }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* 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 }
/* KeywordDeclaration */ .chroma .kd { color: #6ab825; font-weight: bold }

View File

@ -1,8 +0,0 @@
const backToTop = document.getElementById("back-to-top");
window.onscroll = function() {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
backToTop.style.display = "block";
} else {
backToTop.style.display = "none";
}
}

35
assets/js/bobatheme.js Normal file
View File

@ -0,0 +1,35 @@
// back to top
const backToTop = document.getElementById("back-to-top");
window.onscroll = function() {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
backToTop.style.display = "block";
} else {
backToTop.style.display = "none";
}
}
// code block copy to clipboard
window.onload = () => {
document.querySelectorAll(".code-block").forEach(codeBlock => {
const button = codeBlock.querySelector(".code-header > .code-copy-button");
// lang will not be unset because we default it to text
// clone it so it doesn't change the actual DOM element
const codeElem = codeBlock.querySelector("code[data-lang]").cloneNode(true);
// bashsession: remove command output lines
codeElem.querySelectorAll(".go").forEach(e => e.parentNode.removeChild(e));
// bashsession: remove prompt symbol
codeElem.querySelectorAll(".gp").forEach(e => e.parentNode.removeChild(e));
const rawCode = codeElem.innerText;
const originalCopyText = button.innerHTML;
button.onclick = event => {
navigator.clipboard.writeText(rawCode);
// TODO: maybe we could add a fancier indicator, like a flash or something
event.target.innerHTML = "Copied!";
setTimeout(() => {
event.target.innerHTML = originalCopyText;
}, 3000);
}
});
}

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

@ -14,6 +14,9 @@ latest_posts:
see_also:
other: "SEE ALSO:"
copy_to_clipboard:
other: "Copy"
# Meta items
long_date:
@ -27,6 +30,9 @@ readingtime:
one: "{{ . }} min"
other: "{{ . }} mins"
edit_history:
other: "Edit history"
# Post count
no_posts:
@ -61,8 +67,8 @@ 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"
@ -91,8 +97,8 @@ aria_post_metadata:
aria_author_metadata:
other: "author metadata"
aria_category_metadata:
other: "category metadata"
aria_taxonomy_metadata:
other: "taxonomy metadata"
aria_post_meta_date:
other: "date"
@ -106,7 +112,7 @@ aria_author_post_count:
aria_author_word_count:
other: "word count"
aria_category_post_count:
aria_taxonomy_post_count:
other: "post count"
aria_series_metadata:

View File

@ -14,6 +14,9 @@ latest_posts:
see_also:
other: "Véase también:"
copy_to_clipboard:
other: "Copiar"
# Meta items
long_date:
@ -27,6 +30,9 @@ readingtime:
one: "{{ . }} min"
other: "{{ . }} mins"
edit_history:
other: "Historial de cambios"
# Post count
no_posts:
@ -61,8 +67,8 @@ 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"
@ -91,8 +97,8 @@ newer_post:
# aria_author_metadata:
# other: "author metadata"
# aria_category_metadata:
# other: "category metadata"
# aria_taxonomy_metadata:
# other: "taxonomy metadata"
# aria_post_meta_date:
# other: "date"
@ -106,7 +112,7 @@ newer_post:
# aria_author_word_count:
# other: "word count"
# aria_category_post_count:
# aria_taxonomy_post_count:
# other: "post count"
# aria_series_metadata:

View File

@ -0,0 +1,15 @@
{{ $type := "text" }}
{{ with .Type }}
{{ $type = . }}
{{ end }}
<div class="code-block">
<div class="code-header">
<pre class="code-type">{{ $type }}</pre>
<a href="javascript:void(0)" class="code-copy-button">
{{ i18n "copy_to_clipboard" }}
</a>
</div>
{{/* a div.highlight is already created by highlight function */}}
{{ highlight .Inner $type }}
</div>

View File

@ -21,7 +21,6 @@
</main>
{{ if or .Site.Copyright .Site.Params.footer }}
<hr>
<footer>
<small>
{{ with .Site.Copyright }}

View File

@ -5,6 +5,10 @@
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="list-page-content">
{{ with .Sections }}
<div class="sections">

View File

@ -24,13 +24,13 @@
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}
<div class="post-content">
<article class="post-content">
{{ .Content }}
</div>
</article>
{{ partial "series-box.html" . }}

View File

@ -1,23 +1,21 @@
<div class="post">
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/short.html" . }}
{{ partial "post-metadata/short.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
</div>
{{ end }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@ -1,26 +1,24 @@
<div class="post">
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/series.html" . }}
{{ partial "post-metadata/series.html" . }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="series-pages">
<ul>
{{ $i := 0 }}
{{ $total := len .Data.Pages }}
{{ range .Data.Pages.Reverse }}
{{ $i = add 1 $i }}
{{ .Scratch.Set "series_position" $i }}
{{ .Scratch.Set "series_total" $total }}
<li>{{ .Render "summary/series_post" }}</li>
{{ end }}
</ul>
</div>
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="series-page-list">
{{ $i := 0 }}
{{ $total := len .Data.Pages }}
{{ range .Data.Pages.Reverse }}
{{ $i = add 1 $i }}
{{ .Scratch.Set "series_position" $i }}
{{ .Scratch.Set "series_total" $total }}
<article class="post">
{{ .Render "summary/series_post" }}
</article>
{{ end }}
</div>

View File

@ -1,29 +1,27 @@
<div class="post">
<div class="post-series-position">
{{ if .Scratch.Get "series_position" }}
({{ .Scratch.Get "series_position" }}/{{ .Scratch.Get "series_total" }})
{{ end }}
</div>
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/short.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
</div>
<div class="post-series-position">
{{ if .Scratch.Get "series_position" }}
({{ .Scratch.Get "series_position" }}/{{ .Scratch.Get "series_total" }})
{{ end }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
</div>
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/short.html" . }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" .) }}
</div>
{{ end }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@ -4,13 +4,17 @@
{{ .Title | markdownify }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/author" }}</li>
{{ end }}
</ul>
{{ range . }}
<article class="post">
{{ .Render "summary/author" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}

View File

@ -1,9 +1,11 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
<div class="author-name">
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
</div>
{{ partial "post-metadata/author.html" . }}

View File

@ -1,28 +0,0 @@
{{ 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 }}

View File

@ -1,17 +0,0 @@
{{ 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 }}

View File

@ -1,8 +1,8 @@
{{ define "main" }}
{{ with .Content }}
<div class="homepage-content">
<article class="homepage-content">
{{ . }}
</div>
</article>
<hr>
{{ end }}

View File

@ -13,7 +13,7 @@
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ with resources.Get "js/back-to-top.js" | fingerprint "sha512" }}
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
@ -40,7 +40,7 @@
{{ partial "seo-tags/author.html" . }}
<meta name="language" content="{{ .Language.Lang }}">
<meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
<meta name="description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ partial "additional-head.html" . }}
</head>

View File

@ -1,10 +1,10 @@
<div class="page-list">
{{ with . }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ range . }}
<article class="post">
{{ .Render "summary/post" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}

View File

@ -1,5 +1,5 @@
{{ if gt .Paginator.TotalPages 1 }}
<div class="pagination">
<nav class="pagination">
{{ template "_internal/pagination.html" . }}
</div>
</nav>
{{ 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

@ -1,6 +0,0 @@
<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>

View File

@ -24,7 +24,7 @@
{{ 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>

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

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

@ -1,5 +1,5 @@
<meta property="og:title" content="{{ .Title | plainify }}">
<meta property="og:description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
<meta property="og:description" content="{{ (partial "seo-description.html" .) | plainify }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">

View File

@ -1,5 +1,5 @@
<meta itemprop="name" content="{{ .Title | plainify }}">
<meta itemprop="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
<meta itemprop="description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ $format := "2006-01-02T15:04:05-07:00" }}
{{ with .Date }}
@ -21,6 +21,10 @@
<meta itemprop="image" content="{{ $featured.Permalink }}">
{{ end }}
{{ with .Params.tags }}
<meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append .LinkTitle }}
{{ end }}
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
{{ end }}

View File

@ -22,7 +22,7 @@
{{ end }}
<meta name="twitter:title" content="{{ .Title | plainify }}">
<meta name="twitter:description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
<meta name="twitter:description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ with .Site.Social.twitter }}
<meta name="twitter:site" content="@{{ . }}">

View File

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

View File

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

View File

@ -4,13 +4,17 @@
{{ .Title | markdownify }}
</h1>
<div class="series-taxonomy">
{{ with .Content }}
{{ . }}
{{ end }}
<div class="series-taxonomy-list">
{{ with .Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/series" }}</li>
{{ end }}
</ul>
{{ range . }}
<article class="series-taxonomy">
{{ .Render "summary/series" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}

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,4 @@
{{ $resource := $.Page.Resources.GetMatch (.Get "src") }}
{{ $resource := .Page.Resources.GetMatch (.Get "src") }}
{{ $noborder := false }}
{{ if .Get "noborder" }}

View File

@ -0,0 +1 @@
<hr class="full-width-hr">

View File

@ -9,5 +9,5 @@
{{ end }}
<p>
{{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" "image" "alt" (.Get "alt")) }}
{{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" (.Get "type") "alt" (.Get "alt")) }}
</p>

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,13 +0,0 @@
{{ $border := false }}
{{ if .Get "border" }}
{{ $border = true }}
{{ end }}
{{ $hidecaption := false }}
{{ if .Get "hidecaption" }}
{{ $hidecaption = true }}
{{ end }}
<p>
{{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" "video" "alt" (.Get "alt")) }}
</p>

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,15 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "tag" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -1,18 +1,37 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "filter" }}
{{ .Title | markdownify }}
</h1>
<div class="post-title">
<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 }}
<div class="taxonomy">
{{ .Title | markdownify }}
</h1>
</div>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="taxonomy-list">
{{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }}
<li>
<a href="{{ .Page.Permalink }}">{{ .Page.Title | markdownify }}</a>
</li>
{{ range . }}
{{ with .Page }}
<article class="taxonomy-term">
<div class="taxonomy-list-left">
<a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p>
</a>
{{ partial "post-metadata/taxonomy.html" . }}
</div>
{{ partial "description-or-summary.html" . }}
</article>
{{ end }}
</ul>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}

View File

@ -1,9 +1,20 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "filter" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
<div class="post-title">
<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 }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
</div>
{{ partial "post-metadata/taxonomy.html" . }}
{{ with .Content }}
{{ . }}

View File

@ -8,7 +8,7 @@ description = "Simple Hugo theme for boba.best and bbaovanc.com"
homepage = "https://bbaovanc.com"
tags = []
features = []
min_version = "0.80.0"
min_version = "0.93.0"
[author]
name = "bbaovanc"