summaryrefslogtreecommitdiff
path: root/soupault.toml
blob: c506ce0ee59e512e147fcdb6d041508672aba98c (plain)
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Configuration file for the soupault static site generator (https://soupault.app)

[settings]
  # Enable build progress (info level) logs
  verbose = true

  # Enable debug level logs
  debug = true

  # Fail on page processing errors
  strict = true

  default_template_file = "templates/main.html"

  # CSS selector of the element inside the template
  # where page content is inserted
  default_content_selector = "div#content"

  markdown_extensions = ["md"]

  site_url = "https://vyos.net"

[index]
  dump_json = "index.json"

[widgets]

# Moves all elements with class="footnote" or tag name <fn> to <div id="footnotes"> 
# and replaces them with numbered links.
[widgets.footnotes]
  widget = "footnotes"
  selector = "div#footnotes"
  footnote_selector = [".footnote", "fn"]
  footnote_link_class = "footnote"
  back_links = true
  link_id_prepend = "footnote-"
  back_link_id_append = "-ref"

# Inserts the banner in main page only
[widgets.insert-banner]
  widget = "include"
  page = "index.html"
  file = "templates/banner.html"
  selector = "main"
  action = "insert_before"

# Cookiebot consent banner — must be synchronous (no `async`) so the browser
# blocks on it before parsing GTM's inline bootstrap script. With `async`,
# the GTM snippet would execute before Cookiebot sets consent state.
#
# `after = "insert-google-tag-manager-head"` controls soupault execution order,
# not DOM order: GTM widget runs first (prepends GTM to <head>), then this
# widget runs and prepends Cookiebot — so Cookiebot ends up before GTM in the
# final HTML.
[widgets.insert-cookiebot-loader]
  widget = "insert_html"
  html = """
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="932cb8b9-5141-4dc9-9018-21fc31a0586f" data-blockingmode="auto" type="text/javascript"></script>
"""
  selector = "head"
  action = "prepend_child"
  after = "insert-google-tag-manager-head"
  profile = "live"

[widgets.insert-google-tag-manager-head]
  widget = "insert_html"
  html = """
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://metrics.vyos.io/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T5VQHRT');</script>
<!-- End Google Tag Manager -->
"""
  selector = "head"
  action = "prepend_child"
  profile = "live"

[widgets.insert-google-tag-manager-body]
  widget = "insert_html"
  selector = "body"
  html = """
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://metrics.vyos.io/ns.html?id=GTM-T5VQHRT"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
  """
  action = "prepend_child"
  profile = "live"

[widgets.insert-preconnect-hints]
  widget = "insert_html"
  html = """
<link rel="preconnect" href="https://metrics.vyos.io" crossorigin />
<link rel="preconnect" href="https://consent.cookiebot.com" crossorigin />
"""
  selector = "head"
  action = "prepend_child"
  after = "insert-google-tag-manager-head"
  profile = "live"

# The Cookiebot CookieDeclaration script is injected only on live builds so
# staging visitors who hit /legal/cookies-policy/ don't leak their IP to
# consent.cookiebot.com. The markdown source contains a placeholder div
# (#cookie-declaration-placeholder) that this widget replaces in place.
[widgets.insert-cookiebot-declaration]
  widget = "insert_html"
  page = "legal/cookies-policy.md"
  html = """
<script id="CookieDeclaration" src="https://consent.cookiebot.com/932cb8b9-5141-4dc9-9018-21fc31a0586f/cd.js" type="text/javascript" async></script>
"""
  selector = "#cookie-declaration-placeholder"
  action = "replace_element"
  profile = "live"

# Inserts a scary warning banner in preview versions
[widgets.insert-staging-warning]
  widget = "include"
  file = "templates/staging-warning.html"
  selector = "header"
  action = "prepend_child"
  profile = "staging"

[widgets.disallow-indexing-on-staging]
  widget = "create-file"
  name = "robots.txt"
  content = """
User-agent: *
Disallow: /
"""
  profile = "staging"

## Nightly build image listing generator ##

# Inserts containers for current and equuleus lists
# This is done here rather than inside the page so that
# we can change the branches by editing just the config.
[widgets.insert-nightly-build-containers]
  widget = "insert_html"
  html = """
    <div id="rolling-current">
    </div>
  """
  selector = "#available-builds"
  action = "append_child"
  page = "get/nightly-builds.md"
  profile = "live"

# Generates a list of the "current" branch builds from GitHub releases
[widgets.list-nightly-builds-current]
  widget = "exec"
  command = "scripts/list-nightly-builds.py rolling/current"
  selector = "div#rolling-current"
  action = "append_child"

  page = "get/nightly-builds.md"

  after = "insert-nightly-build-containers"
  profile = "live"


[widgets.release_status]
  page = "status.md"
  widget = "release-status"
  file = "release-status.toml"
  selector = ".content-div"