-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.rb
84 lines (65 loc) · 2.23 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
require 'slim'
# General configuration --------------------------------------------------------
activate :dotenv
# Set Markdown engine to use redcarpet
set :markdown_engine, :redcarpet
set :markdown, fenced_code_blocks: true,
autolink: true,
smartypants: true,
hard_wrap: true,
smart: true,
superscript: true,
no_intra_emphasis: true,
lax_spacing: true,
with_toc_data: true
activate :directory_indexes
# Helpers ----------------------------------------------------------------------
require "lib/typography_helpers"
helpers TypographyHelpers
require_relative './lib/build_cleaner'
# Page options -----------------------------------------------------------------
# Pages without layout
page "*.xml", layout: false
page "*.json", layout: false
page "*.txt", layout: false
# Catch-all for other routes
page "*.html", layout: "layouts/base"
# Webpack configuration --------------------------------------------------------
ignore "assets/**/*.css"
ignore "assets/**/*.js"
# Development configuration --------------------------------------------------------
# Reload the browser automatically whenever files change
configure :development do
set :env, "development"
set :enable_sw, false
set :google_maps_key, nil
activate :livereload
end
# Build-specific configuration -------------------------------------------------
configure :build do
activate :build_cleaner
set :env, "production"
set :google_maps_key, "AIzaSyBdI51q8kJ9s19RmWunLFFUZKFTxDXTSBA"
activate :asset_hash, ignore: %w{
opengraph.png
*touch-icon*.*
service-worker.js
*.xml
*.txt
*.json
favicon.ico
}
end
dev_server_task = :enable_sw == true ? "npm run watch:sw" : "npm run watch"
activate :external_pipeline,
name: :webpack,
command: build? ? "npm run build" : dev_server_task,
source: ".tmp/dist",
latency: 1
# Deployment configuration -----------------------------------------------------
# Deploy to GitHub Pages
activate :deploy do |config|
config.deploy_method = :git
config.branch = "gh-pages"
config.build_before = true
end