Skip to content

Commit d8d1b3a

Browse files
committed
Dynamically generate syntax highlighting
This also changes theme to something with better contrast
1 parent 36ab963 commit d8d1b3a

File tree

5 files changed

+11
-75
lines changed

5 files changed

+11
-75
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ _site
44
.jekyll-metadata
55
.bundle
66
node_modules/
7+
_sass/_syntax-highlighting.scss

Rakefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ end
3434

3535
task :submodules => ['_sass/brand/.git']
3636

37-
task :dev => [:dependencies, :submodules] do
37+
task :styles => [:dependencies] do
38+
highlight_css = `bundle exec rougify style github`.strip()
39+
File.write("_sass/_syntax-highlighting.scss", highlight_css)
40+
end
41+
42+
task :dev => [:dependencies, :submodules, :styles] do
3843
sh('bundle exec jekyll serve --host 0.0.0.0 --drafts --config _config.yml,_dev.yml')
3944
end
4045

41-
task :build => [:dependencies, :submodules] do
46+
task :build => [:dependencies, :submodules, :styles] do
4247
sh('bundle exec jekyll build --config _config.yml')
4348
end
4449

_includes/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
1919
<link rel="stylesheet" href="{{ '/css/main.css' | prepend: site.baseurl }}">
20+
<link rel="stylesheet" href="{{ '/css/syntax-highlight.css' | prepend: site.baseurl }}">
2021

2122
{% if page.extra_css %}
2223
{% for css_file in page.extra_css %}

_sass/_syntax-highlighting.scss

Lines changed: 0 additions & 71 deletions
This file was deleted.

_sass/common.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
}
3434
}
3535

36-
.highlight {
37-
padding: 1rem;
36+
pre.highlight {
37+
padding: 1.5rem;
3838
}
3939

4040
.centered-content {

0 commit comments

Comments
 (0)