Skip to content

Commit 23cf170

Browse files
committed
docs(infra): Upgrade Docsy and Hugo
#377
1 parent 7713e9f commit 23cf170

File tree

15 files changed

+188
-517
lines changed

15 files changed

+188
-517
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "themes/docsy"]
2-
path = themes/docsy
3-
url = https://github.com/google/docsy.git

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

config.toml

Lines changed: 108 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,69 @@ title = "Spinnaker"
44
enableRobotsTXT = true
55

66
# Hugo allows theme composition (and inheritance). The precedence is from left to right.
7-
theme = ["docsy"]
7+
theme = ["github.com/google/docsy", "github.com/google/docsy/dependencies"]
8+
# Language configuration
9+
[languages]
10+
[languages.en]
11+
title = "Spinnaker"
12+
description = "Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence."
13+
languageName ="English"
14+
# Weight used for sorting.
15+
weight = 1
16+
17+
# Docsy is now a Go module. Hugo allows theme composition (and inheritance). The precedence is from left to right.
18+
theme = ["github.com/google/docsy", "github.com/google/docsy/dependencies"]
19+
# Sept 2023 If I don't include module.imports.mounts entries, compilation breaks with a lot of "not found" - can't find shortcodes or refs
20+
[module]
21+
proxy = "direct"
22+
23+
[module.hugoVersion]
24+
extended = true
25+
min = "0.110.0"
26+
27+
[[module.imports]]
28+
path = "github.com/google/docsy"
29+
disable = false
30+
31+
[[module.imports.mounts]]
32+
source = "assets"
33+
target = "assets"
34+
35+
[[module.imports.mounts]]
36+
source = "node_modules/bootstrap"
37+
target = "assets/vendor/bootstrap"
38+
39+
[[module.imports.mounts]]
40+
source = "node_modules/@fortawesome/fontawesome-free"
41+
target = "assets/vendor/Font-Awesome"
42+
43+
[[module.imports.mounts]]
44+
source = "i18n"
45+
target = "i18n"
46+
47+
[[module.imports.mounts]]
48+
source = "layouts"
49+
target = "layouts"
50+
51+
[[module.imports.mounts]]
52+
source = "static"
53+
target = "static"
54+
55+
[[module.imports.mounts]]
56+
source = "data"
57+
target = "data"
58+
59+
[[module.imports.mounts]]
60+
source = "node_modules/@fortawesome/fontawesome-free/webfonts"
61+
target = "static/webfonts"
862

63+
[[module.imports]]
64+
path = "github.com/google/docsy/dependencies"
65+
disable = false
66+
67+
[[module.mounts]]
68+
source = "content/en"
69+
target = "content"
970
# Will give values to .Lastmod etc.
1071
enableGitInfo = true
1172

@@ -18,50 +79,16 @@ enableMissingTranslationPlaceholders = true
1879

1980
disableKinds = ["taxonomy", "taxonomyTerm"]
2081

21-
# Highlighting config
82+
# Highlighting config (copied from the docsy example site, tag v0.7.1)
2283
pygmentsCodeFences = true
2384
pygmentsUseClasses = false
2485
# Use the new Chroma Go highlighter in Hugo.
2586
pygmentsUseClassic = false
2687
#pygmentsOptions = "linenos=table"
2788
# See https://help.farbox.com/pygments.html
28-
pygmentsStyle = "tango"
29-
30-
# Configure how URLs look like per section.
31-
[permalinks]
32-
blog = "/:section/:year/:month/:day/:slug/"
33-
34-
## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
35-
# [blackfriday]
36-
# plainIDAnchors = true
37-
# hrefTargetBlank = true
38-
# angledQuotes = false
39-
# latexDashes = true
40-
41-
# Image processing configuration.
42-
[imaging]
43-
resampleFilter = "CatmullRom"
44-
quality = 75
45-
anchor = "smart"
46-
47-
[services]
48-
[services.googleAnalytics]
49-
# Comment out the id to disable the feature described in [params.ui.feedback].
50-
# This ID can be found in Google Analytics -> Admin Panel -> Data Streams -> Spinnaker Website - GA4 -> Measurement ID
51-
id = "G-H0XE7ESBFR"
52-
53-
# Language configuration
54-
55-
[languages]
56-
[languages.en]
57-
title = "Spinnaker"
58-
description = "Multi-cloud continuous delivery for the enterprise"
59-
languageName ="English"
60-
# Weight used for sorting.
61-
weight = 1
89+
pygmentsStyle = "dracula"
6290

6391
[markup]
64-
defaultMarkdownHandler = "goldmark"
6592
[markup.goldmark]
6693
[markup.goldmark.renderer]
6794
unsafe = true
@@ -76,30 +103,54 @@ defaultMarkdownHandler = "goldmark"
76103
attribute = true
77104
autoHeadingID = true
78105
autoHeadingIDType = "github"
79-
[markup.highlight]
80-
codeFences = true
81-
guessSyntax = false
82-
hl_Lines = ""
83-
lineNoStart = 1
84-
lineNos = false
85-
lineNumbersInTable = true
86-
noClasses = true
87-
style = "monokai"
88-
tabWidth = 4
89106
[markup.tableOfContents]
90107
endLevel = 3
91108
ordered = false
92109
startLevel = 2
110+
[markup.highlight]
111+
# See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
112+
style = "dracula"
113+
# these are defaults https://gohugo.io/getting-started/configuration-markup/#highlight
114+
anchorLineNos = false
115+
codeFences = true
116+
hl_Lines = ''
117+
hl_inline = false
118+
lineAnchors = ''
119+
lineNoStart = 1
120+
lineNos = false
121+
lineNumbersInTable = true
122+
noClasses = true
123+
noHl = false
124+
tabWidth = 4
125+
guessSyntax = true
126+
# Set guessSyntax to true if you want your chosen highlight style used for code blocks without a specified language
127+
128+
129+
130+
# Configure how URLs look like per section.
131+
[permalinks]
132+
blog = "/:section/:year/:month/:day/:slug/"
133+
134+
# Image processing configuration.
135+
[imaging]
136+
resampleFilter = "CatmullRom"
137+
quality = 75
138+
anchor = "smart"
139+
140+
# Google Analytics configuration
141+
# https://gohugo.io/templates/internal/#configure-google-analytics
142+
# https://www.docsy.dev/docs/adding-content/feedback/#adding-analytics
143+
googleAnalytics = "G-H0XE7ESBFR"
144+
# Comment out the next line to disable GA tracking.
145+
# This Tag ID can be found in Google Analytics -> Admin Panel -> Data Streams -> Spinnaker Website - GA4 -> Configure Tag Settings
146+
# google_tag_id="GT-W6BN9SN" this was for a custom fix in the site with the older theme version
147+
93148
# Everything below this are Site Params
94149
[params]
95150
copyright = 'Copyright © 2020 The Linux Foundation®. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage">Trademark Usage</a> page. Linux is a registered trademark of Linus Torvalds.'
96151
privacy_policy = "http://www.linuxfoundation.org/privacy"
97152
terms_of_use = "http://www.linuxfoundation.org/terms"
98153

99-
# Comment out the next line to disable GA tracking.
100-
# This Tag ID can be found in Google Analytics -> Admin Panel -> Data Streams -> Spinnaker Website - GA4 -> Configure Tag Settings
101-
google_tag_id="GT-W6BN9SN"
102-
103154
# First one is picked as the Twitter card image if not set on page.
104155
# images = ["images/project-illustration.png"]
105156

@@ -115,28 +166,21 @@ archived_version = false
115166
# The version number for the version of the docs represented in this doc set.
116167
# Used in the "version-banner" partial to display a version number for the
117168
# current doc set.
118-
version = "v1.19"
169+
version = "latest"
119170

120171
# A link to latest version of the docs. Used in the "version-banner" partial to
121172
# point people to the main doc site.
122-
url_latest_version = "https://example.com"
173+
url_latest_version = "https://spinnaker.io/docs/"
123174

124175
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
125176
github_repo = "https://github.com/spinnaker/spinnaker.io"
126177
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
127178
github_project_repo = "https://github.com/spinnaker/spinnaker"
128179

129-
# Specify a value here if your content directory is not in your repo's root directory
130-
# github_subdir = ""
131-
132-
# Google Custom Search Engine ID. Remove or comment out to disable search.
133-
# gcs_engine_id = "011737558837375720776:fsdu1nryfng"
134-
135-
# Enable Algolia DocSearch
136-
algolia_docsearch = false
137-
138180
# Enable Lunr.js offline search
139181
offlineSearch = true
182+
offlineSearchMaxResults = 50
183+
offlineSearchSummaryLength = 200
140184

141185
# Promo Banner variables
142186
[params.promoBanner]
@@ -146,8 +190,6 @@ offlineSearch = true
146190
ctaText = "Browse Playlist"
147191
label = ""
148192

149-
150-
151193
# User interface configuration
152194
[params.ui]
153195
# Enable to show the side bar menu in its compact state.
@@ -169,8 +211,8 @@ footer_about_disable = false
169211
[params.ui.feedback]
170212
enable = false
171213
# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful).
172-
yes = 'Glad to hear it! Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.'
173-
no = 'Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.'
214+
yes = 'Glad to hear it! Please <a href="https://github.com/spinnaker/spinnaker.io/issues/new">tell us how we can improve</a>.'
215+
no = 'Sorry to hear that. Please <a href="https://github.com/spinnaker/spinnaker.io/issues/new">tell us how we can improve</a>.'
174216

175217
# Adds a reading time to the top of each doc.
176218
# If you want this feature, but occasionally need to remove the Reading time from a single page,
@@ -179,22 +221,6 @@ no = 'Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY
179221
enable = false
180222

181223
[params.links]
182-
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
183-
# [[params.links.user]]
184-
# name = "User mailing list"
185-
# url = "https://example.org/mail"
186-
# icon = "fa fa-envelope"
187-
# desc = "Discussion and help from your fellow users"
188-
# [[params.links.user]]
189-
# name ="Twitter"
190-
# url = "https://example.org/twitter"
191-
# icon = "fab fa-twitter"
192-
# desc = "Follow us on Twitter to get the latest news!"
193-
# [[params.links.user]]
194-
# name = "Stack Overflow"
195-
# url = "https://example.org/stack"
196-
# icon = "fab fa-stack-overflow"
197-
# desc = "Practical questions and curated answers"
198224
# Developer relevant links. These will show up on right side of footer and in the community page if you have one.
199225
[[params.links.developer]]
200226
name = "GitHub"
@@ -234,55 +260,3 @@ enable = false
234260
weight = 50
235261
url = "https://github.com/spinnaker"
236262
pre = "<i class='fab fa-github'></i>"
237-
# Add your release versions here
238-
239-
240-
# baseURL = "/"
241-
# languageCode = "en-us"
242-
# title = "Spinnaker"
243-
# disableKinds = ["taxonomy", "taxonomyTerm"]
244-
# theme = "docsy-master"
245-
246-
# Settings for goldmark markdown processing
247-
# [markup]
248-
# [markup.goldmark]
249-
# [markup.goldmark.renderer]
250-
# unsafe = true
251-
252-
# Image processing configuration.
253-
# [imaging]
254-
# resampleFilter = "CatmullRom" # use standard Box processor for now
255-
# quality = 75
256-
# anchor = "smart"
257-
# disableDate = false
258-
# disableLatLong = false
259-
260-
# main menu
261-
# [[menu.main]]
262-
# name = "Home"
263-
# url = "/"
264-
# weight = 1
265-
266-
# [[menu.main]]
267-
# name = "Getting Started"
268-
# url = "/en/getting-started/"
269-
# weight = 1
270-
#
271-
# [[menu.main]]
272-
# name = "Docs"
273-
# url = "/en/docs/"
274-
# weight = 2
275-
#
276-
# [[menu.main]]
277-
# name = "Community"
278-
# url = "/en/docs/community/"
279-
# weight = 3
280-
#
281-
# [[menu.main]]
282-
# name = "Blog"
283-
# url = "https://blog.spinnaker.io/"
284-
# weight = 4
285-
#
286-
# [permalinks]
287-
# post = "/:year/:month/:day/:slug/"
288-
# pages = "/:filename/"

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/spinnaker/spinnaker.io
2+
3+
go 1.19
4+
5+
require github.com/google/docsy v0.7.1 // indirect

go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
2+
github.com/google/docsy v0.7.1 h1:DUriA7Nr3lJjNi9Ulev1SfiG1sUYmvyDeU4nTp7uDxY=
3+
github.com/google/docsy v0.7.1/go.mod h1:JCmE+c+izhE0Rvzv3y+AzHhz1KdwlA9Oj5YBMklJcfc=
4+
github.com/google/docsy/dependencies v0.7.1/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4=
5+
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

0 commit comments

Comments
 (0)