Skip to content

Commit b63dc40

Browse files
authored
Merge pull request #466 from ecstatic-morse/syntax-highlighting
Add syntax highlighting for blog posts
2 parents 89d59d1 + aae52c5 commit b63dc40

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ impl Generator {
220220
dir::copy("static/fonts", &self.out_directory, &options)?;
221221
dir::copy("static/images", &self.out_directory, &options)?;
222222
dir::copy("static/styles", &self.out_directory, &options)?;
223+
dir::copy("static/scripts", &self.out_directory, &options)?;
223224

224225
Ok(())
225226
}

static/scripts/highlight.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/styles/highlight.css

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* Base16 Atelier Dune Light - Theme */
2+
/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
3+
/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4+
5+
/* Atelier-Dune Comment */
6+
.hljs-comment,
7+
.hljs-quote {
8+
color: #AAA;
9+
}
10+
11+
/* Atelier-Dune Red */
12+
.hljs-variable,
13+
.hljs-template-variable,
14+
.hljs-attribute,
15+
.hljs-tag,
16+
.hljs-name,
17+
.hljs-regexp,
18+
.hljs-link,
19+
.hljs-name,
20+
.hljs-selector-id,
21+
.hljs-selector-class {
22+
color: #d73737;
23+
}
24+
25+
/* Atelier-Dune Orange */
26+
.hljs-number,
27+
.hljs-meta,
28+
.hljs-built_in,
29+
.hljs-builtin-name,
30+
.hljs-literal,
31+
.hljs-type,
32+
.hljs-params {
33+
color: #b65611;
34+
}
35+
36+
/* Atelier-Dune Green */
37+
.hljs-string,
38+
.hljs-symbol,
39+
.hljs-bullet {
40+
color: #60ac39;
41+
}
42+
43+
/* Atelier-Dune Blue */
44+
.hljs-title,
45+
.hljs-section {
46+
color: #6684e1;
47+
}
48+
49+
/* Atelier-Dune Purple */
50+
.hljs-keyword,
51+
.hljs-selector-tag {
52+
color: #b854d4;
53+
}
54+
55+
.hljs {
56+
display: block;
57+
overflow-x: auto;
58+
background: #f1f1f1;
59+
color: #6e6b5e;
60+
padding: 0.5em;
61+
}
62+
63+
.hljs-emphasis {
64+
font-style: italic;
65+
}
66+
67+
.hljs-strong {
68+
font-weight: bold;
69+
}
70+
71+
.hljs-addition {
72+
color: #22863a;
73+
background-color: #f0fff4;
74+
}
75+
76+
.hljs-deletion {
77+
color: #b31d28;
78+
background-color: #ffeef0;
79+
}

templates/footer.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@
3535
</div>
3636
</footer>
3737

38+
<!-- scripts -->
39+
<script src="/scripts/highlight.js"></script>

templates/headers.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<link rel="stylesheet" href="/styles/vendor.css"/>
2828
<link rel="stylesheet" href="/styles/fonts.css"/>
2929
<link rel="stylesheet" href="/styles/app.css"/>
30+
<link rel="stylesheet" href="/styles/highlight.css"/>
3031

3132
<!-- favicon -->
3233
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">

0 commit comments

Comments
 (0)