From d62e3b0899788fed6662ceb9f227ce2d53a4da09 Mon Sep 17 00:00:00 2001 From: Kent Rancourt Date: Fri, 25 Feb 2022 13:45:12 -0500 Subject: [PATCH] docs: update to latest hugo-theme-techdoc (#1843) Signed-off-by: Kent Rancourt --- .gitmodules | 3 + .../assets/img/favicon.png | Bin docs/assets/scss/brigade.scss | 263 +++++++++++ docs/config.toml | 25 +- docs/content/_index.md | 2 +- docs/layouts/partials/head.html | 41 ++ .../{menu.html => menu/open-menu.html} | 20 +- .../meta/google-analytics-async.html} | 43 +- docs/layouts/partials/prepend-body.html | 1 + .../partials/site-header.html} | 6 +- docs/themes/hugo-theme-techdoc | 1 + docs/themes/techdoc-brigade/.editorconfig | 12 - docs/themes/techdoc-brigade/.gitignore | 2 - docs/themes/techdoc-brigade/LICENSE.md | 20 - .../techdoc-brigade/archetypes/default.md | 10 - .../techdoc-brigade/assets/scss/_brigade.scss | 348 -------------- .../assets/scss/_component.scss | 114 ----- .../techdoc-brigade/assets/scss/_element.scss | 82 ---- .../assets/scss/_flexbox-grid-mixins.scss | 214 --------- .../assets/scss/_normalize.scss | 427 ------------------ .../techdoc-brigade/assets/scss/_project.scss | 179 -------- .../assets/scss/_structure.scss | 45 -- .../assets/scss/_variables.scss | 40 -- .../techdoc-brigade/assets/scss/chroma.scss | 59 --- .../techdoc-brigade/assets/scss/theme.scss | 8 - docs/themes/techdoc-brigade/layouts/404.html | 3 - .../layouts/_default/baseof.html | 28 -- .../layouts/_default/list.html | 6 - .../layouts/_default/single.html | 8 - .../techdoc-brigade/layouts/blog/li.html | 4 - .../techdoc-brigade/layouts/blog/list.html | 8 - .../techdoc-brigade/layouts/blog/single.html | 4 - .../techdoc-brigade/layouts/blog/summary.html | 5 - .../themes/techdoc-brigade/layouts/index.html | 15 - .../layouts/partials/custom-head.html | 0 .../layouts/partials/edit-meta.html | 5 - .../layouts/partials/edit-page.html | 3 - .../layouts/partials/footer.html | 38 -- .../layouts/partials/last-updated.html | 1 - .../layouts/partials/main-footer.html | 0 .../layouts/partials/main-menu.html | 22 - .../layouts/partials/menu.html | 58 --- .../layouts/partials/meta/chroma.html | 1 - .../partials/meta/google-analytics-async.html | 11 - .../meta/google-site-verification.html | 5 - .../layouts/partials/meta/tag-manager.html | 9 - .../layouts/partials/notification.html | 0 .../layouts/partials/pagination.html | 44 -- .../layouts/partials/powered.html | 1 - .../layouts/partials/sidebar-footer.html | 0 .../layouts/partials/sidebar.html | 6 - .../techdoc-brigade/layouts/posts/list.html | 6 - .../techdoc-brigade/layouts/posts/single.html | 6 - .../layouts/shortcodes/button.html | 3 - .../layouts/shortcodes/panel.html | 10 - docs/themes/techdoc-brigade/theme.toml | 13 - 56 files changed, 343 insertions(+), 1945 deletions(-) create mode 100644 .gitmodules rename docs/{themes/techdoc-brigade => }/assets/img/favicon.png (100%) create mode 100644 docs/assets/scss/brigade.scss create mode 100644 docs/layouts/partials/head.html rename docs/layouts/partials/{menu.html => menu/open-menu.html} (60%) mode change 100755 => 100644 rename docs/{themes/techdoc-brigade/layouts/partials/head.html => layouts/partials/meta/google-analytics-async.html} (55%) mode change 100755 => 100644 create mode 100644 docs/layouts/partials/prepend-body.html rename docs/{themes/techdoc-brigade/layouts/partials/header.html => layouts/partials/site-header.html} (85%) mode change 100755 => 100644 create mode 160000 docs/themes/hugo-theme-techdoc delete mode 100755 docs/themes/techdoc-brigade/.editorconfig delete mode 100755 docs/themes/techdoc-brigade/.gitignore delete mode 100755 docs/themes/techdoc-brigade/LICENSE.md delete mode 100755 docs/themes/techdoc-brigade/archetypes/default.md delete mode 100644 docs/themes/techdoc-brigade/assets/scss/_brigade.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/_component.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/_element.scss delete mode 100644 docs/themes/techdoc-brigade/assets/scss/_flexbox-grid-mixins.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/_normalize.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/_project.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/_structure.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/_variables.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/chroma.scss delete mode 100755 docs/themes/techdoc-brigade/assets/scss/theme.scss delete mode 100755 docs/themes/techdoc-brigade/layouts/404.html delete mode 100755 docs/themes/techdoc-brigade/layouts/_default/baseof.html delete mode 100755 docs/themes/techdoc-brigade/layouts/_default/list.html delete mode 100755 docs/themes/techdoc-brigade/layouts/_default/single.html delete mode 100755 docs/themes/techdoc-brigade/layouts/blog/li.html delete mode 100755 docs/themes/techdoc-brigade/layouts/blog/list.html delete mode 100755 docs/themes/techdoc-brigade/layouts/blog/single.html delete mode 100755 docs/themes/techdoc-brigade/layouts/blog/summary.html delete mode 100755 docs/themes/techdoc-brigade/layouts/index.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/custom-head.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/edit-meta.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/edit-page.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/footer.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/last-updated.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/main-footer.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/main-menu.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/menu.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/meta/chroma.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/meta/google-analytics-async.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/meta/google-site-verification.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/meta/tag-manager.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/notification.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/pagination.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/powered.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/sidebar-footer.html delete mode 100755 docs/themes/techdoc-brigade/layouts/partials/sidebar.html delete mode 100755 docs/themes/techdoc-brigade/layouts/posts/list.html delete mode 100755 docs/themes/techdoc-brigade/layouts/posts/single.html delete mode 100755 docs/themes/techdoc-brigade/layouts/shortcodes/button.html delete mode 100755 docs/themes/techdoc-brigade/layouts/shortcodes/panel.html delete mode 100755 docs/themes/techdoc-brigade/theme.toml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..76c1b78e7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/themes/hugo-theme-techdoc"] + path = docs/themes/hugo-theme-techdoc + url = https://github.com/thingsym/hugo-theme-techdoc.git diff --git a/docs/themes/techdoc-brigade/assets/img/favicon.png b/docs/assets/img/favicon.png similarity index 100% rename from docs/themes/techdoc-brigade/assets/img/favicon.png rename to docs/assets/img/favicon.png diff --git a/docs/assets/scss/brigade.scss b/docs/assets/scss/brigade.scss new file mode 100644 index 000000000..3fac8c4bf --- /dev/null +++ b/docs/assets/scss/brigade.scss @@ -0,0 +1,263 @@ +@font-face { + font-family: 'work_sansregular'; + font-style: normal; + font-weight: 400; + src: url('../fonts/worksans-regular-webfont.eot'); + src: url('../fonts/worksans-regular-webfont.eot?#iefix') format("embedded-opentype"), + url('../fonts/worksans-regular-webfont.woff') format('woff'), + url('../fonts/worksans-regular-webfont.ttf') format('truetype'); +} + +$colord: #277a9f; +$colorm: #37b0e7; +$colorl: #EFF4F5; +$boxl: #E4ECE8; +$boxd: #9AAACD; +$text: #647B83; +$work: 'work_sansregular', 'Helvetica Neue', Helvetica, Arial, Geneva, sans-serif; + +:root { + font-family: $work; +} + +header { + // Put this border back after the "sticky banner" is eventually removed. + // border-top: 4px solid $colorm; + background: $boxl; + background: -webkit-linear-gradient(left, $boxl, $boxd); + background: -moz-linear-gradient(left, $boxl, $boxd); + background: linear-gradient(to right, $boxl, $boxd); + padding: 0px; + + // This sticky banner should be removed when the v1 support window ends. + section.sticky-banner { + background: $colorm; + color: #ffffff; + font-size: 0.925em; + line-height: 1; + padding: 0.75em 0 0.5em; + text-align: center; + a { + color: #ffffff; + text-decoration: underline; + } + } + + // Logo + h1 { + background: url('../img/brigade.png') no-repeat 0 0; + background-size: contain; + display: block; + font-size: 0; + width: 197px; + height: 78px; + margin: 20px 45px 10px 45px; + } +} + +// Note that in the Techdoc theme, the menu is NOT a child of the
+// element. +div.global-menu { + background: $boxl; + background: -webkit-linear-gradient(left, $boxl, $boxd); + background: -moz-linear-gradient(left, $boxl, $boxd); + background: linear-gradient(to right, $boxl, $boxd); + nav { + left: 0; + padding-right: 45px; + position: absolute; + text-align: right; + top: 4.75em; + width: 100%; + ul { + li { + margin: 0 0 0 30px; + a { + color: $colord; + font-size: 1.125em; + } + } + } + } +} + +div.sidebar { + background: #f6f9fa; + max-width: 300px !important; + nav { + padding-top: 1em; + ul { + li { + a { + border: none; + color: $colord; + transition: all 0.3s ease-in-out; + &:hover { + background: $colorl !important; + border-left: 0px solid #ccc !important; + } + } + &.active a { + background: $colorl !important; + border-left: 0px solid #ccc !important; + color: $colorm !important; + } + ul { + li { + a { + color: $text; + font-size: 0.95em; + } + } + } + } + } + } +} + +main { + color: $text; + margin-left: auto !important; + margin-right: auto !important; + + // This styles links in the main body of the page and specifically excludes + // header anchor links and links in the footer (which, in the Techdoc theme, + // is a child of the
element). + p:not(.powered), ul, nav.pagination { + a { + color: $colorm; + position: relative; + transition: all 0.3s ease-in-out; + &:after { + background: $colorm; + bottom: -2px; + content: " "; + display: block; + height: 3px; + left: 50%; + opacity: 0; + position: absolute; + transition: all 0.3s ease-in-out; + width: 10%; + } + &:hover { + text-decoration: none; + } + &:hover:after { + left: 0; + opacity: 1; + width: 100%; + } + } + } + + blockquote { + background: $boxl; + border-radius: 0.667rem; + } + + footer { + padding: 4rem 0 1.5rem; + a, p { + // TODO: This color doesn't seem to be applied. + color: #aaa; + } + a { + text-decoration: underline; + } + } + + h1, h2, h3, h4, h5, h6 { + font-family: $work; + } + + h1 { + color: $colord; + font-size: 2em; + } + + h2 { + color: $colorm; + font-size: 1.5em; + } + + h3 { + font-size: 1.17em; + } + + h2, h3, h4, h5, h6 { + a.headerlink { + opacity: 0; + transition: all 0.3s ease-in-out; + } + &:hover { + color: $colord; + a.headerlink { + opacity: 1; + left: -1.75em; + } + } + } + + pre { + background: $boxl; + border-radius: 0.667rem; + line-height: 1.4; + margin-top: 1.5rem; + margin-bottom: 1.5rem; + } +} + +// For wide viewports, prevent the content from getting too wide. +@media only screen and (min-width: 1300px) { + main { + max-width: 1000px !important; + } +} + +// For viewports narrower than 600px, the logo and the global menu overlap. +// The global menu isn't actually terribly important, so we just hide it and +// center the logo. Note that 600px is ABOVE the 480px threshold where we fully +// swap to the mobile layout. +@media only screen and (max-width: 600px) { + header h1 { + margin-left: auto; + margin-right: auto; + } + + div.global-menu nav { + display: none; + } +} + +// For very narrow viewports (small mobile devices, presumably), we push the +// sidebar menu down below the content and allow the content to use the full +// width of the viewport. +@media only screen and (max-width: 480px) { + div.sidebar { + max-width: auto !important; + min-width: 100% !important; + nav { + border-top: 12px solid #ccc; + bottom: auto; + left: auto; + max-width: auto !important; + min-width: 100% !important; + overflow-y: auto; + position: relative; + top: auto; + z-index: 1500; + ul { + padding-bottom: 0.25rem; + li { + a { + line-height: 2.25; + } + } + } + } + } + main { + max-width: 100% !important; + } +} diff --git a/docs/config.toml b/docs/config.toml index ec4a97376..bb41d97c3 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -1,37 +1,34 @@ baseURL = "https://docs.brigade.sh/" title = "Brigade Docs" -theme = "techdoc-brigade" +theme = "hugo-theme-techdoc" canonifyURLs = "true" relativeURLs = "true" [params] title = "Brigade" - description = "Brigade: Event-driven scripting for Kubernetes." faviconSizes = [ 16, 32, 48 ] - # Sidebar menu ordering + # Sidebar menu + menu_style = "open-menu" # "open-menu" or "slide-menu" or "" blank is as no sidebar ordersectionsby = "weight" -# top navigation - project links -[[menu.main]] - name = "Docs" - url = "https://docs.brigade.sh" - weight = 1 + # Google Analytics + google_analytics_id = "UA-130516746-5" [[menu.main]] - name = "Examples" - url = "https://github.com/brigadecore/brigade/tree/main/examples" - weight = 2 + name = "Brigade Home" + url = "https://brigade.sh" + weight = 1 [[menu.main]] name = "Blog" url = "https://blog.brigade.sh" - weight = 3 + weight = 2 [[menu.main]] - name = "Github" + name = "GitHub" url = "https://github.com/brigadecore/brigade" - weight = 4 + weight = 3 [markup] [markup.highlight] diff --git a/docs/content/_index.md b/docs/content/_index.md index a326ed0dd..83c2f47e8 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -1,5 +1,5 @@ --- -title: Brigade Documentation +title: Home description: Homepage of the Brigade Documentation --- diff --git a/docs/layouts/partials/head.html b/docs/layouts/partials/head.html new file mode 100644 index 000000000..9925b816c --- /dev/null +++ b/docs/layouts/partials/head.html @@ -0,0 +1,41 @@ + + + +{{- if eq .Title "" }} +{{ .Site.Title }} +{{- else }} +{{ .Title }} - {{ .Site.Title }} +{{- end }} +{{- if ne .Description "" }} + +{{- else if isset .Site.Params "description" }} + +{{- end }} +{{ hugo.Generator }} +{{- range $i := .Site.Params.faviconSizes }} +{{- $favicon := resources.Get "img/favicon.png" }} +{{- $image := $favicon.Resize (printf "%dx%d" $i $i) }} + +{{- end }} +{{- with resources.Get "img/favicon.png" }} +{{- $image := .Resize "180x180" }} + +{{- end }} + + + +{{ $style := resources.Get "scss/brigade.scss" | toCSS | minify | fingerprint }} + + +{{ partial "meta/chroma.html" . -}} + + + + +{{- partial "meta/google-analytics-async.html" . -}} +{{- partial "meta/tag-manager.html" . -}} +{{- partial "meta/google-site-verification.html" . -}} +{{- partial "custom-css.html" . -}} +{{- template "_internal/opengraph.html" . -}} +{{- template "_internal/twitter_cards.html" . -}} +{{- template "_internal/schema.html" . -}} diff --git a/docs/layouts/partials/menu.html b/docs/layouts/partials/menu/open-menu.html old mode 100755 new mode 100644 similarity index 60% rename from docs/layouts/partials/menu.html rename to docs/layouts/partials/menu/open-menu.html index 6d6c21d5c..a8f6a1ced --- a/docs/layouts/partials/menu.html +++ b/docs/layouts/partials/menu/open-menu.html @@ -1,30 +1,30 @@ {{$currentNode := .}} -