-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.rb
59 lines (44 loc) · 1.12 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
require './lib/talk'
Time.zone = 'Pacific/Auckland'
set :project_name, "NZ Ruby Talks"
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
set :markdown_engine, :redcarpet
set :markdown, fenced_code_blocks: true, smartypants: true, autolink: true
activate :syntax
activate :blog do |blog|
blog.permalink = ":year/:title.html"
blog.sources = "talks/:year/:month-:day-:title.html"
blog.publish_future_dated = true
end
# Use directory indexes, for pretty URLs
activate :directory_indexes
helpers do
def project_name
config[:project_name]
end
def page_title(separator: " – ")
[current_page.data.title, project_name].compact.join(separator)
end
def talks
Talk.all(sitemap.resources)
end
def current_talk
Talk.new(current_page)
end
def upcoming(date = nil, &block)
date ||= current_talk.date
content = capture(&block)
tag = content_tag(:div, content, {
class: 'upcoming',
data: { datetime: date.iso8601 }
})
concat(tag)
end
end
configure :build do
activate :minify_css
activate :minify_javascript
activate :asset_hash
end