This repository has been archived by the owner on Jul 12, 2020. It is now read-only.
forked from middleman/middlemanapp.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
52 lines (43 loc) · 1.74 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
require "builder"
set :layout, :article
activate :livereload
activate :i18n
activate :directory_indexes
activate :autoprefixer
set :markdown, :tables => true, :autolink => true, :gh_blockcode => true, :fenced_code_blocks => true, :with_toc_data => true
set :markdown_engine, :redcarpet
# Redirect from old paths
{
"basics/dynamic-pages.html" => "advanced/dynamic_pages.html",
"basics/pretty-urls.html" => "advanced/pretty_urls.html",
"advanced/custom.html" => "advanced/custom_extensions.html",
"basics/templates.html" => "basics/templating_language.html",
"basics/helpers.html" => "basics/helper_methods.html",
"basics/getting-started.html" => "basics/install.html",
"basics/asset-pipeline.html" => "advanced/asset_pipeline.html",
"advanced/improving-cacheability.html" => "advanced/improving_cacheability.html",
"advanced/local-data.html" => "advanced/data_files.html",
"advanced/rack-middleware.html" => "advanced/rack_middleware.html",
"advanced/file-size-optimization.html" => "advanced/file_size_optimization.html",
"community/built-using-middleman.html" => "community/built_using_middleman.html"
}.each do |old_path, new_path|
["", "jp/"].each do |prefix|
redirect "#{prefix}#{old_path}", to: "#{prefix}#{new_path}"
end
end
configure :development do
set :debug_assets, true
end
configure :build do
activate :minify_css
activate :minify_javascript
end
helpers do
def active_link_to(caption, url, options = {})
if current_page.url == "#{url}/"
options[:class] = "doc-item-active"
end
link_to(caption, url, options)
end
end
page "/localizable/community/built_using_middleman", layout: :example