-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.rb
75 lines (63 loc) · 1.82 KB
/
config.rb
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
require "extensions/views"
require "extensions/pdf"
require "yaml"
activate :views
activate :directory_indexes
activate :deploy do |deploy|
deploy.build_before = false
deploy.method = :git
end
# Global site settings
set :relative_links, true
set :css_dir, "assets/stylesheets"
set :js_dir, "assets/javascripts"
set :images_dir, "assets/images"
set :fonts_dir, "assets/fonts"
set :layout, "layouts/application"
set :partials_dir, "partials"
set :markdown_engine, :kramdown
set :markdown, :parse_block_html => true
set :site_title, "Ancient Terracottas"
set :site_url, ""
configure :development do
activate :livereload
end
configure :build do
activate :relative_assets # Needed for Github Pages
activate :minify_css
activate :minify_javascript
activate :gzip
activate :minify_html
activate :pdf do |pdf|
pdf.print_template = "/catalogue/print-template.html"
# pdf.output_path = "/pdf/terracottas.pdf"
end
set :site_url, "/publications/terracottas"
end
data.catalogue.each do |cat, entry|
proxy "/catalogue/#{cat}.html", "/catalogue/template.html", :locals => {
:entry => entry
}, :ignore => true
end
data.catalogue.each do |cat, entry|
proxy "/epub/catalogue/#{cat}.html", "/catalogue/epub_template.html", :locals => {
:entry => entry
}, :ignore => true
end
ignore "/catalogue/print-template.html"
page "/discussion/*", :layout => :page
helpers do
def nav_link(link_text, page_url, options = {})
options[:class] ||= ""
if current_page.url.length > 1
current_url = current_page.url.chop
else
current_url = current_page.url
end
options[:class] << " active" if page_url == current_url
link_to(link_text, page_url, options)
end
def markdown(text)
Tilt["markdown"].new { text }.render
end
end