Skip to content

Commit 9ebe824

Browse files
committed
Fix syntax highlighting: add Monokai CSS and update build pipeline
1 parent 16d1f46 commit 9ebe824

File tree

4 files changed

+97
-4
lines changed

4 files changed

+97
-4
lines changed

.github/workflows/hugo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
TZ: America/Los_Angeles
5858
run: |
5959
hugo \
60-
--gc \
60+
--cleanDestinationDir \
6161
--minify \
6262
--baseURL "${{ steps.pages.outputs.base_url }}/"
6363
- name: Upload artifact

assets/css/syntax.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* Generated using: hugo gen chromastyles --style=monokai */
2+
3+
/* Background */ .bg { color:#f8f8f2;background-color:#272822; }
4+
/* PreWrapper */ .chroma { color:#f8f8f2;background-color:#272822; }
5+
/* Other */ .chroma .x { }
6+
/* Error */ .chroma .err { color:#960050;background-color:#1e0010 }
7+
/* CodeLine */ .chroma .cl { }
8+
/* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit }
9+
/* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; }
10+
/* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; }
11+
/* LineHighlight */ .chroma .hl { background-color:#3c3d38 }
12+
/* 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 }
13+
/* 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 }
14+
/* Line */ .chroma .line { display:flex; }
15+
/* Keyword */ .chroma .k { color:#66d9ef }
16+
/* KeywordConstant */ .chroma .kc { color:#66d9ef }
17+
/* KeywordDeclaration */ .chroma .kd { color:#66d9ef }
18+
/* KeywordNamespace */ .chroma .kn { color:#f92672 }
19+
/* KeywordPseudo */ .chroma .kp { color:#66d9ef }
20+
/* KeywordReserved */ .chroma .kr { color:#66d9ef }
21+
/* KeywordType */ .chroma .kt { color:#66d9ef }
22+
/* Name */ .chroma .n { }
23+
/* NameAttribute */ .chroma .na { color:#a6e22e }
24+
/* NameClass */ .chroma .nc { color:#a6e22e }
25+
/* NameConstant */ .chroma .no { color:#66d9ef }
26+
/* NameDecorator */ .chroma .nd { color:#a6e22e }
27+
/* NameEntity */ .chroma .ni { }
28+
/* NameException */ .chroma .ne { color:#a6e22e }
29+
/* NameLabel */ .chroma .nl { }
30+
/* NameNamespace */ .chroma .nn { }
31+
/* NameOther */ .chroma .nx { color:#a6e22e }
32+
/* NameProperty */ .chroma .py { }
33+
/* NameTag */ .chroma .nt { color:#f92672 }
34+
/* NameBuiltin */ .chroma .nb { }
35+
/* NameBuiltinPseudo */ .chroma .bp { }
36+
/* NameVariable */ .chroma .nv { }
37+
/* NameVariableClass */ .chroma .vc { }
38+
/* NameVariableGlobal */ .chroma .vg { }
39+
/* NameVariableInstance */ .chroma .vi { }
40+
/* NameVariableMagic */ .chroma .vm { }
41+
/* NameFunction */ .chroma .nf { color:#a6e22e }
42+
/* NameFunctionMagic */ .chroma .fm { color:#a6e22e }
43+
/* Literal */ .chroma .l { color:#ae81ff }
44+
/* LiteralDate */ .chroma .ld { color:#e6db74 }
45+
/* LiteralString */ .chroma .s { color:#e6db74 }
46+
/* LiteralStringAffix */ .chroma .sa { color:#e6db74 }
47+
/* LiteralStringBacktick */ .chroma .sb { color:#e6db74 }
48+
/* LiteralStringChar */ .chroma .sc { color:#e6db74 }
49+
/* LiteralStringDelimiter */ .chroma .dl { color:#e6db74 }
50+
/* LiteralStringDoc */ .chroma .sd { color:#e6db74 }
51+
/* LiteralStringDouble */ .chroma .s2 { color:#e6db74 }
52+
/* LiteralStringEscape */ .chroma .se { color:#ae81ff }
53+
/* LiteralStringHeredoc */ .chroma .sh { color:#e6db74 }
54+
/* LiteralStringInterpol */ .chroma .si { color:#e6db74 }
55+
/* LiteralStringOther */ .chroma .sx { color:#e6db74 }
56+
/* LiteralStringRegex */ .chroma .sr { color:#e6db74 }
57+
/* LiteralStringSingle */ .chroma .s1 { color:#e6db74 }
58+
/* LiteralStringSymbol */ .chroma .ss { color:#e6db74 }
59+
/* LiteralNumber */ .chroma .m { color:#ae81ff }
60+
/* LiteralNumberBin */ .chroma .mb { color:#ae81ff }
61+
/* LiteralNumberFloat */ .chroma .mf { color:#ae81ff }
62+
/* LiteralNumberHex */ .chroma .mh { color:#ae81ff }
63+
/* LiteralNumberInteger */ .chroma .mi { color:#ae81ff }
64+
/* LiteralNumberIntegerLong */ .chroma .il { color:#ae81ff }
65+
/* LiteralNumberOct */ .chroma .mo { color:#ae81ff }
66+
/* Operator */ .chroma .o { color:#f92672 }
67+
/* OperatorWord */ .chroma .ow { color:#f92672 }
68+
/* Punctuation */ .chroma .p { }
69+
/* Comment */ .chroma .c { color:#75715e }
70+
/* CommentHashbang */ .chroma .ch { color:#75715e }
71+
/* CommentMultiline */ .chroma .cm { color:#75715e }
72+
/* CommentSingle */ .chroma .c1 { color:#75715e }
73+
/* CommentSpecial */ .chroma .cs { color:#75715e }
74+
/* CommentPreproc */ .chroma .cp { color:#75715e }
75+
/* CommentPreprocFile */ .chroma .cpf { color:#75715e }
76+
/* Generic */ .chroma .g { }
77+
/* GenericDeleted */ .chroma .gd { color:#f92672 }
78+
/* GenericEmph */ .chroma .ge { font-style:italic }
79+
/* GenericError */ .chroma .gr { }
80+
/* GenericHeading */ .chroma .gh { }
81+
/* GenericInserted */ .chroma .gi { color:#a6e22e }
82+
/* GenericOutput */ .chroma .go { }
83+
/* GenericPrompt */ .chroma .gp { }
84+
/* GenericStrong */ .chroma .gs { font-weight:bold }
85+
/* GenericSubheading */ .chroma .gu { color:#75715e }
86+
/* GenericTraceback */ .chroma .gt { }
87+
/* GenericUnderline */ .chroma .gl { }
88+
/* TextWhitespace */ .chroma .w { }

config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ markup:
1616
tabWidth: 2
1717
codeFences: true
1818
guessSyntax: true
19-
noClasses: true
19+
noClasses: false
2020

2121
# Site parameters
2222
params:

layouts/partials/extend_head.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!-- Syntax Highlighting CSS -->
2+
{{ $syntax := resources.Get "css/syntax.css" | minify | fingerprint }}
3+
<link rel="stylesheet" href="{{ $syntax.Permalink }}" integrity="{{ $syntax.Data.Integrity }}" crossorigin="anonymous">
4+
15
{{- if or .Params.math .Site.Params.math -}}
26
<!-- MathJax Configuration -->
37
<script>
@@ -8,7 +12,7 @@
812
["\\(", "\\)"],
913
],
1014
displayMath: [
11-
["$$", "$$"],
15+
["$", "$"],
1216
["\\[", "\\]"],
1317
],
1418
processEscapes: true,
@@ -23,7 +27,8 @@
2327
async
2428
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
2529
></script>
26-
{{- end -}} {{- if or .Params.mermaid .Site.Params.mermaid -}}
30+
{{- end -}}
31+
{{- if or .Params.mermaid .Site.Params.mermaid -}}
2732
<!-- Mermaid Configuration -->
2833
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
2934
<script>

0 commit comments

Comments
 (0)