Skip to content

Commit fd0addf

Browse files
committed
Update website to use Zola 0.22 with new code block syntax highlighting
1 parent 00718c5 commit fd0addf

5 files changed

Lines changed: 17 additions & 81 deletions

File tree

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: 🕸 Install Zola
3838
uses: taiki-e/install-action@v2
3939
with:
40-
tool: zola@0.20.0
40+
tool: zola@0.22.0
4141

4242
- name: 🔍 Check if `website/other` directory changed
4343
uses: dorny/paths-filter@v3

website/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules/
22
public/
33
static/fonts/
4-
static/syntax-highlighting.css
54
static/text-balancer.js

website/config.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ feed_filenames = ["rss.xml"]
66
compile_sass = true
77
minify_html = false
88

9-
[markdown]
10-
highlight_code = true
11-
highlight_theme = "css"
12-
highlight_themes_css = [
13-
{ theme = "kronuz", filename = "syntax-highlighting.css" },
14-
]
9+
[markdown.highlighting]
10+
error_on_missing_language = false
11+
theme = "gruvbox-dark-soft"
1512

1613
[extra]
1714
# Put all your custom variables here

website/sass/component/code-snippet.scss

Lines changed: 13 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,86 +21,27 @@ pre {
2121

2222
// Container for the element (span or table) containing the lines of code
2323
code {
24-
background: initial;
24+
background: inherit;
2525
color: inherit;
2626
display: block;
2727
overflow-x: auto;
28-
padding: 20px;
29-
width: 0;
28+
padding: 10px 20px;
3029
flex: 1 1 auto;
31-
}
32-
33-
// Language name in top right corner
34-
&[data-lang] {
35-
padding-top: 28px;
30+
width: 0;
3631

37-
&::before {
38-
content: attr(data-lang);
39-
color: rgba(var(--color-seaside-rgb), 0.5);
40-
text-transform: lowercase;
41-
font-family: "Inter Variable", sans-serif;
42-
font-size: 0.75em;
43-
font-weight: 700;
44-
font-style: italic;
45-
-webkit-user-select: none;
46-
user-select: none;
47-
pointer-events: none;
48-
position: fixed;
49-
top: 0;
50-
line-height: 28px;
51-
display: block;
32+
.giallo-l {
33+
display: inline-block;
34+
min-height: 1lh;
5235
width: 100%;
53-
text-indent: 20px;
54-
background: rgba(0, 0, 0, 0.25);
55-
56-
&[data-lang="sh"] {
57-
content: "Shell";
58-
}
59-
60-
&[data-lang="rs"] {
61-
content: "Rust";
62-
}
63-
64-
&[data-lang="js"] {
65-
content: "JavaScript";
66-
}
67-
68-
&[data-lang="ts"] {
69-
content: "TypeScript";
70-
}
7136
}
72-
}
73-
74-
// Code blocks with line numbers
75-
&[data-linenos] table {
76-
border-spacing: 0;
77-
margin: -20px;
78-
79-
tr {
80-
&:first-child td {
81-
padding-top: 20px;
82-
}
8337

84-
&:last-child td {
85-
padding-bottom: 20px;
86-
}
87-
88-
td {
89-
&:first-child {
90-
padding-left: 20px;
91-
padding-right: 10px;
92-
-webkit-user-select: none;
93-
user-select: none;
94-
vertical-align: top;
95-
text-align: right;
96-
background: rgba(0, 0, 0, 0.25);
97-
}
98-
99-
&:last-child {
100-
padding-left: 10px;
101-
padding-right: 20px;
102-
}
103-
}
38+
.giallo-ln {
39+
display: inline-block;
40+
user-select: none;
41+
text-align: right;
42+
margin-left: -10px;
43+
padding-right: 16px;
44+
min-width: 3ch;
10445
}
10546
}
10647
}

website/templates/book.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
{%- set title = page.title -%}
55
{%- set meta_article_type = true -%}
66
{%- set meta_description = page.extra.summary | default(value = page.content | striptags | safe | linebreaksbr | replace(from = "<br>", to = " ") | replace(from = " ", to = " ") | trim | truncate(length = 200)) -%}
7-
{%- set linked_css = ["/syntax-highlighting.css"] -%}
87
{%- set css = ["/template/book.css", "/layout/reading-material.css", "/component/code-snippet.css"] -%}
98
{%- set js = ["/js/book.js"] -%}
109
{%- endblock head -%}

0 commit comments

Comments
 (0)