mirror of
https://github.com/wezm/wezm.net.git
synced 2024-12-18 18:29:54 +00:00
Add Rouge
This commit is contained in:
parent
cac44fba1e
commit
7659eeb4f1
4 changed files with 15 additions and 1 deletions
1
Gemfile
1
Gemfile
|
@ -17,6 +17,7 @@ gem 'systemu'
|
||||||
gem 'listen'
|
gem 'listen'
|
||||||
gem 'guard-nanoc'
|
gem 'guard-nanoc'
|
||||||
gem 'adsf'
|
gem 'adsf'
|
||||||
|
gem 'rouge'
|
||||||
|
|
||||||
if RbConfig::CONFIG['target_os'] =~ /(?i-mx:bsd|dragonfly)/
|
if RbConfig::CONFIG['target_os'] =~ /(?i-mx:bsd|dragonfly)/
|
||||||
gem 'rb-kqueue', '>= 0.2'
|
gem 'rb-kqueue', '>= 0.2'
|
||||||
|
|
|
@ -95,6 +95,7 @@ GEM
|
||||||
ffi (>= 0.5.0, < 2)
|
ffi (>= 0.5.0, < 2)
|
||||||
rdiscount (2.2.0.1)
|
rdiscount (2.2.0.1)
|
||||||
ref (2.0.0)
|
ref (2.0.0)
|
||||||
|
rouge (3.2.1)
|
||||||
ruby_dep (1.5.0)
|
ruby_dep (1.5.0)
|
||||||
rubypants (0.6.0)
|
rubypants (0.6.0)
|
||||||
sass (3.5.1)
|
sass (3.5.1)
|
||||||
|
@ -126,6 +127,7 @@ DEPENDENCIES
|
||||||
nokogiri
|
nokogiri
|
||||||
rake
|
rake
|
||||||
rdiscount
|
rdiscount
|
||||||
|
rouge
|
||||||
rubypants
|
rubypants
|
||||||
sass
|
sass
|
||||||
systemu
|
systemu
|
||||||
|
|
7
Rules
7
Rules
|
@ -21,6 +21,7 @@ compile %r(/\d{4}/.*) do
|
||||||
layout 'article'
|
layout 'article'
|
||||||
layout 'default'
|
layout 'default'
|
||||||
filter :rubypants
|
filter :rubypants
|
||||||
|
filter :colorize_syntax, default_colorizer: :rouge
|
||||||
end
|
end
|
||||||
|
|
||||||
compile %r(/about/.*) do
|
compile %r(/about/.*) do
|
||||||
|
@ -41,6 +42,10 @@ compile %r{^/(?:screen|mobile)/$} do
|
||||||
filter :sass
|
filter :sass
|
||||||
end
|
end
|
||||||
|
|
||||||
|
compile %r{/rouge/$} do
|
||||||
|
filter :erb
|
||||||
|
end
|
||||||
|
|
||||||
compile '*' do
|
compile '*' do
|
||||||
filter :rdiscount
|
filter :rdiscount
|
||||||
layout 'default'
|
layout 'default'
|
||||||
|
@ -64,7 +69,7 @@ end
|
||||||
# (path.dirname + 'articles.json').to_s
|
# (path.dirname + 'articles.json').to_s
|
||||||
# end
|
# end
|
||||||
|
|
||||||
route %r{^/(?:screen|mobile)/$} do
|
route %r{^/(?:screen|mobile|rouge)/$} do
|
||||||
File.join("", "css", File.basename(item.identifier) + ".css")
|
File.join("", "css", File.basename(item.identifier) + ".css")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
6
content/rouge.css.erb
Normal file
6
content/rouge.css.erb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<%= Rouge::Themes::Base16::Solarized.render(scope: 'pre') %>
|
||||||
|
|
||||||
|
pre {
|
||||||
|
padding: 0 5px 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
Loading…
Reference in a new issue