commentary

This commit is contained in:
Lorin Werthen 2016-07-23 22:43:46 +02:00
parent a22209d485
commit 9a2cc80dcb
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0

76
Rules
View file

@ -3,6 +3,12 @@
require 'json' require 'json'
#
#
# PREPROCESS
#
#
preprocess do preprocess do
@items.find_all('/posts/**/*').each do |i| @items.find_all('/posts/**/*').each do |i|
year_str = %r{/(\d\d)-\d\d/}.match(i.identifier).captures[0] year_str = %r{/(\d\d)-\d\d/}.match(i.identifier).captures[0]
@ -33,7 +39,15 @@ end
# This makes sure this tipuesearch_content doesn't get deleted # This makes sure this tipuesearch_content doesn't get deleted
passthrough '/tipuesearch_content.js' passthrough '/tipuesearch_content.js'
# ERB #
#
# COMPILATION
#
#
#
# CAMMIE
#
compile '/cammie.*' do compile '/cammie.*' do
layout '/default.*' layout '/default.*'
filter :erb filter :erb
@ -41,6 +55,9 @@ compile '/cammie.*' do
filter :relativize_paths, type: :html filter :relativize_paths, type: :html
end end
#
# ARCHIVES
#
compile '/archives/*' do compile '/archives/*' do
layout '/archive_page.*' layout '/archive_page.*'
layout '/generic.*' layout '/generic.*'
@ -50,17 +67,9 @@ compile '/archives/*' do
filter :relativize_paths, type: :html filter :relativize_paths, type: :html
end end
# Coffeescript #
compile '/assets/scripts/**/*.coffee' do # POSTS
filter :coffeescript #
end
# SCSS
compile '/assets/stylesheets/**/*.scss' do
filter :sass, syntax: :scss
end
# Compile all posts
compile '/posts/**/*' do compile '/posts/**/*' do
filter :kramdown filter :kramdown
@ -76,6 +85,9 @@ compile '/posts/**/*', rep: :text do
filter :strip_html filter :strip_html
end end
#
# GENERIC ERB PAGES
#
compile '/*.erb' do compile '/*.erb' do
layout '/generic.*' layout '/generic.*'
layout '/default.*' layout '/default.*'
@ -84,10 +96,35 @@ compile '/*.erb' do
filter :relativize_paths, type: :html filter :relativize_paths, type: :html
end end
#
# ASSETS
#
compile '/assets/scripts/**/*.coffee' do
filter :coffeescript
end
compile '/assets/stylesheets/**/*.scss' do
filter :sass, syntax: :scss
end
passthrough '/assets/images/*.{png}'
#
#
# ROUTES
#
#
#
# HOMEPAGE
#
route '/index.*' do route '/index.*' do
'/index.html' '/index.html'
end end
#
# ASSETS
#
route '/assets/stylesheets/**/*' do route '/assets/stylesheets/**/*' do
"#{item.identifier.without_ext}.css" "#{item.identifier.without_ext}.css"
end end
@ -96,14 +133,25 @@ route '/assets/scripts/**/*' do
"#{item.identifier.without_ext}.js" "#{item.identifier.without_ext}.js"
end end
passthrough '/assets/images/*.{png}' # TEXT
route '/**/*.{erb,html,md}' do route '/**/*.{erb,html,md}' do
"#{item.identifier.without_ext}/index.html" "#{item.identifier.without_ext}/index.html"
end end
#
#
# LAYOUTS
#
#
layout '/**/*', :erb layout '/**/*', :erb
#
#
# POSTPROCESS
#
#
postprocess do postprocess do
tmp = articles.map do |e| tmp = articles.map do |e|
{ {