forked from johokaigi/johokaigi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.rb
128 lines (107 loc) · 3.31 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Time.zone = 'Tokyo' # rubocop:disable all
activate :directory_indexes
activate :blog do |blog|
blog.name = 'articles'
blog.prefix = 'articles'
blog.layout = 'article_layout'
blog.permalink = '/{year}/{month}/{day}/{title}.html'
blog.sources = '/items/{year}-{month}-{day}-{title}.html'
blog.new_article_template = 'article_template.erb'
blog.default_extension = '.md'
blog.custom_collections = {
category: {
link: '/categories/{category}.html',
template: '/articles/category.html'
}
}
end
activate :blog do |blog|
blog.name = 'sessions'
blog.prefix = 'sessions'
blog.layout = 'sessions_layout'
blog.permalink = '/{year}/{month}/{day}/{title}.html'
blog.sources = '/items/{year}-{month}-{day}-{title}.html'
blog.new_article_template = 'sessions_template.erb'
blog.default_extension = '.md'
end
activate :blog do |blog|
blog.name = 'tips'
blog.prefix = 'tips'
blog.layout = 'tips_layout'
blog.permalink = '/{title}.html'
blog.sources = '/items/{title}.html'
blog.new_article_template = 'tips_template.erb'
blog.default_extension = '.md'
end
page 'sitemap.xml', layout: 'xml_layout'
helpers do
def page_title
if current_page.data.title
"#{current_page.data.title} | プロダクトマネージャー・カンファレンス 2016"
elsif yield_content(:title)
"#{yield_content(:title)} | プロダクトマネージャー・カンファレンス 2016"
else
'プロダクトマネージャー・カンファレンス 2016 | 10/24~10/25'
end
end
def page_description
if current_page.data.description
current_page.data.description
elsif yield_content(:description)
yield_content(:description)
else
'プロダクトマネージャー・カンファレンス 2016 - プロダクトマネージャーが日本を救う'
end
end
def page_url
"http://pmconfjp.github.io/pmconf2016/#{current_page.url}"
end
def jobs
arr = []
data.jobs.each { |j| arr << j }
arr
end
def members
arr = []
data.staff.organizers.each { |o| arr << o }
arr
end
# rubocop:disable all
def speakers
arr = []
data.speakers.keynotes.each { |spk| arr << spk }
data.speakers.specials.each { |sps| arr << sps }
data.speakers.staffs.each { |spst| arr << spst }
data.speakers.sponsors.each { |spsp| arr << spsp }
arr
end
def sponsors
arr = []
data.sponsors.platinas.each { |sp| arr << sp }
data.sponsors.golds.each { |sg| arr << sg }
data.sponsors.sivers.each { |ss| arr << ss }
data.sponsors.drinks.each { |sd| arr << sd }
data.sponsors.media.each { |sm| arr << sm }
data.sponsors.goods.each { |sgo| arr << sgo }
arr
end
end
# rubocop:enable all
set :images_dir, 'assets/images'
configure :development do
activate :livereload
end
configure :build do
activate :relative_assets
end
activate :deploy do |deploy|
deploy.deploy_method = :git
deploy.branch = 'gh-pages'
deploy.remote = "https://#{ENV['GH_TOKEN']}@github.com/pmconfjp/pmconfjp2016.git" # rubocop:disable all
deploy.build_before = true
end
activate :external_pipeline,
name: :webpack,
command: build? ? './node_modules/webpack/bin/webpack.js -p --bail' : './node_modules/webpack/bin/webpack.js --watch -d', # rubocop:disable all
source: '.tmp/dist',
latency: 1