forked from CocoaPods/guides.cocoapods.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
84 lines (64 loc) · 2.05 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
# Layouts
require "lib/breaking_source.rb"
require "lib/add_links_to_navigation.rb"
# Tools for generating data
require "lib/navigation_helpers.rb"
require "lib/html_helpers.rb"
require 'lib/doc/code_objects'
set :encoding, 'utf-8'
set :relative_links, true
# Support for browsing from the build folder.
set :strip_index_file, false
configure :build do
activate :sprockets
activate :minify_javascript
activate :minify_css
activate :relative_assets
end
set :markdown, :tables => true, :autolink => true, :gh_blockcode => true, :fenced_code_blocks => true, :with_toc_data => true
set :markdown_engine, :redcarpet
activate :automatic_image_sizes
activate :rouge_syntax
activate :breaking_source
activate :add_links_to_navigation
helpers NavigationHelpers
helpers HTMLHelpers
configure :development do
activate :livereload
end
helpers do
def shared_partial(*sources)
sources.inject([]) do |combined, source|
combined << partial("../shared/includes/#{source}",:locals => { :guides => true })
end.join
end
end
# Allow shared assets folder to not be in source, thereby not dragging in every asset
after_configuration do
sprockets.append_path "../shared/img"
sprockets.append_path "../shared/js"
sprockets.append_path "../shared/fonts"
sprockets.append_path "../shared/includes"
sprockets.append_path "../shared/sass"
end
navigation_data = {
'dsl' => [
{ :name => "podfile", :title => "Podfile Syntax Reference" },
{:name => "podspec", :title => "Podspec Syntax Reference"}
],
}
content_for :dsl_data do navigation_data * '<br>' end
# Dynamic pages for documentation, Pod, command line
navigation_data['dsl'].each do |dsl|
name = dsl[:name]
title = dsl[:title]
proxy "syntax/#{name}.html", "templates/dsl.html", {
:locals => { :name => name, :page_title => title, :fullwidth => true},
:ignore => true
}
end
proxy "terminal/commands.html", "templates/commands.html", {
:locals => { :name => 'commands', :page_title => "Command-line Reference", :fullwidth => true },
:ignore => true
}
data.store("site", "guides")