all repos — h3rald @ b26e779a67ddb0e4187d0c75a391b8d5b046f044

The sources of https://h3rald.com

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
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
#!/usr/bin/env ruby

ignore /^\/hastystyles\/(styles|fonts|images|README)/

ignore '/styles/_*'

compile /^\/(archives|home)\// do
	filter :erb
	layout 'default'
end

compile /^\/(projects|about)/ do
	filter :erb
	filter :redcloth
	layout 'default'
end

compile /(rss|atom)/ do
	filter :erb unless rep.binary? # e.g. rss.png image
end

compile '/styles/_*/' do 
end 

compile '/hastystyles/styles/_*/' do 
end 

compile '/styles/*' do
	if item[:extension] == "less" && item.identifier.match(/style\/$/) then
		filter :less
	end
end

compile "sitemap" do
	filter :erb
end

compile /^\/(js\/.+?)/ do
	# do nothing
end

compile '/hastyscribe/HastyScribe_UserGuide/' do
	# do nothing
end

compile '/litestore/LiteStore_UserGuide/' do
	# do nothing
end

compile '/glyph/book/images/*' do
	# do nothing
end

compile '/glyph/book/*' do
	layout 'default'
end

compile '/ruby-compendium/book/images/*' do
	# do nothing
end

compile '/ruby-compendium/book/*' do
	layout 'default'
end

compile '*' do
	if item[:filters_pre] && !item[:filters_pre].empty? then
		item[:filters_pre].each do |f|
			filter f.to_sym
		end
		layout 'default'
	else
		unless rep.binary? then
			case item[:extension]
			when 'textile' then
				filter :redcloth
				layout 'default'
			when 'md','markdown' then
				filter :rdiscount
				layout 'default'
			when 'bbcode' then
				filter :bbcode
				layout 'default'
			when 'glyph' then
				glyph_config @item
				glyph_article_for @item
        if item[:pdf] then
          pdf_file = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.pdf"
          glyph_pdf_for @item unless pdf_file.exist?
        end
				Glyph.reset
			end
		end
	end
end

route /^\/tags\/.+?-(atom|rss)/ do
	item.identifier.gsub(/(.+)-(rss|atom)\/$/, '\1/\2') + '.xml'
end

route '/(atom|rss)/' do
	item.identifier.chop + '.xml'
end

route '/css/*' do
	item.identifier.chop + '.css'
end

route '/styles/*' do
	item.identifier.chop + '.css' 
end

route '/hastyscribe/HastyScribe_UserGuide' do
  '/hastyscribe/HastyScribe_UserGuide.htm'
end

route '/litestore/LiteStore_UserGuide' do
  '/litestore/LiteStore_UserGuide.htm'
end

route '/glyph/book/' do
	'/glyph/book/index.html'
end

route '/ruby-compendium/book/' do
	'/ruby-compendium/book/index.html'
end

route '/glyph/book/images/glyph/*' do
	item.identifier.chop + ".#{item[:extension]}"
end

route '/glyph/book/*' do
	item.identifier.chop+'.html'
end
route '/ruby-compendium/book/*' do
	item.identifier.chop+'.html'
end

route '/home/' do
	"/index.html"
end

route '/sitemap' do
	item.identifier.chop + '.xml'
end

route "/htaccess" do
	"/.htaccess"
end

route /\/(images|img|files|favicon|robots)\// do
	item.identifier.chop + ".#{item[:extension]}"
end

route '/js/*' do
	item.identifier.chop + '.js'
end

route '/fonts/*' do
	item.identifier.chop + ".#{item[:extension]}"
end

route '/hastystyles/fonts/*' do
	item.identifier.chop + ".#{item[:extension]}"
end

route '*' do
  item.identifier + 'index.html'
end

layout '*', :erb