Author SHA1 Message Date
bbaovanc 31731c9996 js: Fix copy to clipboard button stuck as "Copied" when clicked twice 2026-09-18 14:31:23 -05:00
bbaovanc b67e3f4671 js: Define function for copy to clipboard and provide it in onClick
Instead of looping through all the code blocks at onload, just put an
onClick tag in the HTML template, which calls a global function.

This also improves the semantics since we aren't abusing href to be
javascript.

Also improves the writeText function call, since that method actually
returns a Promise which we should be waiting on. It technically worked
before because Promise starts executing instantly in JS, without being
awaited.
2026-09-18 14:21:47 -05:00
bbaovanc a2a8e2c205 css: Use structured class names for children of code-block 2026-01-31 01:58:42 -06:00
bbaovanc ee1ba12df5 Rename icon_code partial to icon_impl
Fixes #126
2025-12-24 01:42:45 -06:00
bbaovanc d6c8dd65de Rename .section to .section-card
To keep the classes more organized, by having better scoping of classes.

Fixes #121
2025-12-24 01:29:37 -06:00
bbaovanc f7dadb821c Fix hiding of navbar on print
Regression introduced in c2b10a6c99 where
the navbar is no longer hidden when printing. I did not make sure to
grep for all usages of the top bar classes after changing them.

Updates #109
2025-12-24 01:20:07 -06:00
bbaovanc b150aad217 Update chromastyles with Hugo 0.153.2
Since Arch's isn't updated yet, I downloaded the hugo extended
executable from the releases.

hugo v0.153.2-798533a2013eab97198b0a155a8f4afab7e79865+extended linux/amd64 BuildDate=2025-12-22T16:53:01Z VendorInfo=gohugoio
2025-12-24 01:05:45 -06:00
bbaovanc 3a17e0037a Update chromastyles with Hugo 0.152.2 2025-12-24 01:02:47 -06:00
bbaovanc 7368e82cf8 Remove raw markdown output
I don't think it's ever been that useful. It was originally implemented
as kind of a test of what Hugo output formats were capable of. It waited
for the `ugly` option to get added in `outputFormats` and the novelty of
a new Hugo feature was part of the fun of it.

As mentioned in 7a65f92f53:

    I believe I originally added it because I thought it was somewhat
    hard to get from the "View history" commit list to the actual page
    but I feel like people who care enough to go looking for the source
    code will be willing to use GitHub to find the actual source file.
2025-10-09 01:35:38 -05:00
bbaovanc 7a65f92f53 robots.txt: Remove Bingbot exception for *.md files
Bing wins this one. It seems like their crawler is too stupid. I might
just remove the raw markdown output anyways as it doesn't really serve
much purpose. You can go to GitHub and see the raw files if you really
want.

I believe I originally added it because I thought it was somewhat hard
to get from the "View history" commit list to the actual page but I feel
like people who care enough to go looking for the source code will be
willing to use GitHub to find the actual source file.
2025-10-09 01:24:05 -05:00
bbaovanc bb6346bbad Change related posts heading from h1 to h2
This was caught by a Bing Webmaster check:
"There are multiple <h1> tags on the page."
2025-09-08 19:52:01 -05:00
bbaovanc f091b366be Attempt to fix robots.txt blocking /blog/*.md for all bots
According to Semrush, 741b3bc01b added a
block for /blog/*.md for User-Agent: *, even though everything I can
read says that it shouldn't apply since the blocks are separated.

I tried reordering the rules and explicitly adding an `Allow: /` rule,
both to match what's shown on Google Search documentation[1].

[1]: https://developers.google.com/search/docs/crawling-indexing/robots/create-robots-txt,
and
2025-09-08 19:27:12 -05:00
bbaovanc 94bfef19a1 Merge branch 'page-list-and-summary-css-cleanup' 2025-09-01 02:51:40 -05:00
17 changed files with 217 additions and 262 deletions
+17 -17
View File
@@ -618,7 +618,7 @@ figcaption {
gap: 10px; gap: 10px;
} }
.section { .section-card {
background-color: var(--background-1); background-color: var(--background-1);
color: var(--text-1); color: var(--text-1);
border-radius: 12px; border-radius: 12px;
@@ -628,33 +628,33 @@ figcaption {
justify-content: space-between; justify-content: space-between;
} }
.section:hover { .section-card:hover {
background-color: var(--background-2); background-color: var(--background-2);
color: var(--text-2); color: var(--text-2);
} }
.section-title { .section-card-title {
margin: 10px 0; margin: 10px 0;
} }
.section-anchor { .section-card-anchor {
color: inherit; color: inherit;
} }
.section-anchor:hover { .section-card-anchor:hover {
text-decoration: none; text-decoration: none;
} }
.section-description { .section-card-description {
margin-bottom: 5px; margin-bottom: 5px;
} }
.section-arrow { .section-card-arrow {
margin-block: auto; margin-block: auto;
max-height: fit-content; max-height: fit-content;
float: right; float: right;
} }
.section-arrow > .icon { .section-card-arrow > .icon {
height: 48px; height: 48px;
width: 48px; width: 48px;
} }
@@ -784,7 +784,7 @@ figcaption {
*/ */
.related-posts > hr, .related-posts > hr,
.related-posts > h1 { .related-posts > h2 {
margin: var(--page-margin); margin: var(--page-margin);
} }
@@ -823,7 +823,7 @@ figcaption {
background-color: var(--background-1); background-color: var(--background-1);
border-radius: 8px; border-radius: 8px;
} }
.code-block > .code-header { .code-block-header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
@@ -833,17 +833,17 @@ figcaption {
border-top-right-radius: 8px; border-top-right-radius: 8px;
height: 2em; height: 2em;
} }
.code-block > .code-header > * { .code-block-header > * {
margin: auto 0; margin: auto 0;
} }
.code-block > .code-header > .code-type { .code-block-type {
border-top-left-radius: 8px; border-top-left-radius: 8px;
} }
/* TODO: make the code copy button prettier */ /* TODO: make the code copy button prettier */
.code-block > .code-header > .code-copy-button { .code-block-copy-button {
color: var(--link-1); color: var(--link-1);
} }
.code-block > .code-header > .code-copy-button:hover { .code-block-copy-button:hover {
cursor: pointer; cursor: pointer;
} }
.code-block > .highlight { .code-block > .highlight {
@@ -877,7 +877,7 @@ figcaption {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.code-block > .code-header > .code-type, .code-block-type,
code { code {
border-radius: 5px; border-radius: 5px;
} }
@@ -960,7 +960,7 @@ aside.quote {
/* Print compatibility {{{ */ /* Print compatibility {{{ */
@media print { @media print {
.top > .navbar, .top-navbar,
.content-heading-link, .content-heading-link,
.post-meta-edit-history, .post-meta-edit-history,
.post-meta-view-markdown, .post-meta-view-markdown,
@@ -979,7 +979,7 @@ aside.quote {
.top { .top {
background-color: unset; background-color: unset;
} }
.top > .header { .top-brand {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
} }
+87 -88
View File
@@ -1,96 +1,95 @@
/* 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; } /* Generated using: hugo gen chromastyles --style tango */
/* PreWrapper */ .chroma { background-color: #f8f8f8; }
/* Other */ .chroma .x { color: #000000 } /* Background */ .bg { background-color:#f8f8f8; }
/* Error */ .chroma .err { color: #a40000 } /* PreWrapper */ .chroma { background-color:#f8f8f8; }
/* CodeLine */ .chroma .cl { } /* Other */ .chroma .x { color:#000 }
/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit } /* Error */ .chroma .err { color:#a40000 }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } /* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } /* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; }
/* LineHighlight */ .chroma .hl { background-color: #dfdfdf } /* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; }
/* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } /* LineHighlight */ .chroma .hl { background-color:#dfdfdf }
/* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } /* LineNumbersTable */ .chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f }
/* Line */ .chroma .line { display: flex; } /* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f }
/* Keyword */ .chroma .k { color: #204a87; font-weight: bold } /* Line */ .chroma .line { display:flex; }
/* KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold } /* Keyword */ .chroma .k { color:#204a87;font-weight:bold }
/* KeywordDeclaration */ .chroma .kd { color: #204a87; font-weight: bold } /* KeywordConstant */ .chroma .kc { color:#204a87;font-weight:bold }
/* KeywordNamespace */ .chroma .kn { color: #204a87; font-weight: bold } /* KeywordDeclaration */ .chroma .kd { color:#204a87;font-weight:bold }
/* KeywordPseudo */ .chroma .kp { color: #204a87; font-weight: bold } /* KeywordNamespace */ .chroma .kn { color:#204a87;font-weight:bold }
/* KeywordReserved */ .chroma .kr { color: #204a87; font-weight: bold } /* KeywordPseudo */ .chroma .kp { color:#204a87;font-weight:bold }
/* KeywordType */ .chroma .kt { color: #204a87; font-weight: bold } /* KeywordReserved */ .chroma .kr { color:#204a87;font-weight:bold }
/* Name */ .chroma .n { color: #000000 } /* KeywordType */ .chroma .kt { color:#204a87;font-weight:bold }
/* NameAttribute */ .chroma .na { color: #c4a000 } /* Name */ .chroma .n { color:#000 }
/* NameBuiltin */ .chroma .nb { color: #204a87 } /* NameAttribute */ .chroma .na { color:#c4a000 }
/* NameBuiltinPseudo */ .chroma .bp { color: #3465a4 } /* NameClass */ .chroma .nc { color:#000 }
/* NameClass */ .chroma .nc { color: #000000 } /* NameConstant */ .chroma .no { color:#000 }
/* NameConstant */ .chroma .no { color: #000000 } /* NameDecorator */ .chroma .nd { color:#5c35cc;font-weight:bold }
/* NameDecorator */ .chroma .nd { color: #5c35cc; font-weight: bold } /* NameEntity */ .chroma .ni { color:#ce5c00 }
/* NameEntity */ .chroma .ni { color: #ce5c00 } /* NameException */ .chroma .ne { color:#c00;font-weight:bold }
/* NameException */ .chroma .ne { color: #cc0000; font-weight: bold } /* NameLabel */ .chroma .nl { color:#f57900 }
/* NameFunction */ .chroma .nf { color: #000000 } /* NameNamespace */ .chroma .nn { color:#000 }
/* NameFunctionMagic */ .chroma .fm { color: #000000 } /* NameOther */ .chroma .nx { color:#000 }
/* NameLabel */ .chroma .nl { color: #f57900 } /* NameProperty */ .chroma .py { color:#000 }
/* NameNamespace */ .chroma .nn { color: #000000 } /* NameTag */ .chroma .nt { color:#204a87;font-weight:bold }
/* NameOther */ .chroma .nx { color: #000000 } /* NameBuiltin */ .chroma .nb { color:#204a87 }
/* NameProperty */ .chroma .py { color: #000000 } /* NameBuiltinPseudo */ .chroma .bp { color:#3465a4 }
/* NameTag */ .chroma .nt { color: #204a87; font-weight: bold } /* NameVariable */ .chroma .nv { color:#000 }
/* NameVariable */ .chroma .nv { color: #000000 } /* NameVariableClass */ .chroma .vc { color:#000 }
/* NameVariableClass */ .chroma .vc { color: #000000 } /* NameVariableGlobal */ .chroma .vg { color:#000 }
/* NameVariableGlobal */ .chroma .vg { color: #000000 } /* NameVariableInstance */ .chroma .vi { color:#000 }
/* NameVariableInstance */ .chroma .vi { color: #000000 } /* NameVariableMagic */ .chroma .vm { color:#000 }
/* NameVariableMagic */ .chroma .vm { color: #000000 } /* NameFunction */ .chroma .nf { color:#000 }
/* Literal */ .chroma .l { color: #000000 } /* NameFunctionMagic */ .chroma .fm { color:#000 }
/* LiteralDate */ .chroma .ld { color: #000000 } /* Literal */ .chroma .l { color:#000 }
/* LiteralString */ .chroma .s { color: #4e9a06 } /* LiteralDate */ .chroma .ld { color:#000 }
/* LiteralStringAffix */ .chroma .sa { color: #4e9a06 } /* LiteralString */ .chroma .s { color:#4e9a06 }
/* LiteralStringBacktick */ .chroma .sb { color: #4e9a06 } /* LiteralStringAffix */ .chroma .sa { color:#4e9a06 }
/* LiteralStringChar */ .chroma .sc { color: #4e9a06 } /* LiteralStringBacktick */ .chroma .sb { color:#4e9a06 }
/* LiteralStringDelimiter */ .chroma .dl { color: #4e9a06 } /* LiteralStringChar */ .chroma .sc { color:#4e9a06 }
/* LiteralStringDoc */ .chroma .sd { color: #8f5902; font-style: italic } /* LiteralStringDelimiter */ .chroma .dl { color:#4e9a06 }
/* LiteralStringDouble */ .chroma .s2 { color: #4e9a06 } /* LiteralStringDoc */ .chroma .sd { color:#8f5902;font-style:italic }
/* LiteralStringEscape */ .chroma .se { color: #4e9a06 } /* LiteralStringDouble */ .chroma .s2 { color:#4e9a06 }
/* LiteralStringHeredoc */ .chroma .sh { color: #4e9a06 } /* LiteralStringEscape */ .chroma .se { color:#4e9a06 }
/* LiteralStringInterpol */ .chroma .si { color: #4e9a06 } /* LiteralStringHeredoc */ .chroma .sh { color:#4e9a06 }
/* LiteralStringOther */ .chroma .sx { color: #4e9a06 } /* LiteralStringInterpol */ .chroma .si { color:#4e9a06 }
/* LiteralStringRegex */ .chroma .sr { color: #4e9a06 } /* LiteralStringOther */ .chroma .sx { color:#4e9a06 }
/* LiteralStringSingle */ .chroma .s1 { color: #4e9a06 } /* LiteralStringRegex */ .chroma .sr { color:#4e9a06 }
/* LiteralStringSymbol */ .chroma .ss { color: #4e9a06 } /* LiteralStringSingle */ .chroma .s1 { color:#4e9a06 }
/* LiteralNumber */ .chroma .m { color: #0000cf; font-weight: bold } /* LiteralStringSymbol */ .chroma .ss { color:#4e9a06 }
/* LiteralNumberBin */ .chroma .mb { color: #0000cf; font-weight: bold } /* LiteralNumber */ .chroma .m { color:#0000cf;font-weight:bold }
/* LiteralNumberFloat */ .chroma .mf { color: #0000cf; font-weight: bold } /* LiteralNumberBin */ .chroma .mb { color:#0000cf;font-weight:bold }
/* LiteralNumberHex */ .chroma .mh { color: #0000cf; font-weight: bold } /* LiteralNumberFloat */ .chroma .mf { color:#0000cf;font-weight:bold }
/* LiteralNumberInteger */ .chroma .mi { color: #0000cf; font-weight: bold } /* LiteralNumberHex */ .chroma .mh { color:#0000cf;font-weight:bold }
/* LiteralNumberIntegerLong */ .chroma .il { color: #0000cf; font-weight: bold } /* LiteralNumberInteger */ .chroma .mi { color:#0000cf;font-weight:bold }
/* LiteralNumberOct */ .chroma .mo { color: #0000cf; font-weight: bold } /* LiteralNumberIntegerLong */ .chroma .il { color:#0000cf;font-weight:bold }
/* Operator */ .chroma .o { color: #ce5c00; font-weight: bold } /* LiteralNumberOct */ .chroma .mo { color:#0000cf;font-weight:bold }
/* OperatorWord */ .chroma .ow { color: #204a87; font-weight: bold } /* Operator */ .chroma .o { color:#ce5c00;font-weight:bold }
/* Punctuation */ .chroma .p { color: #000000; font-weight: bold } /* OperatorWord */ .chroma .ow { color:#204a87;font-weight:bold }
/* Comment */ .chroma .c { color: #8f5902; font-style: italic } /* Punctuation */ .chroma .p { color:#000;font-weight:bold }
/* CommentHashbang */ .chroma .ch { color: #8f5902; font-style: italic } /* Comment */ .chroma .c { color:#8f5902;font-style:italic }
/* CommentMultiline */ .chroma .cm { color: #8f5902; font-style: italic } /* CommentHashbang */ .chroma .ch { color:#8f5902;font-style:italic }
/* CommentSingle */ .chroma .c1 { color: #8f5902; font-style: italic } /* CommentMultiline */ .chroma .cm { color:#8f5902;font-style:italic }
/* CommentSpecial */ .chroma .cs { color: #8f5902; font-style: italic } /* CommentSingle */ .chroma .c1 { color:#8f5902;font-style:italic }
/* CommentPreproc */ .chroma .cp { color: #8f5902; font-style: italic } /* CommentSpecial */ .chroma .cs { color:#8f5902;font-style:italic }
/* CommentPreprocFile */ .chroma .cpf { color: #8f5902; font-style: italic } /* CommentPreproc */ .chroma .cp { color:#8f5902;font-style:italic }
/* Generic */ .chroma .g { color: #000000 } /* CommentPreprocFile */ .chroma .cpf { color:#8f5902;font-style:italic }
/* GenericDeleted */ .chroma .gd { color: #a40000 } /* Generic */ .chroma .g { color:#000 }
/* GenericEmph */ .chroma .ge { color: #000000; font-style: italic } /* GenericDeleted */ .chroma .gd { color:#a40000 }
/* GenericError */ .chroma .gr { color: #ef2929 } /* GenericEmph */ .chroma .ge { color:#000;font-style:italic }
/* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold } /* GenericError */ .chroma .gr { color:#ef2929 }
/* GenericInserted */ .chroma .gi { color: #00a000 } /* GenericHeading */ .chroma .gh { color:#000080;font-weight:bold }
/* GenericOutput */ .chroma .go { color: #000000; font-style: italic } /* GenericInserted */ .chroma .gi { color:#00a000 }
/* GenericPrompt */ .chroma .gp { color: #8f5902 } /* GenericOutput */ .chroma .go { color:#000;font-style:italic }
/* GenericStrong */ .chroma .gs { color: #000000; font-weight: bold } /* GenericPrompt */ .chroma .gp { color:#8f5902 }
/* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold } /* GenericStrong */ .chroma .gs { color:#000;font-weight:bold }
/* GenericTraceback */ .chroma .gt { color: #a40000; font-weight: bold } /* GenericSubheading */ .chroma .gu { color:#800080;font-weight:bold }
/* GenericUnderline */ .chroma .gl { color: #000000; text-decoration: underline } /* GenericTraceback */ .chroma .gt { color:#a40000;font-weight:bold }
/* TextWhitespace */ .chroma .w { color: #f8f8f8; text-decoration: underline } /* GenericUnderline */ .chroma .gl { color:#000;text-decoration:underline }
/* TextWhitespace */ .chroma .w { color:#f8f8f8 }
} }
+75 -87
View File
@@ -1,88 +1,76 @@
/* native style */ /* Generated using: hugo gen chromastyles --style native */
/* Background */ .bg { color: #d0d0d0; background-color: #202020; } /* Background */ .bg { color:#d0d0d0;background-color:#202020; }
/* PreWrapper */ .chroma { color: #d0d0d0; background-color: #202020; } /* PreWrapper */ .chroma { color:#d0d0d0;background-color:#202020; }
/* Other */ .chroma .x { } /* Error */ .chroma .err { color:#a61717;background-color:#e3d2d2 }
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 } /* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit }
/* CodeLine */ .chroma .cl { } /* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; }
/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit } /* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } /* LineHighlight */ .chroma .hl { background-color:#363636 }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } /* LineNumbersTable */ .chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#686868 }
/* LineHighlight */ .chroma .hl { background-color: #363636 } /* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#686868 }
/* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 } /* Line */ .chroma .line { display:flex; }
/* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #686868 } /* Keyword */ .chroma .k { color:#6ab825;font-weight:bold }
/* Line */ .chroma .line { display: flex; } /* KeywordConstant */ .chroma .kc { color:#6ab825;font-weight:bold }
/* Keyword */ .chroma .k { color: #6ab825; font-weight: bold } /* KeywordDeclaration */ .chroma .kd { color:#6ab825;font-weight:bold }
/* KeywordConstant */ .chroma .kc { color: #6ab825; font-weight: bold } /* KeywordNamespace */ .chroma .kn { color:#6ab825;font-weight:bold }
/* KeywordDeclaration */ .chroma .kd { color: #6ab825; font-weight: bold } /* KeywordPseudo */ .chroma .kp { color:#6ab825 }
/* KeywordNamespace */ .chroma .kn { color: #6ab825; font-weight: bold } /* KeywordReserved */ .chroma .kr { color:#6ab825;font-weight:bold }
/* KeywordPseudo */ .chroma .kp { color: #6ab825 } /* KeywordType */ .chroma .kt { color:#6ab825;font-weight:bold }
/* KeywordReserved */ .chroma .kr { color: #6ab825; font-weight: bold } /* NameAttribute */ .chroma .na { color:#bbb }
/* KeywordType */ .chroma .kt { color: #6ab825; font-weight: bold } /* NameClass */ .chroma .nc { color:#447fcf;text-decoration:underline }
/* Name */ .chroma .n { } /* NameConstant */ .chroma .no { color:#40ffff }
/* NameAttribute */ .chroma .na { color: #bbbbbb } /* NameDecorator */ .chroma .nd { color:#ffa500 }
/* NameBuiltin */ .chroma .nb { color: #24909d } /* NameException */ .chroma .ne { color:#bbb }
/* NameBuiltinPseudo */ .chroma .bp { } /* NameNamespace */ .chroma .nn { color:#447fcf;text-decoration:underline }
/* NameClass */ .chroma .nc { color: #447fcf; text-decoration: underline } /* NameTag */ .chroma .nt { color:#6ab825;font-weight:bold }
/* NameConstant */ .chroma .no { color: #40ffff } /* NameBuiltin */ .chroma .nb { color:#24909d }
/* NameDecorator */ .chroma .nd { color: #ffa500 } /* NameBuiltinPseudo */ .chroma .bp { color:#24909d }
/* NameEntity */ .chroma .ni { } /* NameVariable */ .chroma .nv { color:#40ffff }
/* NameException */ .chroma .ne { color: #bbbbbb } /* NameVariableClass */ .chroma .vc { color:#40ffff }
/* NameFunction */ .chroma .nf { color: #447fcf } /* NameVariableGlobal */ .chroma .vg { color:#40ffff }
/* NameFunctionMagic */ .chroma .fm { } /* NameVariableInstance */ .chroma .vi { color:#40ffff }
/* NameLabel */ .chroma .nl { } /* NameVariableMagic */ .chroma .vm { color:#40ffff }
/* NameNamespace */ .chroma .nn { color: #447fcf; text-decoration: underline } /* NameFunction */ .chroma .nf { color:#447fcf }
/* NameOther */ .chroma .nx { } /* NameFunctionMagic */ .chroma .fm { color:#447fcf }
/* NameProperty */ .chroma .py { } /* LiteralString */ .chroma .s { color:#ed9d13 }
/* NameTag */ .chroma .nt { color: #6ab825; font-weight: bold } /* LiteralStringAffix */ .chroma .sa { color:#ed9d13 }
/* NameVariable */ .chroma .nv { color: #40ffff } /* LiteralStringBacktick */ .chroma .sb { color:#ed9d13 }
/* NameVariableClass */ .chroma .vc { } /* LiteralStringChar */ .chroma .sc { color:#ed9d13 }
/* NameVariableGlobal */ .chroma .vg { } /* LiteralStringDelimiter */ .chroma .dl { color:#ed9d13 }
/* NameVariableInstance */ .chroma .vi { } /* LiteralStringDoc */ .chroma .sd { color:#ed9d13 }
/* NameVariableMagic */ .chroma .vm { } /* LiteralStringDouble */ .chroma .s2 { color:#ed9d13 }
/* Literal */ .chroma .l { } /* LiteralStringEscape */ .chroma .se { color:#ed9d13 }
/* LiteralDate */ .chroma .ld { } /* LiteralStringHeredoc */ .chroma .sh { color:#ed9d13 }
/* LiteralString */ .chroma .s { color: #ed9d13 } /* LiteralStringInterpol */ .chroma .si { color:#ed9d13 }
/* LiteralStringAffix */ .chroma .sa { color: #ed9d13 } /* LiteralStringOther */ .chroma .sx { color:#ffa500 }
/* LiteralStringBacktick */ .chroma .sb { color: #ed9d13 } /* LiteralStringRegex */ .chroma .sr { color:#ed9d13 }
/* LiteralStringChar */ .chroma .sc { color: #ed9d13 } /* LiteralStringSingle */ .chroma .s1 { color:#ed9d13 }
/* LiteralStringDelimiter */ .chroma .dl { color: #ed9d13 } /* LiteralStringSymbol */ .chroma .ss { color:#ed9d13 }
/* LiteralStringDoc */ .chroma .sd { color: #ed9d13 } /* LiteralNumber */ .chroma .m { color:#3677a9 }
/* LiteralStringDouble */ .chroma .s2 { color: #ed9d13 } /* LiteralNumberBin */ .chroma .mb { color:#3677a9 }
/* LiteralStringEscape */ .chroma .se { color: #ed9d13 } /* LiteralNumberFloat */ .chroma .mf { color:#3677a9 }
/* LiteralStringHeredoc */ .chroma .sh { color: #ed9d13 } /* LiteralNumberHex */ .chroma .mh { color:#3677a9 }
/* LiteralStringInterpol */ .chroma .si { color: #ed9d13 } /* LiteralNumberInteger */ .chroma .mi { color:#3677a9 }
/* LiteralStringOther */ .chroma .sx { color: #ffa500 } /* LiteralNumberIntegerLong */ .chroma .il { color:#3677a9 }
/* LiteralStringRegex */ .chroma .sr { color: #ed9d13 } /* LiteralNumberOct */ .chroma .mo { color:#3677a9 }
/* LiteralStringSingle */ .chroma .s1 { color: #ed9d13 } /* OperatorWord */ .chroma .ow { color:#6ab825;font-weight:bold }
/* LiteralStringSymbol */ .chroma .ss { color: #ed9d13 } /* Comment */ .chroma .c { color:#999;font-style:italic }
/* LiteralNumber */ .chroma .m { color: #3677a9 } /* CommentHashbang */ .chroma .ch { color:#999;font-style:italic }
/* LiteralNumberBin */ .chroma .mb { color: #3677a9 } /* CommentMultiline */ .chroma .cm { color:#999;font-style:italic }
/* LiteralNumberFloat */ .chroma .mf { color: #3677a9 } /* CommentSingle */ .chroma .c1 { color:#999;font-style:italic }
/* LiteralNumberHex */ .chroma .mh { color: #3677a9 } /* CommentSpecial */ .chroma .cs { color:#e50808;background-color:#520000;font-weight:bold }
/* LiteralNumberInteger */ .chroma .mi { color: #3677a9 } /* CommentPreproc */ .chroma .cp { color:#cd2828;font-weight:bold }
/* LiteralNumberIntegerLong */ .chroma .il { color: #3677a9 } /* CommentPreprocFile */ .chroma .cpf { color:#cd2828;font-weight:bold }
/* LiteralNumberOct */ .chroma .mo { color: #3677a9 } /* GenericDeleted */ .chroma .gd { color:#d22323 }
/* Operator */ .chroma .o { } /* GenericEmph */ .chroma .ge { font-style:italic }
/* OperatorWord */ .chroma .ow { color: #6ab825; font-weight: bold } /* GenericError */ .chroma .gr { color:#d22323 }
/* Punctuation */ .chroma .p { } /* GenericHeading */ .chroma .gh { color:#fff;font-weight:bold }
/* Comment */ .chroma .c { color: #999999; font-style: italic } /* GenericInserted */ .chroma .gi { color:#589819 }
/* CommentHashbang */ .chroma .ch { color: #999999; font-style: italic } /* GenericOutput */ .chroma .go { color:#ccc }
/* CommentMultiline */ .chroma .cm { color: #999999; font-style: italic } /* GenericPrompt */ .chroma .gp { color:#aaa }
/* CommentSingle */ .chroma .c1 { color: #999999; font-style: italic } /* GenericStrong */ .chroma .gs { font-weight:bold }
/* CommentSpecial */ .chroma .cs { color: #e50808; background-color: #520000; font-weight: bold } /* GenericSubheading */ .chroma .gu { color:#fff;text-decoration:underline }
/* CommentPreproc */ .chroma .cp { color: #cd2828; font-weight: bold } /* GenericTraceback */ .chroma .gt { color:#d22323 }
/* CommentPreprocFile */ .chroma .cpf { color: #cd2828; font-weight: bold } /* GenericUnderline */ .chroma .gl { text-decoration:underline }
/* Generic */ .chroma .g { } /* TextWhitespace */ .chroma .w { color:#666 }
/* GenericDeleted */ .chroma .gd { color: #d22323 }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericError */ .chroma .gr { color: #d22323 }
/* GenericHeading */ .chroma .gh { color: #ffffff; font-weight: bold }
/* GenericInserted */ .chroma .gi { color: #589819 }
/* GenericOutput */ .chroma .go { color: #cccccc }
/* GenericPrompt */ .chroma .gp { color: #aaaaaa }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #ffffff; text-decoration: underline }
/* GenericTraceback */ .chroma .gt { color: #d22323 }
/* GenericUnderline */ .chroma .gl { text-decoration: underline }
/* TextWhitespace */ .chroma .w { color: #666666 }
-25
View File
@@ -1,25 +0,0 @@
// 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);
}
});
}
+21
View File
@@ -0,0 +1,21 @@
// code block copy to clipboard
async function copy_to_clipboard(button) {
const codeBlock = button.parentElement.parentElement;
// lang will not be unset because we default it to textoriginalCopyText
// 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;
await navigator.clipboard.writeText(rawCode);
// TODO: maybe we could add a fancier indicator, like a flash or something
button.innerHTML = "Copied!";
setTimeout(() => {
button.innerHTML = "{{ i18n "copy_to_clipboard" }}";
}, 3000);
}
-5
View File
@@ -21,11 +21,6 @@ taxonomies:
outputs: outputs:
page: page:
- html - html
- markdown
outputFormats:
markdown:
ugly: true
privacy: privacy:
googleAnalytics: googleAnalytics:
-6
View File
@@ -32,9 +32,6 @@ readingtime:
edit_history: edit_history:
other: "Edit history" other: "Edit history"
view_markdown:
other: "View raw"
# Post count # Post count
no_posts: no_posts:
@@ -74,9 +71,6 @@ aria_rss_link:
aria_post_meta_edit_history: aria_post_meta_edit_history:
other: "link to page edit history" other: "link to page edit history"
aria_post_meta_view_markdown:
other: "link to view raw markdown code of page"
aria_post_meta_categories: aria_post_meta_categories:
other: "categories" other: "categories"
+4 -3
View File
@@ -3,9 +3,10 @@
{{ $type = . }} {{ $type = . }}
{{ end }} {{ end }}
<div class="code-block"> <div class="code-block">
<div class="code-header"> <div class="code-block-header">
<pre class="code-type">{{ $type }}</pre> <pre class="code-block-type">{{ $type }}</pre>
<a href="javascript:void(0)" class="code-copy-button"> {{/* https://blog.udemy.com/javascript-href/ */}}
<a href="javascript:null" onClick="javascript:copy_to_clipboard(this)" class="code-block-copy-button">
{{ i18n "copy_to_clipboard" }} {{ i18n "copy_to_clipboard" }}
</a> </a>
</div> </div>
+4 -2
View File
@@ -19,8 +19,10 @@
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
{{ end }} {{ end }}
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }} {{ with resources.Get "js/bobatheme.tmpl.js" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script> {{ with resources.ExecuteAsTemplate "js/bobatheme.js" $ . | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ end }} {{ end }}
{{ if not hugo.IsServer }} {{ if not hugo.IsServer }}
<script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.outbound-links.js"></script> <script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.outbound-links.js"></script>
+1 -1
View File
@@ -1 +1 @@
{{ partialCached "icon_code.html" . . }} {{ partialCached "icon_impl.html" . . }}
@@ -1,8 +0,0 @@
{{ with .OutputFormats.Get "markdown" }}
<span class="page-metadata-item post-meta-view-markdown" aria-label="{{ i18n "aria_post_meta_view_markdown" }}">
{{ partial "icon.html" "code" }}
<a href="{{ .Permalink }}" target="_blank">
{{- i18n "view_markdown" -}}
</a>
</span>
{{ end }}
@@ -20,7 +20,6 @@
{{ partial "page-metadata/item/authors.html" . }} {{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }} {{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/edithistory.html" . }} {{ partial "page-metadata/item/edithistory.html" . }}
{{ partial "page-metadata/item/viewraw.html" . }}
{{ partial "page-metadata/item/comments-counter.html" . }} {{ partial "page-metadata/item/comments-counter.html" . }}
{{ partial "page-metadata/item/categories.html" . }} {{ partial "page-metadata/item/categories.html" . }}
+1 -1
View File
@@ -79,7 +79,7 @@
{{ with $related }} {{ with $related }}
<div class="related-posts"> <div class="related-posts">
<hr> <hr>
<h1>{{ i18n "related_posts" }}</h1> <h2>{{ i18n "related_posts" }}</h2>
{{ partial "page-list.html" . }} {{ partial "page-list.html" . }}
</div> </div>
{{ end }} {{ end }}
-9
View File
@@ -1,9 +0,0 @@
{{ with .File -}}
{{ with (.Path | readFile) -}}
{{ . -}}
{{ else -}}
{{ errorf "file not found: %s" .Path -}}
{{ end -}}
{{ else -}}
{{ errorf "no file available for markdown template?" -}}
{{ end -}}
+2 -4
View File
@@ -1,6 +1,4 @@
User-Agent: * User-Agent: *
Sitemap: {{ "sitemap.xml" | absLangURL }} Allow: /
{{/* It complains about the raw markdown output having no title tag */ -}} Sitemap: {{ "sitemap.xml" | absLangURL }}
User-Agent: Bingbot
Disallow: /blog/*.md$
+5 -5
View File
@@ -1,19 +1,19 @@
<a class="section-anchor" href="{{ .Permalink }}"> <a class="section-card-anchor" href="{{ .Permalink }}">
<div class="section"> <div class="section-card">
<div> <div>
<h2 class="section-title"> <h2 class="section-card-title">
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }} {{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }} {{ .Title | markdownify }}
</h2> </h2>
{{ with .Summary }} {{ with .Summary }}
<div class="section-description"> <div class="section-card-description">
{{ . }} {{ . }}
</div> </div>
{{ end }} {{ end }}
</div> </div>
<div class="section-arrow"> <div class="section-card-arrow">
{{ partial "icon.html" "arrow-right" }} {{ partial "icon.html" "arrow-right" }}
</div> </div>
</div> </div>