-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
99 lines (78 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
# Use Bourbon for SASS mixins and helpers
require "bourbon"
# Use Autoprefixer so we no longer need to use mixins for CSS3 properties
activate :autoprefixer
# Reload page when saving SCSS, CoffeeScript or HTML files
activate :livereload
# Markdown
set :markdown_engine, :redcarpet
set :markdown, :fenced_code_blocks => true, :smartypants => true
# Blog configuration
activate :blog do |blog|
# This will add a prefix to all links, template references and source paths
# blog.prefix = "blog"
blog.permalink = "{year}/{month}/{day}/{title}.html"
# Matcher for blog source files
blog.sources = "posts/{title}.html"
# blog.taglink = "tags/{tag}.html"
blog.layout = "article"
# blog.summary_separator = /(READMORE)/
# blog.summary_length = 250
# blog.year_link = "{year}.html"
# blog.month_link = "{year}/{month}.html"
# blog.day_link = "{year}/{month}/{day}.html"
# blog.default_extension = ".md"
# blog.tag_template = "tag.html"
# blog.calendar_template = "calendar.html"
# Enable pagination
# blog.paginate = true
# blog.per_page = 10
# blog.page_link = "page/{num}"
blog.custom_collections = {
category: {
link: '/categories/{category}.html',
template: '/category.html'
},
author: {
link: '/authors/{author}.html',
template: '/author.html'
}
}
end
# Contentful CMS
activate :contentful do |f|
f.space = { blogPost: 'yz29ns0gm87z' }
f.access_token = 'f1efe4eae477ec20e80addb6d89c682b51c80bbb09b0dc0c031c773ad3cbfdff'
end
# No layout for XML
page "/feed.xml", layout: false
# No layout for JSON Feed
page "/feed.json", layout: false
# Sets the markdown to Kramdown so Github Pages stops throwing errors
set :markdown_engine, :kramdown
###
# 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
def article_url(article)
"http://ryanmerrill.net/"+article.path.gsub(/\s+/, "")
end
end
configure :build do
# Minify CSS on build
activate :minify_css
# Minify Javascript on build
activate :minify_javascript
# Use relative URLs
activate :relative_assets
end