-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
107 lines (90 loc) · 2.05 KB
/
Rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env ruby
# engendrement des fichiers html
# page d'Accueil
#route '/' do
# '/index.html'
#end
# CSS
compile '/css/*' do
filter :no_custom_css
filter :sass
filter :rainpress
end
route '/css/*' do
'/Scratch/assets' + item.identifier.chop + '.css'
end
compile '/img/*' do
end
route '/img/*' do
'/Scratch/assets' + item.identifier.chop + '.png'
end
compile '/css/raw/*' do
end
route '/css/raw/*' do
'/Scratch' + item.identifier.sub(/raw\//,'').chop + '.css'
end
# JS
compile '/js/*' do
end
route '/js/*' do
'/Scratch/assets' + item.identifier.chop + '.js'
end
compile '/html' do
filter :erb
layout 'main' unless item[:layout] == "none"
end
route '/html' do
'/index.html'
end
compile '/html/*' do
# item[:extension] returns 'html.erb' for multi-dotted filename
ext = item[:extension].nil? ? nil : item[:extension].split('.').last
filter :ultraviolet # must be before kramdown
filter :graph
filter :description
filter :falacy
if ext == 'erb'
filter :erb
elsif ext == 'haml' || ext.nil?
filter :haml
elsif ext == 'md' || ext == 'markdown'
filter :erb
filter :kramdown
filter :math_repair # after kramdown
else
raise "Filter is not configured for #{item.identifier} in Rules file."
end
filter :multicorps # must be before firsthi
filter :firsthi # must be after multicorps
filter :frenchspace
filter :ytypo
# filter :yabbreviations
filter :footnotes
if item[:kind] == 'article'
layout 'article'
elsif not item[:layout].nil?
layout item[:layout]
else
layout 'main' unless item[:layout] == "none"
end
end
route '/html/*' do
'/Scratch' + item.identifier.sub('/html','') + 'index.html'
end
# feed
compile '/xml/*' do
layout 'feed'
end
route '/xml/en/*' do
'/Scratch/en/blog/feed/feed.xml'
end
route '/xml/fr/*' do
'/Scratch/fr/blog/feed/feed.xml'
end
compile '/sitemap/*' do
layout 'sitemap'
end
route '/sitemap/*' do
'/Scratch/sitemap.xml'
end
layout '*', :erb