Skip to content

Commit e169f35

Browse files
committed
add prism syntax highlighting config
Signed-off-by: Alex Suraci <[email protected]>
1 parent fdc2893 commit e169f35

File tree

6 files changed

+136
-1
lines changed

6 files changed

+136
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ blog/assets/css/*
1010
!blog/assets/css/*.gitkeep
1111
blog/assets/images/*
1212
!blog/assets/images/.gitkeep
13+
blog/assets/js/*
14+
!blog/assets/js/.gitkeep
1315

1416
!discourse/*/*.html
1517

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
objects = js/search.js css/booklit.css css/blog.css css/pipeline.css discourse/common/common.scss discourse/desktop/desktop.scss discourse/mobile/mobile.scss blog/concourse.zip
1+
objects = js/search.js css/booklit.css css/blog.css css/prism.css css/pipeline.css discourse/common/common.scss discourse/desktop/desktop.scss discourse/mobile/mobile.scss blog/concourse.zip
22

33
all: $(objects)
44

@@ -16,6 +16,9 @@ css/booklit.css: less/booklit.less less/*.less
1616
css/blog.css: less/blog.less less/*.less
1717
yarn run lessc $< $@
1818

19+
css/prism.css: less/prism.less less/*.less
20+
yarn run lessc $< $@
21+
1922
css/pipeline.css: less/pipeline.less
2023
yarn run lessc $< $@
2124

blog/assets/js/.gitkeep

Whitespace-only changes.

blog/default.hbs

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<link rel="stylesheet" type="text/css" href="{{asset "css/normalize.css"}}" />
1818
<link rel="stylesheet" type="text/css" href="{{asset "css/iosevka.css"}}" />
1919
<link rel="stylesheet" type="text/css" href="{{asset "css/blog.css"}}" />
20+
<link rel="stylesheet" type="text/css" href="{{asset "css/prism.css"}}" />
2021
<link href="https://fonts.googleapis.com/css?family=Barlow:400,400i,700|Roboto+Slab:300,400,700" rel="stylesheet" />
2122
{{ghost_head}}
2223
</head>
@@ -49,5 +50,7 @@
4950

5051

5152
{{ghost_foot}}
53+
54+
<script async type="text/javascript" src="{{asset "js/prism.js"}}"></script>
5255
</body>
5356
</html>

css/prism.css

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.token.comment,
2+
.token.prolog,
3+
.token.doctype,
4+
.token.cdata {
5+
color: #7a7373;
6+
}
7+
.token.punctuation {
8+
color: #9b9b9b;
9+
}
10+
.token.selector,
11+
.token.tag {
12+
color: #ed4b35;
13+
}
14+
.token.property,
15+
.token.boolean,
16+
.token.number,
17+
.token.constant,
18+
.token.symbol,
19+
.token.attr-name,
20+
.token.deleted {
21+
color: #f5a623;
22+
}
23+
.token.string,
24+
.token.char,
25+
.token.attr-value,
26+
.token.builtin,
27+
.token.inserted {
28+
color: #11c560;
29+
}
30+
.token.operator,
31+
.token.entity,
32+
.token.url {
33+
color: #2d76cc;
34+
}
35+
.token.atrule,
36+
.token.keyword {
37+
color: #4a90e2;
38+
}
39+
.token.function {
40+
color: #4a90e2;
41+
}
42+
.token.regex,
43+
.token.important,
44+
.token.variable {
45+
color: #4a90e2;
46+
}
47+
.token.important,
48+
.token.bold {
49+
font-weight: bold;
50+
}
51+
.token.italic {
52+
font-style: italic;
53+
}
54+
.token.entity {
55+
cursor: help;
56+
}

less/prism.less

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@import "colors.less";
2+
3+
.token {
4+
&.comment,
5+
&.prolog,
6+
&.doctype,
7+
&.cdata {
8+
color: @grey-secondary;
9+
}
10+
11+
&.punctuation {
12+
color: @grey-primary;
13+
}
14+
15+
&.selector,
16+
&.tag {
17+
color: @red-primary;
18+
}
19+
20+
&.property,
21+
&.boolean,
22+
&.number,
23+
&.constant,
24+
&.symbol,
25+
&.attr-name,
26+
&.deleted {
27+
color: @amber-primary;
28+
}
29+
30+
&.string,
31+
&.char,
32+
&.attr-value,
33+
&.builtin,
34+
&.inserted {
35+
color: @green-primary;
36+
}
37+
38+
&.operator,
39+
&.entity,
40+
&.url {
41+
color: @blue-secondary;
42+
}
43+
44+
&.atrule,
45+
&.keyword {
46+
color: @blue-primary;
47+
}
48+
49+
&.function {
50+
color: @blue-primary;
51+
}
52+
53+
&.regex,
54+
&.important,
55+
&.variable {
56+
color: @blue-primary;
57+
}
58+
59+
&.important,
60+
&.bold {
61+
font-weight: bold;
62+
}
63+
64+
&.italic {
65+
font-style: italic;
66+
}
67+
68+
&.entity {
69+
cursor: help;
70+
}
71+
}

0 commit comments

Comments
 (0)