-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
74 lines (59 loc) · 2.24 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
################################################################################
# Susy grids in Compass
################################################################################
require 'susy'
################################################################################
# Syntax highlighting in markdown
################################################################################
require 'rack/codehighlighter'
require "pygments"
use Rack::Codehighlighter,
:pygments,
:element => "pre>code",
:pattern => /\A:::([-_+\w]+)\s*\n/,
:markdown => true
################################################################################
# CoffeeScript filters in Haml
################################################################################
require 'coffee-filter'
################################################################################
# Blog
################################################################################
activate :blog do |blog|
blog.permalink = "blog/:year/:title.html"
blog.sources = "blog/:year/:title.html"
end
page "/feed.xml", :layout => false
################################################################################
# Localization (i18n)
################################################################################
activate :i18n, :langs => [:de]
################################################################################
# View Helpers
# Methods defined in the helpers block are available in templates
################################################################################
helpers do
# Calculate the years for a copyright
def copyright_years(start_year)
end_year = Date.today.year
if start_year == end_year
start_year.to_s
else
start_year.to_s + '-' + end_year.to_s
end
end
end
################################################################################
# Build-specific configuration
################################################################################
configure :build do
# Minify CSS on build
activate :minify_css
# Minify Javascript on build
activate :minify_javascript
# Enable cache buster
activate :cache_buster
# Compress PNGs, jpgs .. after build
require "middleman-smusher"
activate :smusher
end