forked from olivierlacan/keep-a-changelog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.rb
112 lines (91 loc) · 2.29 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
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
# --------------------------------------
# Config
# --------------------------------------
# ----- Site ----- #
$last_version = "0.3.0"
$languages = {
"de" => "Deutsch",
"en" => "English",
"es-ES" => "Español",
"it-IT" => "Italiano",
"pt-BR" => "Brazilian Portugese",
"ru" => "Pyccкий",
"sl" => "Slovenščina",
"sv" => "Svenska",
"tr-TR" => "Türkçe",
"zh-CN" => "简体中文",
"zh-TW" => " 繁體中文"
}
activate :i18n,
lang_map: $languages,
mount_at_root: :en
set :gauges_id, ''
set :publisher_url, 'https://www.facebook.com/olivier.lacan.5'
set :site_url, 'http://keepachangelog.com'
redirect "index.html", to: "en/#{$last_version}/index.html"
$languages.each do |language|
language_param = language.last.parameterize
redirect "#{language.first}/index.html", to: "#{language.first}/#{$last_version}/index.html"
end
# ----- Assets ----- #
set :css_dir, 'assets/stylesheets'
set :js_dir, 'assets/javascripts'
set :images_dir, 'assets/images'
set :fonts_dir, 'assets/fonts'
# ----- Images ----- #
activate :automatic_image_sizes
# ----- Markdown ----- #
activate :syntax
set :markdown_engine, :redcarpet
set :markdown, {
fenced_code_blocks: true,
footnotes: true,
smartypants: true,
tables: true
}
# --------------------------------------
# Helpers
# --------------------------------------
helpers do
def path_to_url(path)
Addressable::URI.join(config.site_url, path).normalize.to_s
end
end
# --------------------------------------
# Content
# --------------------------------------
# ----- Directories ----- #
activate :directory_indexes
page "/404.html", directory_index: false
# --------------------------------------
# Production
# --------------------------------------
# ----- Optimization ----- #
configure :build do
set :gauges_id, "5389808eeddd5b055a00440d"
activate :asset_hash
activate :gzip, {exts: %w[
.css
.eot
.htm
.html
.ico
.js
.json
.svg
.ttf
.txt
.woff
]}
set :haml, {ugly: true, attr_wrapper: '"'}
activate :minify_css
activate :minify_html do |html|
html.remove_quotes = false
end
activate :minify_javascript
end
# ----- Prefixing ----- #
activate :autoprefixer do |config|
config.browsers = ['last 2 versions', 'Explorer >= 10']
config.cascade = false
end