31 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
48 changed files with 506 additions and 237 deletions

View File

@ -1,4 +1,6 @@
/* bobatheme is available under the MIT license at /* vim: foldmethod=marker
*
* bobatheme is available under the MIT license at
* https://github.com/BBaoVanC/bobatheme. * https://github.com/BBaoVanC/bobatheme.
*/ */
@ -46,6 +48,7 @@
--text-gray-1: #919191; /* lch(60, 0, X) */ --text-gray-1: #919191; /* lch(60, 0, X) */
--link-0: #3a94fb; /* lch(60, 60, 270) */ --link-0: #3a94fb; /* lch(60, 60, 270) */
--link-1: #4ea1ff; /* lch(65, 60, 270) -- out of sRGB */
--figure-border: #1f5593; /* lch(35, 40, 270) */ --figure-border: #1f5593; /* lch(35, 40, 270) */
@ -116,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) */ /* Post layout (in list pages) */
.list-page-content { .list-page-content {
display: flex; display: flex;
@ -123,8 +286,8 @@
gap: 40px; gap: 40px;
} }
.page-list ul, .page-list,
.series-taxonomy ul { .series-taxonomy-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
list-style: none; list-style: none;
@ -132,12 +295,13 @@
gap: 40px; gap: 40px;
} }
.series-taxonomy ul { .series-taxonomy-list {
gap: 80px; gap: 80px;
} }
.page-list li, .page-list .post,
.series-taxonomy li { .series-taxonomy-list .series-taxonomy,
.series-taxonomy .post {
padding-top: 8px; padding-top: 8px;
padding-left: 24px; padding-left: 24px;
padding-right: 24px; padding-right: 24px;
@ -158,6 +322,11 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
.post-title h1,
.author-name h1 {
margin: 0;
}
.post-title a, .post-title a,
.author-name a { .author-name a {
color: inherit; color: inherit;
@ -172,7 +341,7 @@
.post-metadata, .post-metadata,
.author-metadata { .author-metadata {
margin-bottom: 15px; margin-bottom: 24px;
} }
.categories, .categories,
@ -206,7 +375,7 @@
margin: 0; margin: 0;
} }
.taxonomy-list ul { .taxonomy-list {
list-style: none; list-style: none;
padding: 0; padding: 0;
display: flex; display: flex;
@ -214,7 +383,7 @@
gap: 10px; gap: 10px;
} }
.taxonomy-list li { .taxonomy-list .taxonomy-term {
background-color: var(--background-1); background-color: var(--background-1);
color: var(--text-1); color: var(--text-1);
padding: 8px 12px; padding: 8px 12px;
@ -230,7 +399,7 @@
} }
@media (max-width: 480px) { @media (max-width: 480px) {
.taxonomy-list li { .taxonomy-list .taxonomy-term {
flex-direction: column; flex-direction: column;
gap: 4px; gap: 4px;
} }
@ -244,7 +413,7 @@
/* Series list format */ /* Series list format */
.series-pages ul { .series-page-list {
display: flex; display: flex;
gap: 10px; gap: 10px;
flex-flow: row wrap; flex-flow: row wrap;
@ -255,7 +424,7 @@
border-radius: 16px; border-radius: 16px;
} }
.series-pages li { .series-page-list .post {
flex: 1; flex: 1;
min-width: 49%; min-width: 49%;
} }
@ -266,7 +435,7 @@
.sections { .sections {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 40px; gap: 10px;
} }
.section { .section {
@ -304,13 +473,15 @@
/* Header formatting (website title and article section headers) */ /* Header formatting (website title and article section headers) */
h1.header { .header {
font-size: 1.5em; margin: 16px 0;
} }
.header a, .header a,
.section-header a { .section-header a {
color: inherit; color: inherit;
font-size: 1.5em;
font-weight: bold;
} }
.section-header-link svg { .section-header-link svg {
@ -347,6 +518,7 @@ h1.header {
} }
/* Related posts */ /* Related posts */
.full-width-page-list { .full-width-page-list {
/* make left/right 0 margin so it takes up full width */ /* make left/right 0 margin so it takes up full width */
@ -359,16 +531,16 @@ h1.header {
margin-right: 20px; margin-right: 20px;
} }
.full-width-page-list li { .full-width-page-list .post {
min-width: 300px; min-width: 300px;
max-width: 300px; max-width: 300px;
} }
.full-width-page-list li:first-child { .full-width-page-list .post:first-child {
margin-left: 20px; margin-left: 20px;
} }
.full-width-page-list li:last-child { .full-width-page-list .post:last-child {
margin-right: 20px; margin-right: 20px;
} }
@ -393,7 +565,7 @@ h1.header {
} }
} }
.full-width-page-list .page-list ul { .full-width-page-list .page-list {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 20px; gap: 20px;
@ -401,6 +573,7 @@ h1.header {
} }
/* Social media share buttons */ /* Social media share buttons */
.share-buttons { .share-buttons {
background: var(--background-1); background: var(--background-1);
@ -413,16 +586,15 @@ h1.header {
justify-content: center; justify-content: center;
} }
.share-buttons button,
.share-buttons a { .share-buttons a {
background-color: var(--background-2); background-color: var(--background-2);
color: var(--text-2); color: var(--text-2);
padding: 4px; padding: 4px;
border-radius: 8px; border-radius: 8px;
} }
.share-buttons a:hover {
.share-buttons button { background-color: var(--background-3);
border: none; color: var(--text-3);
} }
.share-buttons svg { .share-buttons svg {
@ -439,6 +611,7 @@ h1.header {
*/ */
/* See also formating */ /* See also formating */
.see-also { .see-also {
background-color: var(--background-1); background-color: var(--background-1);
@ -453,6 +626,7 @@ h1.header {
} }
/* Back to top */ /* Back to top */
#back-to-top { #back-to-top {
position: fixed; position: fixed;
@ -558,7 +732,6 @@ html {
body { body {
background-color: var(--background-0); background-color: var(--background-0);
color: var(--text-0); color: var(--text-0);
font-family: "Open Sans", "Noto Sans", sans-serif;
margin: 20px; margin: 20px;
max-width: 720px; max-width: 720px;
overflow-wrap: break-word; overflow-wrap: break-word;
@ -571,6 +744,7 @@ body {
} }
footer { footer {
margin-top: 20px;
text-align: center; text-align: center;
} }
@ -618,12 +792,21 @@ a:hover {
blockquote { blockquote {
border-left: 5px solid var(--background-2); border-left: 5px solid var(--background-2);
padding-left: 15px; padding-left: 15px;
margin-left: 0;
} }
hr { hr {
border: 1px solid var(--background-3); 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 { table.markdown {
border-collapse: collapse; border-collapse: collapse;
border: 2px solid var(--text-1); border: 2px solid var(--text-1);
@ -648,6 +831,13 @@ table.markdown {
color: var(--text-1); color: var(--text-1);
} }
:target {
animation: target-fade 10s ease-out;
}
@keyframes target-fade {
0% { background-color: var(--background-yellow-2); }
}
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -655,14 +845,53 @@ table.markdown {
/* Code blocks */ /* Code blocks */
.highlight { .code-block {
display: flex;
flex-direction: column;
margin: 16px 0; 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 { .highlight > .chroma {
padding: 12px 8px;
overflow: auto; 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 { :not(pre) > code {
background-color: var(--background-2); background-color: var(--background-2);
@ -674,6 +903,7 @@ table.markdown {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.code-block > .code-header > .code-type,
code { code {
border-radius: 5px; border-radius: 5px;
} }
@ -790,46 +1020,21 @@ li.disabled > .page-link:hover {
/* Breadcrumb navigation */ /* Breadcrumb navigation */
.breadcrumb { .breadcrumb ul {
margin: 16px 0; margin: 30px 0 20px;
} }
.breadcrumb ul { .breadcrumb ul {
padding: 0; padding: 0;
list-style: none; list-style: none;
display: flex;
justify-content: space-between;
flex-grow: 1;
} }
.breadcrumb li { .breadcrumb li {
display: inline; display: inline;
padding: 8px;
background-color: var(--background-1);
} }
.breadcrumb li:hover { .breadcrumb li+li:before {
background-color: var(--background-2); content: "»"
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;
} }

View File

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

@ -14,6 +14,9 @@ latest_posts:
see_also: see_also:
other: "SEE ALSO:" other: "SEE ALSO:"
copy_to_clipboard:
other: "Copy"
# Meta items # Meta items
long_date: long_date:

View File

@ -14,6 +14,9 @@ latest_posts:
see_also: see_also:
other: "Véase también:" other: "Véase también:"
copy_to_clipboard:
other: "Copiar"
# Meta items # Meta items
long_date: long_date:

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> </main>
{{ if or .Site.Copyright .Site.Params.footer }} {{ if or .Site.Copyright .Site.Params.footer }}
<hr>
<footer> <footer>
<small> <small>
{{ with .Site.Copyright }} {{ with .Site.Copyright }}

View File

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

View File

@ -28,9 +28,9 @@
</div> </div>
{{ end }} {{ end }}
<div class="post-content"> <article class="post-content">
{{ .Content }} {{ .Content }}
</div> </article>
{{ partial "series-box.html" . }} {{ partial "series-box.html" . }}

View File

@ -1,4 +1,3 @@
<div class="post">
<h2 class="post-title"> <h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
@ -20,4 +19,3 @@
<div class="readmore"> <div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a> <a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div> </div>
</div>

View File

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

View File

@ -1,4 +1,3 @@
<div class="post">
<div class="post-series-position"> <div class="post-series-position">
{{ if .Scratch.Get "series_position" }} {{ if .Scratch.Get "series_position" }}
({{ .Scratch.Get "series_position" }}/{{ .Scratch.Get "series_total" }}) ({{ .Scratch.Get "series_position" }}/{{ .Scratch.Get "series_total" }})
@ -26,4 +25,3 @@
<div class="readmore"> <div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a> <a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div> </div>
</div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<meta property="og:title" content="{{ .Title | plainify }}"> <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:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:url" content="{{ .Permalink }}"> <meta property="og:url" content="{{ .Permalink }}">

View File

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

View File

@ -22,7 +22,7 @@
{{ end }} {{ end }}
<meta name="twitter:title" content="{{ .Title | plainify }}"> <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 }} {{ with .Site.Social.twitter }}
<meta name="twitter:site" content="@{{ . }}"> <meta name="twitter:site" content="@{{ . }}">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,5 +9,5 @@
{{ end }} {{ end }}
<p> <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> </p>

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,4 +1,5 @@
{{ define "main" }} {{ define "main" }}
<div class="post-title">
<h1> <h1>
{{ if eq .Data.Singular "tag" }} {{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }} {{ partial "icon.html" "tag" }}
@ -10,13 +11,17 @@
{{ .Title | markdownify }} {{ .Title | markdownify }}
</h1> </h1>
</div>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="taxonomy-list"> <div class="taxonomy-list">
{{ with .Data.Terms.Alphabetical }} {{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }} {{ range . }}
{{ with .Page }} {{ with .Page }}
<li> <article class="taxonomy-term">
<div class="taxonomy-list-left"> <div class="taxonomy-list-left">
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p> <p>{{ .Title | markdownify }}</p>
@ -24,10 +29,9 @@
{{ partial "post-metadata/taxonomy.html" . }} {{ partial "post-metadata/taxonomy.html" . }}
</div> </div>
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
</li> </article>
{{ end }} {{ end }}
{{ end }} {{ end }}
</ul>
{{ else }} {{ else }}
<div> <div>
{{ i18n "no_posts" }} {{ i18n "no_posts" }}

View File

@ -1,4 +1,5 @@
{{ define "main" }} {{ define "main" }}
<div class="post-title">
<h1> <h1>
{{ if eq .Data.Singular "tag" }} {{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }} {{ partial "icon.html" "tag" }}
@ -11,6 +12,7 @@
{{ .Title | markdownify }} {{ .Title | markdownify }}
{{ partial "rss-link.html" . }} {{ partial "rss-link.html" . }}
</h1> </h1>
</div>
{{ partial "post-metadata/taxonomy.html" . }} {{ partial "post-metadata/taxonomy.html" . }}

View File

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