-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.rb
120 lines (95 loc) · 3.08 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
# Use kramdown for md rendering
set :markdown_engine, :kramdown
# Set time zone
set :time_zone, 'America/Los_Angeles'
# Per-page layout changes
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
###
## Asset settings
###
# Sprockets asset compilation
activate :sprockets
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
# Autoprefixer extension
activate :autoprefixer do |prefix|
prefix.browsers = 'last 2 versions'
end
###
## Blog settings
###
activate :blog do |blog|
blog.prefix = '/blog'
blog.sources = '{year}-{month}-{day}-{title}.html'
blog.permalink = '{year}/{month}/{day}/{title}.html'
blog.taglink = 'tags/{tag}.html'
blog.layout = 'article'
blog.summary_separator = /(READMORE)/
blog.summary_length = 250
blog.year_link = '{year}.html'
blog.month_link = '{year}/{month}.html'
blog.day_link = '{year}/{month}/{day}.html'
blog.default_extension = 'md'
blog.tag_template = '/blog/tag.html'
blog.calendar_template = '/blog/calendar.html'
blog.paginate = true
blog.per_page = 5
blog.page_link = 'p{num}'
end
# Setup blog feed
page '/blog/feed.xml'
###
## Disqus settings
###
configure :development do
activate :disqus do |d|
# Set Disqus short name for local development. Read the following for more info:
# https://github.com/simonrice/middleman-disqus#important-do-not-use-real-shortnames-during-development
d.shortname = SecureRandom.uuid # replace with your short name for dev
end
end
###
## Google Analytics settings
###
activate :google_analytics do |ga|
ga.tracking_id = 'UA-XXXXXXX-X' # Replace with your property ID.
# Removing the last octet of the IP address (default = false)
# ga.anonymize_ip = false
# Tracking across a domain and its subdomains (default = nil)
# ga.domain_name = 'example.com'
# Tracking across multiple domains and subdomains (default = false)
# ga.allow_linker = false
# Enhanced Link Attribution (default = false)
# ga.enhanced_link_attribution = false
# Log detail messages to the console (default = false)
# ga.debug = false
# Trace debugging will output more verbose information to the console (default = false)
# ga.debug_trace = false
# Disable extension (default = false)
# ga.disable = false
# Testing your implementation without sending hits (default = true) in development
ga.test = true
# Compress the JavaScript code (default = false)
# ga.minify = false
# Output style - :html includes <script> tag (default = :html)
# ga.output = :js
end
###
## Syntax highlighting for code samples
###
activate :syntax
# Build-specific configuration
# https://middlemanapp.com/advanced/configuration/#environment-specific-settings
configure :build do
activate :minify_css
activate :minify_javascript
# Set production settings for Disqus
activate :disqus do |d|
# Set Disqus short name for production. Read the following for more info:
# https://github.com/simonrice/middleman-disqus#important-do-not-use-real-shortnames-during-development
d.shortname = nil # replace with your short name for prod
end
end