-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.rb
73 lines (55 loc) · 1.59 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
activate :directory_indexes
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
configure :development do
set :debug_assets, true
end
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
activate :minify_css
# Minify Javascript on build
activate :minify_javascript
# Enable cache buster
activate :asset_hash
# Use relative URLs
activate :relative_assets
# Or use a different image path
# set :http_prefix, "/Content/images/"
set :relative_links, true
end
activate :deploy do |deploy|
deploy.method = :git
deploy.build_before = true
end
helpers do
def talk_row(id)
talk = talk_by_id(id)
"#{talk_title(talk)}|[#{talk.speaker.name}](##{id})"
end
def lt_row(id)
talk = talk_by_id(id)
"#{talk.speaker.name}|#{talk_title(talk)}"
end
def talk_by_id(id)
data.talks.detect {|talk| talk.id == id } || raise("Missing talk: id='#{id}'")
end
def talk_title(talk, with_name: false)
title = [talk.title]
title << ' - ' << talk.speaker.name if with_name
title << ' ' << link_to('(資料)', talk.slide_url, target: '_blank') if talk.slide_url
title << ' ' << link_to('(動画)', talk.movie_url, target: '_blank') if talk.movie_url
title.join
end
def heading_with_link(tag, id, text)
content_tag(tag, id: id, class: 'heading') do
heading_link = content_tag(:span, class: 'heading-link') do
link_to("##{id}") do
content_tag(:i, '', class: 'fa fa-link')
end
end
"#{text}#{heading_link}"
end
end
end