-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.rb
executable file
·71 lines (61 loc) · 1.7 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
require "extensions/views"
activate :blog do |blog|
blog.name = "posts"
blog.prefix = "posts"
blog.layout = "page"
blog.permalink = "/{year}/{title}.html"
end
activate :blog do |blog|
blog.name = "projects"
blog.prefix = "projects"
blog.permalink = "{title}.html"
end
page "/projects/*", :layout => "media"
activate :views
activate :directory_indexes
activate :autoprefixer
activate :syntax
set :markdown_engine, :kramdown
set :markdown, :parse_block_html => true,
:smart_quotes => ["lsquo", "rsquo", "ldquo", "rdquo"]
set :haml, :ugly => true
set :relative_links, true
set :css_dir, "assets/stylesheets"
set :js_dir, "assets/javascripts"
set :images_dir, "assets/images"
set :fonts_dir, "assets/fonts"
set :partials_dir, "partials"
set :layout, "layouts/application"
configure :development do
activate :livereload
end
configure :build do
# Relative assets needed to deploy to Github Pages
activate :relative_assets
end
activate :deploy do |deploy|
deploy.build_before = true
deploy.method = :git
deploy.branch = 'master' # default: gh-pages
end
helpers do
def nav_link(link_text, page_url, options = {})
options[:class] ||= ""
if current_page.url.length > 1
current_url = current_page.url.chop
else
current_url = current_page.url
end
options[:class] << " active" if page_url == current_url
link_to(link_text, page_url, options)
end
def media_block(images)
if images.is_a? Array
partial(:media_block, :locals => { :media => images })
elsif images.is_a? String
partial(:media_block, :locals => { :media => [images] })
else
return false
end
end
end