This repository has been archived by the owner on Mar 28, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.rb
72 lines (60 loc) · 2.21 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
# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions
activate :sprockets
sprockets.append_path "node_modules"
# Layouts
# https://middlemanapp.com/basics/layouts/
# Per-page layout changes
page "/*.xml", layout: false
page "/*.json", layout: false
page "/*.txt", layout: false
# With alternative layout
# page '/path/to/file.html', layout: 'other_layout'
# Proxy pages
# https://middlemanapp.com/advanced/dynamic-pages/
# proxy(
# '/this-page-has-no-template.html',
# '/template-file.html',
# locals: {
# which_fake_page: 'Rendering a fake page with a local variable'
# },
# )
# Helpers
# Methods defined in the helpers block are available in templates
# https://middlemanapp.com/basics/helper-methods/
helpers do
def root_url
ENV.fetch("URL") { "https://pigci.mikerogers.io" }
end
def current_url
if current_page.url == "/"
root_url + "/"
else
root_url + current_page.url[0..].sub(".html", "")
end
end
end
# Build-specific configuration
# https://middlemanapp.com/advanced/configuration/#environment-specific-settings
activate :syntax
configure :build do
activate :asset_hash, ignore: %r{^(images|uploads)/.*}
activate :minify_html do |html|
html.remove_multi_spaces = true # Remove multiple spaces
html.remove_comments = true # Remove comments
html.remove_intertag_spaces = false # Remove inter-tag spaces
html.remove_quotes = false # Remove quotes
html.simple_doctype = false # Use simple doctype
html.remove_script_attributes = false # Remove script attributes
html.remove_style_attributes = true # Remove style attributes
html.remove_link_attributes = true # Remove link attributes
html.remove_form_attributes = false # Remove form attributes
html.remove_input_attributes = false # Remove input attributes
html.remove_javascript_protocol = true # Remove JS protocol
html.remove_http_protocol = false # Remove HTTP protocol
html.remove_https_protocol = false # Remove HTTPS protocol
html.preserve_line_breaks = false # Preserve line breaks
html.simple_boolean_attributes = true # Use simple boolean attributes
html.preserve_patterns = nil # Patterns to preserve
end
end