forked from splashkit/splashkit.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
112 lines (91 loc) · 2.8 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
###
# Compass
###
# Change Compass configuration
# compass_config do |config|
# config.output_style = :compact
# end
###
# Helpers
###
# Automatic image dimensions on image_tag helper
activate :automatic_image_sizes
# Activate 'blogging' to generate guides
activate :blog do |guide|
guide.prefix = 'articles/guides'
guide.default_extension = '.md'
guide.permalink = 'tags/{tags}/{title}.html'
guide.layout = :'articles/guides'
guide.tag_template = "#{guide.prefix}/tag_template.html"
end
# Reload the browser automatically whenever files change
configure :development do
activate :livereload
end
# Methods defined in the helpers block are available in templates
helpers do
# Require all functions in the helpers directory
require_all 'lib/helpers'
end
# All overrides for core extensions
require_all 'lib/core_ext'
# Activate sprokets + compass
activate :sprockets
# Import CSS/SCSS
set :css_dir, 'stylesheets'
activate :autoprefixer
# Import JavaScript
set :js_dir, 'javascripts'
# Set the image directory to be ./images
set :images_dir, 'images'
# Partials must be from partials directory
set :partials_dir, 'partials'
# Activate markdown using Redcarpet parsing engine and syntax highlighting
set :markdown_engine, :redcarpet
set :markdown, fenced_code_blocks: true, smartypants: true, tables: true
activate :syntax
# Pretty index directory structure
activate :directory_indexes
# 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
end
###
# Page options, layouts, aliases and proxies
###
# Specify the root layout to index
page '/index.html', layout: :index
# Specify layouts for subdirectories of articles _in order_ of application
page '/articles/installation/**/step*', layout: :'articles/installation'
page '/articles/installation/*', layout: :'articles/index'
page '/articles/guides/index.html', layout: :'articles/index'
page '/articles/guides/tags/*', layout: :'articles/guides'
page '/articles/guides/tags/**/*', layout: :'articles/guides'
page '/articles/contributing/*', layout: :'articles/index'
page '/articles/index.html', layout: :'articles/index'
# API proxy pages
data.api.each do |api_group, data|
name = api_group.to_human_case
types = (data.typedefs + data.structs + data.enums).sort_by { |h| h[:name] }
locals = {
raw_api_data: data,
api_group: api_group,
name: name,
types: types,
functions: data.functions,
defines: data.defines,
description: data.description,
brief: data.brief
}
proxy_url = "#{path_for_group(api_group)}/index.html"
proxy proxy_url,
'/api/template.html',
locals: locals,
ignore: true,
layout: :'api/index'
end