forked from rubygems/bundler-site
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.rb
65 lines (54 loc) · 1.57 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
activate :syntax
set :markdown_engine, :kramdown
# Markdown extentions
set :markdown,
autolink: true,
fenced_code_blocks: true,
footnotes: true,
gh_codeblock: true,
highlight: true,
no_intra_emphasis: true,
quote: true,
smartypants: true,
strikethrough: true,
superscript: true,
tables: true
set :versions, `rake versions`.split
set :current_version, versions.last
# Make documentation for the latest version available at the top level, too.
# Any pages with names that conflict with files already at the top level will be skipped.
ready do
sitemap.resources.each do |page|
if page.path.start_with? "#{current_version}/"
proxy_path = page.path["#{current_version}/".length..-1]
proxy proxy_path, page.path if sitemap.find_resource_by_path(proxy_path).nil?
end
end
end
page '/sitemap.xml', layout: false
###
# Helpers
###
Dir.glob(File.expand_path('../helpers/**/*.rb', __FILE__), &method(:require))
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
set :partials_dir, 'partials'
activate :blog do |blog|
blog.name = 'blog'
blog.prefix = 'blog'
blog.permalink = '{year}/{month}/{day}/{title}.html'
blog.layout = 'blog_layout'
blog.calendar_template = 'blog/calendar.html'
blog.year_link = "{year}/index.html"
blog.month_link = "{year}/{month}/index.html"
blog.day_link = "{year}/{month}/{day}/index.html"
end
page "/blog/feed.xml", layout: false
configure :development do
activate :livereload
end
configure :build do
set :http_prefix, '/bundler-site/'
activate :minify_css
end