Add Rouge

This commit is contained in:
Wesley Moore 2018-08-19 09:17:59 +10:00
parent cac44fba1e
commit 7659eeb4f1
No known key found for this signature in database
GPG key ID: BF67766C0BC2D0EE
4 changed files with 15 additions and 1 deletions

View file

@ -17,6 +17,7 @@ gem 'systemu'
gem 'listen'
gem 'guard-nanoc'
gem 'adsf'
gem 'rouge'
if RbConfig::CONFIG['target_os'] =~ /(?i-mx:bsd|dragonfly)/
gem 'rb-kqueue', '>= 0.2'

View file

@ -95,6 +95,7 @@ GEM
ffi (>= 0.5.0, < 2)
rdiscount (2.2.0.1)
ref (2.0.0)
rouge (3.2.1)
ruby_dep (1.5.0)
rubypants (0.6.0)
sass (3.5.1)
@ -126,6 +127,7 @@ DEPENDENCIES
nokogiri
rake
rdiscount
rouge
rubypants
sass
systemu

7
Rules
View file

@ -21,6 +21,7 @@ compile %r(/\d{4}/.*) do
layout 'article'
layout 'default'
filter :rubypants
filter :colorize_syntax, default_colorizer: :rouge
end
compile %r(/about/.*) do
@ -41,6 +42,10 @@ compile %r{^/(?:screen|mobile)/$} do
filter :sass
end
compile %r{/rouge/$} do
filter :erb
end
compile '*' do
filter :rdiscount
layout 'default'
@ -64,7 +69,7 @@ end
# (path.dirname + 'articles.json').to_s
# end
route %r{^/(?:screen|mobile)/$} do
route %r{^/(?:screen|mobile|rouge)/$} do
File.join("", "css", File.basename(item.identifier) + ".css")
end

6
content/rouge.css.erb Normal file
View file

@ -0,0 +1,6 @@
<%= Rouge::Themes::Base16::Solarized.render(scope: 'pre') %>
pre {
padding: 0 5px 5px;
border-radius: 3px;
}