From c101a836be273a0ae839da96b95e7da172395f44 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Thu, 14 Jul 2022 14:29:54 +1000 Subject: [PATCH] docs: upgrade to doks 0.5.0 (#3689) --- docs/archetypes/blog.md | 8 +- docs/archetypes/docs.md | 1 + docs/assets/images/default-image.png | Bin 0 -> 4694 bytes docs/assets/js/index.js | 13 +- docs/assets/js/to-top.js | 20 ++ docs/assets/scss/common/_dark.scss | 10 + docs/assets/scss/common/_global.scss | 20 +- docs/assets/scss/components/_buttons.scss | 34 +-- docs/assets/scss/components/_images.scss | 16 +- docs/assets/scss/components/_search.scss | 14 +- docs/assets/scss/custom.scss | 5 + docs/assets/scss/layouts/_header.scss | 62 ++++- docs/assets/scss/layouts/_posts.scss | 35 ++- docs/config/_default/config.toml | 23 +- docs/config/_default/languages.toml | 1 + docs/config/_default/params.toml | 19 +- docs/config/postcss.config.js | 5 + .../{financial/index.md => financial.md} | 8 +- .../contributing/prologue/financial/azure.svg | 72 ------ .../contributing/prologue/financial/balto.svg | 90 -------- .../prologue/financial/jetbrains.svg | 66 ------ .../prologue/financial/microsoft.svg | 42 ---- .../en/integration/kubernetes/introduction.md | 2 +- docs/content/en/reference/guides/branding.md | 12 +- docs/data/languages.json | 1 + docs/i18n/en.toml | 2 - docs/i18n/en.yaml | 19 ++ docs/layouts/404.html | 7 +- docs/layouts/_default/baseof.html | 9 +- docs/layouts/_default/list.html | 35 ++- docs/layouts/_default/terms.html | 20 ++ docs/layouts/blog/list.html | 24 -- docs/layouts/blog/single.html | 65 +++++- docs/layouts/contributing/single.html | 12 +- docs/layouts/partials/content/card-image.html | 22 ++ .../layouts/partials/content/figure-blog.html | 37 +++ docs/layouts/partials/content/figure.html | 37 +++ docs/layouts/partials/content/image.html | 32 +++ .../partials/footer/script-footer.html | 6 + docs/layouts/partials/head/custom-head.html | 1 + docs/layouts/partials/head/favicons.html | 4 + docs/layouts/partials/head/head.html | 3 +- docs/layouts/partials/header/header.html | 218 +++++++++--------- docs/layouts/partials/main/blog-meta.html | 2 +- docs/layouts/partials/sidebar/docs-toc.html | 26 ++- docs/layouts/rss.xml | 2 +- docs/netlify.toml | 5 +- docs/package.json | 5 +- docs/pnpm-lock.yaml | 6 + 49 files changed, 682 insertions(+), 496 deletions(-) create mode 100644 docs/assets/images/default-image.png create mode 100644 docs/assets/js/to-top.js rename docs/content/en/contributing/prologue/{financial/index.md => financial.md} (85%) delete mode 100644 docs/content/en/contributing/prologue/financial/azure.svg delete mode 100644 docs/content/en/contributing/prologue/financial/balto.svg delete mode 100644 docs/content/en/contributing/prologue/financial/jetbrains.svg delete mode 100644 docs/content/en/contributing/prologue/financial/microsoft.svg create mode 100644 docs/data/languages.json delete mode 100644 docs/i18n/en.toml create mode 100644 docs/i18n/en.yaml create mode 100644 docs/layouts/_default/terms.html delete mode 100644 docs/layouts/blog/list.html create mode 100644 docs/layouts/partials/content/card-image.html create mode 100644 docs/layouts/partials/content/figure-blog.html create mode 100644 docs/layouts/partials/content/figure.html create mode 100644 docs/layouts/partials/content/image.html create mode 100644 docs/layouts/partials/head/custom-head.html diff --git a/docs/archetypes/blog.md b/docs/archetypes/blog.md index b4ad21a4..24c911bb 100644 --- a/docs/archetypes/blog.md +++ b/docs/archetypes/blog.md @@ -1,11 +1,15 @@ --- title: "{{ replace .Name "-" " " | title }}" description: "" -lead: "" +excerpt: "" date: {{ .Date }} lastmod: {{ .Date }} draft: true weight: 50 -images: ["{{ .Name | urlize }}.jpg"] +images: [] +categories: [] +tags: [] contributors: [] +pinned: false +homepage: false --- diff --git a/docs/archetypes/docs.md b/docs/archetypes/docs.md index 436bd086..8089a43c 100644 --- a/docs/archetypes/docs.md +++ b/docs/archetypes/docs.md @@ -9,6 +9,7 @@ images: [] menu: docs: parent: "" + identifier: "{{ .Name }}-{{ delimit (shuffle (split (md5 .Name) "" )) "" }}" weight: 999 toc: true --- diff --git a/docs/assets/images/default-image.png b/docs/assets/images/default-image.png new file mode 100644 index 0000000000000000000000000000000000000000..a34ff9fcaabbd4b1a78b674908f9ac3c51fab13f GIT binary patch literal 4694 zcmeAS@N?(olHy`uVBq!ia0y~yUU}oXkrghb7(7*O7r?V?XzwM4*1b*PbqpAr*{oZ#arF2rxJpe&O%ow*7ZI zDd%1BeV}p%hDq1J)Fu`M5Z%J*0HQdA8$gtR8UrJcQt)A50#Xh$7+8Q*g8?H4kYY$= z5&%($Mm3HG4lo^zrkv5-0V)qhi;mIa5tI%_>yFX-akTLO%m||mq|w$Rs6ZTTAdNPV uK 40 || document.documentElement.scrollTop > 40) { + topbutton.style.display = 'block'; + } else { + topbutton.style.display = 'none'; + } + +} diff --git a/docs/assets/scss/common/_dark.scss b/docs/assets/scss/common/_dark.scss index 4694fd54..2f772623 100644 --- a/docs/assets/scss/common/_dark.scss +++ b/docs/assets/scss/common/_dark.scss @@ -570,3 +570,13 @@ $navbar-dark-active-color: $link-color-dark; [data-dark-mode] details summary::before { content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28222, 226, 230, 0.75%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); } + +[data-dark-mode] #toc a.active { + color: $link-color-dark; +} + +[data-dark-mode] .btn-light { + color: $link-color-dark; + background: $body-overlay-dark; + border: 1px solid $body-overlay-dark; +} diff --git a/docs/assets/scss/common/_global.scss b/docs/assets/scss/common/_global.scss index 8fa8b2f9..e38e8464 100644 --- a/docs/assets/scss/common/_global.scss +++ b/docs/assets/scss/common/_global.scss @@ -4,7 +4,9 @@ .error404 .content, .docs.list .content, .tutorial.list .content, -.showcase.list .content { +.showcase.list .content, +.categories.list .content, +.tags.list .content { padding-top: 1rem; padding-bottom: 3rem; } @@ -130,6 +132,10 @@ body { z-index: 1000; height: calc(100vh - 4rem); } + + .docs-sidebar-top { + top: 0; + } } } @@ -173,6 +179,10 @@ body { height: calc(100vh - 4rem); overflow-y: auto; } + + .docs-toc-top { + top: 0; + } } .docs-content { @@ -206,11 +216,17 @@ body { text-decoration: none; } -#TableOfContents ul { +#TableOfContents ul, +#toc ul { padding-left: 0; list-style: none; } +#toc a.active { + color: $primary; + font-weight: 500; +} + ::selection { background: rgba(212, 53, 159, 0.2); } diff --git a/docs/assets/scss/components/_buttons.scss b/docs/assets/scss/components/_buttons.scss index 235d6ea1..e923ab3a 100644 --- a/docs/assets/scss/components/_buttons.scss +++ b/docs/assets/scss/components/_buttons.scss @@ -4,9 +4,7 @@ } #mode { - padding-right: 0.25rem; - padding-left: 0.25rem; - margin-right: -0.25rem; + padding: 0.5rem; } .btn-link:focus { @@ -18,10 +16,10 @@ margin-left: 1.25rem; } -@include media-breakpoint-up(md) { +@include media-breakpoint-up(lg) { #mode { - margin-left: 1.125rem; - margin-right: -0.375rem; + margin-left: 0.5rem; + margin-right: 0.25rem; } .navbar .btn-link { @@ -187,6 +185,20 @@ pre { color: $link-color; } +.dropdown-menu { + /* + width: 100%; + */ + + width: auto; +} + +@include media-breakpoint-up(lg) { + .dropdown-menu { + width: auto; + } +} + .doks-navbar .dropdown-menu, .doks-subnavbar .dropdown-menu { font-size: 0.875rem; @@ -219,16 +231,6 @@ pre { margin-right: -0.3125rem; } -.dropdown-menu.dropdown-menu-main { - width: 100%; -} - -@include media-breakpoint-up(md) { - .dropdown-menu.dropdown-menu-main { - width: auto; - } -} - .dropdown-menu-main .dropdown-item { color: inherit; font-size: $font-size-base; diff --git a/docs/assets/scss/components/_images.scss b/docs/assets/scss/components/_images.scss index 254eefa0..efe3d1c4 100644 --- a/docs/assets/scss/components/_images.scss +++ b/docs/assets/scss/components/_images.scss @@ -1,5 +1,19 @@ figure { - margin: 2rem 0; + margin: 0 0 1rem; + display: inline-block; +} + +figure img { + margin-bottom: 0.5rem; + line-height: 1; + max-width: 100%; + height: auto; +} + +figure figcaption { + margin: 0.25rem 0 0.75rem; + font-size: 0.875em; + color: #6c757d; } .figure-caption { diff --git a/docs/assets/scss/components/_search.scss b/docs/assets/scss/components/_search.scss index 45ec2aff..531121af 100644 --- a/docs/assets/scss/components/_search.scss +++ b/docs/assets/scss/components/_search.scss @@ -4,10 +4,19 @@ #suggestions { position: absolute; - left: 0; + right: 0; margin-top: 0.5rem; width: calc(100vw - 3rem); + max-width: calc(400px - 3rem); z-index: $zindex-dropdown; + + @include media-breakpoint-up(md) { + right: -2rem; + } + + @include media-breakpoint-up(lg) { + right: 0; + } } #suggestions a, @@ -57,9 +66,10 @@ color: $gray-700; } -@include media-breakpoint-up(sm) { +@include media-breakpoint-up(lg) { #suggestions { width: 31.125rem; + max-width: 31.125rem; } #suggestions a { diff --git a/docs/assets/scss/custom.scss b/docs/assets/scss/custom.scss index dda718c2..d536a20b 100644 --- a/docs/assets/scss/custom.scss +++ b/docs/assets/scss/custom.scss @@ -1,3 +1,8 @@ +figure.figure-blog { + display: flex; + justify-content: center; +} + .text-orange { --bs-text-opacity: 1; diff --git a/docs/assets/scss/layouts/_header.scss b/docs/assets/scss/layouts/_header.scss index cb85c32c..a0b4a0a7 100644 --- a/docs/assets/scss/layouts/_header.scss +++ b/docs/assets/scss/layouts/_header.scss @@ -39,6 +39,8 @@ @include media-breakpoint-up(lg) { .navbar { z-index: 1025; + padding-top: 0.25rem; + padding-bottom: 0.25rem; } } @@ -87,13 +89,19 @@ } button#doks-languages { - margin-right: -0.5625rem; - margin-left: 0.75rem; + margin: 0.25rem 0 0; + + @include media-breakpoint-up(lg) { + margin: 0.25rem 0.5rem 0 0.25rem; + } } button#doks-versions { - margin-right: -0.5625rem; - margin-left: 0; + margin: 0.25rem 0 0; + + @include media-breakpoint-up(lg) { + margin: 0.25rem 0.5rem 0 0.25rem; + } } .offcanvas .nav-link { @@ -185,6 +193,14 @@ button#doks-versions { padding-right: 4rem; border: 1px solid transparent; background: $gray-100; + + @include media-breakpoint-up(md) { + width: calc(100% + 2rem); + } + + @include media-breakpoint-up(lg) { + width: 100%; + } } .form-control.is-search:focus { @@ -206,6 +222,14 @@ button#doks-versions { content: "Ctrl + /"; border: 1px solid $gray-300; border-radius: 0.25rem; + + @include media-breakpoint-up(md) { + right: -1.4625rem; + } + + @include media-breakpoint-up(lg) { + right: 0.3125rem; + } } /* @@ -389,6 +413,11 @@ button#doks-versions { .btn-menu { margin-left: 1rem; + border: transparent; +} + +.btn-doks-light { + border: transparent; } .btn-menu, @@ -402,23 +431,29 @@ button#doks-versions { .btn-doks-light:hover, .doks-sidebar-toggle:hover { background: $pink-100; + border: transparent; } .btn-menu:focus, +.btn-doks-light:focus, .doks-sidebar-toggle:focus, .doks-mode-toggle:focus { outline: 0; + border: transparent; } -.doks-sidebar-toggle .doks-collapse { +.doks-sidebar-toggle .doks-collapse, +.doks-toc-toggle .doks-collapse { display: none; } -.doks-sidebar-toggle:not(.collapsed) .doks-expand { +.doks-sidebar-toggle:not(.collapsed) .doks-expand, +.doks-toc-toggle:not(.collapsed) .doks-expand { display: none; } -.doks-sidebar-toggle:not(.collapsed) .doks-collapse { +.doks-sidebar-toggle:not(.collapsed) .doks-collapse, +.doks-toc-toggle:not(.collapsed) .doks-collapse { display: inline-block; } @@ -443,3 +478,16 @@ button#doks-versions { .dropdown-item:active { color: inherit; } + +.social-link { + padding-left: 0.5rem; + + @include media-breakpoint-up(md) { + padding-left: 0; + } + + @include media-breakpoint-up(lg) { + padding-right: 0.5rem; + padding-left: 0.5rem; + } +} diff --git a/docs/assets/scss/layouts/_posts.scss b/docs/assets/scss/layouts/_posts.scss index da276605..27d316ae 100644 --- a/docs/assets/scss/layouts/_posts.scss +++ b/docs/assets/scss/layouts/_posts.scss @@ -1,6 +1,9 @@ .home .card, .contributors.list .card, -.blog.list .card { +.blog.list .card, +.blog.single .card, +.categories.list .card, +.tags.list .card { margin-top: 2rem; margin-bottom: 2rem; transition: transform 0.3s; @@ -8,16 +11,34 @@ .home .card:hover, .contributors.list .card:hover, -.blog.list .card:hover { +.blog.list .card:hover, +.blog.single .card:hover, +.categories.list .card:hover, +.tags.list .card:hover { transform: scale(1.025); } +.contributors.list .card.card-terms:hover, +.categories.list .card.card-terms:hover, +.tags.list .card.card-terms:hover { + transform: none; +} + .home .card-body, .contributors.list .card-body, -.blog.list .card-body { +.blog.list .card-body, +.blog.single .card-body, +.categories.list .card-body, +.tags.list .card-body { padding: 0 2rem 1rem; } +.contributors.list .card-terms .card-body, +.categories.list .card-terms .card-body, +.tags.list .card-terms .card-body { + padding: 1rem; +} + .blog-header { text-align: center; margin-bottom: 2rem; @@ -26,3 +47,11 @@ .blog-footer { text-align: center; } + +.related-posts { + margin-top: 4rem; +} + +h2.section-title { + margin-bottom: 1.25rem; +} diff --git a/docs/config/_default/config.toml b/docs/config/_default/config.toml index 5174a6a0..f301b967 100644 --- a/docs/config/_default/config.toml +++ b/docs/config/_default/config.toml @@ -5,7 +5,6 @@ disableHugoGeneratorInject = true enableEmoji = true enableGitInfo = true enableRobotsTXT = true -languageCode = "en-US" paginate = 7 rssLimit = 10 title = "Authelia" @@ -60,6 +59,8 @@ rel = "sitemap" [taxonomies] contributor = "contributors" + category = "categories" + tag = "tags" [permalinks] blog = "/blog/:title/" @@ -67,6 +68,20 @@ rel = "sitemap" [minify.tdewolff.html] keepWhitespace = false +[related] + threshold = 80 + includeNewer = true + toLower = false + [[related.indices]] + name = "categories" + weight = 100 + [[related.indices]] + name = "tags" + weight = 80 + [[related.indices]] + name = "date" + weight = 10 + [module] [module.hugoVersion] extended = true @@ -78,6 +93,9 @@ rel = "sitemap" [[module.mounts]] source = "static" target = "static" + [[module.mounts]] + source = "layouts" + target = "layouts" [[module.mounts]] source = "node_modules/flexsearch" target = "assets/js/vendor/flexsearch" @@ -87,3 +105,6 @@ rel = "sitemap" [[module.mounts]] source = "node_modules/mermaid" target = "assets/js/vendor/mermaid" + [[module.mounts]] + source = "node_modules/@hyas/images/layouts" + target = "layouts" diff --git a/docs/config/_default/languages.toml b/docs/config/_default/languages.toml index 6ee6333f..9d0997c4 100644 --- a/docs/config/_default/languages.toml +++ b/docs/config/_default/languages.toml @@ -4,3 +4,4 @@ weight = 10 [en.params] languageISO = "EN" + languageTag = "en-US" diff --git a/docs/config/_default/params.toml b/docs/config/_default/params.toml index 87181c78..fba983fb 100644 --- a/docs/config/_default/params.toml +++ b/docs/config/_default/params.toml @@ -52,6 +52,17 @@ portraitPhotoWidths = [800, 700, 600, 500] lqipWidth = "20x" smallLimit = "300" +# Images +imageResponsive = true +imageConvertTo = "webp" +imageImageSizes = ["480","720","1080","1280","1600","2048"] +singleSize = false +imageAddClass = "img-fluid lazyload blur-up" + +### Image template +defaultImage = "default-image.png" # put in `./assets/images/` +fillImage = "1270x740 Center" # normalize image size + # Footer footer = "Powered by Netlify, Hugo, and Doks" @@ -71,12 +82,15 @@ docsRepoSubPath = "docs" editPage = true lastMod = true +[sections] + sectionNav = ["docs", "guides"] + [options] lazySizes = true clipBoard = true instantPage = true flexSearch = true - searchSectionsShow = ["overview", "configuration", "integration", "contributing", "reference"] + searchSectionsShow = "ALL" searchSectionsIndex = ["overview", "configuration", "integration", "contributing", "reference", "blog"] darkMode = true bootStrapJs = true @@ -86,6 +100,9 @@ lastMod = true multilingualMode = false docsVersioning = false fullWidth = false + navbarSticky = true + toTopButton = false + scrollSpy = false # experimental; needs Bootstrap >= 5.2.0-beta1 [menu] [menu.section] diff --git a/docs/config/postcss.config.js b/docs/config/postcss.config.js index f9d1a18a..3e0eff86 100644 --- a/docs/config/postcss.config.js +++ b/docs/config/postcss.config.js @@ -22,6 +22,11 @@ module.exports = { 'alert-link', 'container-xxl', 'container-fluid', + 'offcanvas-backdrop', + 'img-fluid', + 'lazyload', + 'blur-up', + 'figcaption', ...whitelister([ './assets/scss/components/_alerts.scss', './assets/scss/components/_buttons.scss', diff --git a/docs/content/en/contributing/prologue/financial/index.md b/docs/content/en/contributing/prologue/financial.md similarity index 85% rename from docs/content/en/contributing/prologue/financial/index.md rename to docs/content/en/contributing/prologue/financial.md index 757925d1..9b7de9e9 100644 --- a/docs/content/en/contributing/prologue/financial/index.md +++ b/docs/content/en/contributing/prologue/financial.md @@ -48,7 +48,7 @@ We are currently directly looking for someone to sponsor: Our [apt repository](https://apt.authelia.com) is hosted thanks to [Balto](https://www.getbalto.com/?from=Authelia). -{{< figure src="balto.svg" alt="Balto" height="50" style="padding-right: 10px" >}} +{{< figure src="/images/logos/balto.svg" alt="Balto" width="193" style="padding-right: 10px" ignoreStaticImages="false" >}} ### Buildkite @@ -63,7 +63,7 @@ Our [localization platform](https://translate.authelia.com) is hosted by [Crowdi Our development IDE's are provided by [JetBrains](https://www.jetbrains.com/?from=Authelia). -{{< figure src="jetbrains.svg" alt="JetBrains" height="50" style="padding-right: 10px" >}} +{{< figure src="/images/logos/jetbrains.svg" alt="JetBrains" width="50" style="padding-right: 10px" ignoreStaticImages="false" >}} ### Microsoft @@ -71,9 +71,9 @@ Our pipeline agents which we rely on for productivity are hosted on [Azure](http and our [git repositories](https://github.com/authelia) are hosted on [GitHub](https://github.com/?from=Authela) which are both [Microsoft](https://www.microsoft.com/?from=Authelia) products. -{{< figure src="microsoft.svg" alt="Microsoft" height="50" style="padding-right: 10px" >}} +{{< figure src="/images/logos/microsoft.svg" alt="Microsoft" width="234.45" style="padding-right: 10px" ignoreStaticImages="false" >}} -{{< figure src="azure.svg" alt="Azure" height="50" style="padding-right: 10px" >}} +{{< figure src="/images/logos/azure.svg" alt="Azure" width="173.55" style="padding-right: 10px" ignoreStaticImages="false" >}} ### Netlify diff --git a/docs/content/en/contributing/prologue/financial/azure.svg b/docs/content/en/contributing/prologue/financial/azure.svg deleted file mode 100644 index cd96a7d3..00000000 --- a/docs/content/en/contributing/prologue/financial/azure.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/docs/content/en/contributing/prologue/financial/balto.svg b/docs/content/en/contributing/prologue/financial/balto.svg deleted file mode 100644 index 69b2b221..00000000 --- a/docs/content/en/contributing/prologue/financial/balto.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/docs/content/en/contributing/prologue/financial/jetbrains.svg b/docs/content/en/contributing/prologue/financial/jetbrains.svg deleted file mode 100644 index 75d4d217..00000000 --- a/docs/content/en/contributing/prologue/financial/jetbrains.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/content/en/contributing/prologue/financial/microsoft.svg b/docs/content/en/contributing/prologue/financial/microsoft.svg deleted file mode 100644 index 54ffab35..00000000 --- a/docs/content/en/contributing/prologue/financial/microsoft.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - diff --git a/docs/content/en/integration/kubernetes/introduction.md b/docs/content/en/integration/kubernetes/introduction.md index e9bd8dbc..dc0afdff 100644 --- a/docs/content/en/integration/kubernetes/introduction.md +++ b/docs/content/en/integration/kubernetes/introduction.md @@ -14,7 +14,7 @@ aliases: - /i/k8s --- -{{< figure src="/images/logos/kubernetes.png" alt="Kubernetes" width="100" style="padding-right: 10px" >}} +{{< figure src="/images/logos/kubernetes.png" alt="Kubernetes" width="100" style="padding-right: 10px" ignoreStaticImages="false" >}} ## UNDER CONSTRUCTION diff --git a/docs/content/en/reference/guides/branding.md b/docs/content/en/reference/guides/branding.md index e24ab1e9..dbff8d47 100644 --- a/docs/content/en/reference/guides/branding.md +++ b/docs/content/en/reference/guides/branding.md @@ -20,12 +20,12 @@ modifications that are in harmony with the following rules which are not intende only intended to preserve the Authelia branding identity: 1. They do not unreasonably alter the quality of the branding: - - Image size changes should be done only when the size is appropriate for the intended display scenario. - - Compression should not be applied overly aggressively for the intended display scenario. + - Image size changes should be done only when the size is appropriate for the intended display scenario. + - Compression should not be applied overly aggressively for the intended display scenario. 2. The changes do not unreasonably alter the design of the branding and should fit one or more of the following categories: - - Layout - - Format + - Layout + - Format Examples of changes which fit these categories include: @@ -52,7 +52,7 @@ The logo is just the Authelia circle logo without any text. #### Logo Example -{{< figure src="/images/branding/logo.svg" link="/images/branding/logo.svg" target="_blank" alt="Authelia Logo" height="150" >}} +{{< figure src="/images/branding/logo.svg" link="/images/branding/logo.svg" target="_blank" alt="Authelia Logo" width="150" ignoreStaticImages="false" >}} ### Title @@ -64,5 +64,5 @@ The title is the Authelia circle logo with the `authelia` branded text. #### Title Example -{{< figure src="/images/branding/title.svg" link="/images/branding/title.svg" target="_blank" alt="Authelia Title" height="150" >}} +{{< figure src="/images/branding/title.svg" link="/images/branding/title.svg" target="_blank" alt="Authelia Title" width="300" ignoreStaticImages="false" >}} diff --git a/docs/data/languages.json b/docs/data/languages.json new file mode 100644 index 00000000..3578e9dd --- /dev/null +++ b/docs/data/languages.json @@ -0,0 +1 @@ +{"defaultLocale":"en","defaultNamespace":"portal","namespaces":["portal"],"languages":[{"display":"German","locale":"de","namespaces":["portal"],"fallbacks":["en"]},{"display":"English","locale":"en","namespaces":["portal"],"fallbacks":["en"]},{"display":"Spanish","locale":"es","namespaces":["portal"],"fallbacks":["en"]},{"display":"French","locale":"fr","namespaces":["portal"],"fallbacks":["en"]},{"display":"Russian","locale":"ru","namespaces":["portal"],"fallbacks":["en"]},{"display":"Swedish","locale":"sv","namespaces":["portal"],"fallbacks":["en"]},{"display":"Swedish (Sweden)","locale":"sv-SE","namespaces":["portal"],"fallbacks":["sv","en"]},{"display":"Chinese (Taiwan)","locale":"zh-TW","namespaces":["portal"],"fallbacks":["en"]}]} \ No newline at end of file diff --git a/docs/i18n/en.toml b/docs/i18n/en.toml deleted file mode 100644 index cb52685f..00000000 --- a/docs/i18n/en.toml +++ /dev/null @@ -1,2 +0,0 @@ -[get-started] - other = "Get Started" \ No newline at end of file diff --git a/docs/i18n/en.yaml b/docs/i18n/en.yaml new file mode 100644 index 00000000..1f93f5eb --- /dev/null +++ b/docs/i18n/en.yaml @@ -0,0 +1,19 @@ +--- +- id: get-started + translation: "Get Started" + +- id: on-this-page + translation: "On this page" + +- id: search-text + translation: "Search..." + +- id: 404-title + translation: "Page not found :(" + +- id: 404-text + translation: "The page you are looking for doesn't exist or has been moved. If you followed a link to get to this page please report it if it was on this site, the official GitHub repository, or the logs on the latest version." + +- id: browse + translation: "Browse" +... diff --git a/docs/layouts/404.html b/docs/layouts/404.html index bb3d98f2..76d447a2 100644 --- a/docs/layouts/404.html +++ b/docs/layouts/404.html @@ -2,10 +2,9 @@
-

Page not found :(

-

The page you are looking for doesn't exist or has been moved.

-

If you followed a link to get to this page please report it if it was on this site, the official GitHub repository, or the logs on the latest version.

+

{{ i18n "404-title" }}

+

{{ i18n "404-text" }}

-{{ end }} +{{ end }} \ No newline at end of file diff --git a/docs/layouts/_default/baseof.html b/docs/layouts/_default/baseof.html index 8d2eb0c5..43fc30e4 100644 --- a/docs/layouts/_default/baseof.html +++ b/docs/layouts/_default/baseof.html @@ -1,5 +1,5 @@ - + {{ partial "head/head.html" . }} {{ if eq .Kind "home" -}} {{ .Scratch.Set "class" "home" -}} @@ -12,7 +12,7 @@ {{ .Scratch.Set "class" .Type -}} {{ .Scratch.Add "class" " list" -}} {{ end -}} - + {{ partial "header/header.html" . }}
@@ -23,5 +23,10 @@ {{ block "sidebar-footer" . }}{{ end }} {{ partial "footer/footer.html" . }} {{ partial "footer/script-footer.html" . }} + {{ if eq .Site.Params.options.toTopButton true -}} +
+ Top +
+ {{ end }} diff --git a/docs/layouts/_default/list.html b/docs/layouts/_default/list.html index a43b6e8f..7f56f51f 100644 --- a/docs/layouts/_default/list.html +++ b/docs/layouts/_default/list.html @@ -1,13 +1,32 @@ {{ define "main" }}
-
- {{ range .Paginator.Pages }} - - {{ end }} - {{ template "_internal/pagination.html" . }} +
+

{{ .Title }}

+ {{ with .Content -}}
{{ . }}
{{ end -}} +
+
+
+ {{ $paginator := .Paginate (.Data.Pages) -}} + {{ range $paginator.Pages -}} +
+
+ {{- .Scratch.Set "fillImage" "1270x620 Center" -}} + {{ partial "content/card-image.html" . }} +
+
+

{{ .Params.title }}

+

{{ .Params.excerpt | safeHTML }}

+ {{ partial "main/blog-meta.html" . -}} +
+
+
+
+ {{ end -}} +
+
+
+ {{ $.Scratch.Set "paginator" true }} + {{ template "_internal/pagination.html" . }}
{{ end }} diff --git a/docs/layouts/_default/terms.html b/docs/layouts/_default/terms.html new file mode 100644 index 00000000..73fdeb8d --- /dev/null +++ b/docs/layouts/_default/terms.html @@ -0,0 +1,20 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
{{ .Content }}
+
+ {{ range .Paginator.Pages }} + + {{ end }} +
+ {{ template "_internal/pagination.html" . }} +
+
+{{ end }} diff --git a/docs/layouts/blog/list.html b/docs/layouts/blog/list.html deleted file mode 100644 index 6267d4bc..00000000 --- a/docs/layouts/blog/list.html +++ /dev/null @@ -1,24 +0,0 @@ -{{ define "main" }} -
-
-
-

{{ .Title }}

-
{{ .Content }}
-
- {{ $paginator := .Paginate (.Data.Pages) -}} - {{ range $paginator.Pages -}} -
-
-

{{ .Params.title }}

-

{{ .Params.lead | safeHTML }}

- {{ partial "main/blog-meta.html" . -}} -
-
- {{ end -}} - {{ $.Scratch.Set "paginator" true }} - {{ template "_internal/pagination.html" . }} -
-
-
-
-{{ end }} diff --git a/docs/layouts/blog/single.html b/docs/layouts/blog/single.html index 48fdb82a..8de0b24d 100644 --- a/docs/layouts/blog/single.html +++ b/docs/layouts/blog/single.html @@ -1,14 +1,59 @@ {{ define "main" }} +
-
-
-
-

{{ .Title }}

- {{ partial "main/blog-meta.html" . }} -
-

{{ .Params.lead | safeHTML }}

- {{ .Content }} -
+
+
+

{{ .Title }}

+ {{ partial "main/blog-meta.html" . }} +
+
+
+
+ {{- .Scratch.Set "fillImage" "1270x715 Center" -}} + {{ partial "content/figure-blog.html" . }} +
+
+
+ {{ .Content }} + {{ if .Params.tags -}} +
+ {{ range $index, $tag := .Params.tags -}} + {{ . }} + {{ end -}} +
+ {{ end -}}
-{{ end }} \ No newline at end of file +
+ +{{ $related := .Site.RegularPages.Related . | first 3 -}} +{{ with $related -}} + +{{ end -}} + +{{ end }} + + diff --git a/docs/layouts/contributing/single.html b/docs/layouts/contributing/single.html index 3c996056..828922be 100644 --- a/docs/layouts/contributing/single.html +++ b/docs/layouts/contributing/single.html @@ -1,13 +1,13 @@ {{ define "main" }}
-
+
{{ if ne .Params.toc false -}} -
- {{ partial "main/docs-navigation.html" . }} + {{ partial "main/docs-navigation.html" . }} + +{{ else -}} + {{ .Title }} +{{ end -}} diff --git a/docs/layouts/partials/content/figure.html b/docs/layouts/partials/content/figure.html new file mode 100644 index 00000000..fbb0bdeb --- /dev/null +++ b/docs/layouts/partials/content/figure.html @@ -0,0 +1,37 @@ +{{ $fillImage := .Scratch.Get "fillImage" }} +{{ if not $fillImage -}} + {{ $fillImage = site.Params.fillImage }} +{{ end -}} + +{{ $image := .Resources.GetMatch (printf "**%s" (index .Params.images 0)) }} +{{ if not $image -}} + {{ $image = resources.Get (printf "%s%s" "images/" site.Params.defaultImage) }} +{{ end -}} + +{{ $image = $image.Fill $fillImage }} +{{ $lqip := $image.Resize site.Params.lqipWidth -}} + +{{ $imgSrc := "" -}} +{{ $imgSrcSet := slice -}} + +{{ $widths := site.Params.landscapePhotoWidths -}} +{{ if gt $image.Height $image.Width -}} + {{ $widths = site.Params.portraitPhotoWidths -}} +{{ end -}} + +{{ range $widths -}} + {{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}} + {{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}} + {{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}} +{{ end -}} +{{ $imgSrcSet = (delimit $imgSrcSet ",") -}} + +{{ if gt $image.Width site.Params.smallLimit -}} +
+ {{ .Title }} + + +
+{{ else -}} + {{ .Title }} +{{ end -}} diff --git a/docs/layouts/partials/content/image.html b/docs/layouts/partials/content/image.html new file mode 100644 index 00000000..2772531a --- /dev/null +++ b/docs/layouts/partials/content/image.html @@ -0,0 +1,32 @@ +{{ $image := .Resources.GetMatch (printf "**%s" (index .Params.images 0)) }} +{{ if not $image -}} + {{ $image = resources.Get (printf "%s%s" "images/" site.Params.defaultImage) }} +{{ end -}} + +{{ $image = $image.Fill site.Params.fillImage }} +{{ $lqip := $image.Resize site.Params.lqipWidth -}} + +{{ $imgSrc := "" -}} +{{ $imgSrcSet := slice -}} + +{{ $widths := site.Params.landscapePhotoWidths -}} +{{ if gt $image.Height $image.Width -}} + {{ $widths = site.Params.portraitPhotoWidths -}} +{{ end -}} + +{{ range $widths -}} + {{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}} + {{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}} + {{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}} +{{ end -}} +{{ $imgSrcSet = (delimit $imgSrcSet ",") -}} + +{{ if gt $image.Width site.Params.smallLimit -}} +
+ {{ .Title }} + + +
+{{ else -}} + {{ .Title }} +{{ end -}} diff --git a/docs/layouts/partials/footer/script-footer.html b/docs/layouts/partials/footer/script-footer.html index 7240b009..87997308 100644 --- a/docs/layouts/partials/footer/script-footer.html +++ b/docs/layouts/partials/footer/script-footer.html @@ -65,6 +65,12 @@ {{ $scrollLock := resources.Get "js/scroll-lock.js" | js.Build -}} {{ $slice = $slice | append $scrollLock -}} +{{ if .Site.Params.options.toTopButton -}} + {{ $toTopButton := resources.Get "js/to-top.js" -}} + {{ $toTopButton := $toTopButton | js.Build -}} + {{ $slice = $slice | append $toTopButton -}} +{{ end -}} + {{ $js := $slice | resources.Concat "main.js" -}} {{ if eq (hugo.Environment) "development" -}} diff --git a/docs/layouts/partials/head/custom-head.html b/docs/layouts/partials/head/custom-head.html new file mode 100644 index 00000000..0c59d7ff --- /dev/null +++ b/docs/layouts/partials/head/custom-head.html @@ -0,0 +1 @@ + diff --git a/docs/layouts/partials/head/favicons.html b/docs/layouts/partials/head/favicons.html index c034df1f..93c5ed55 100644 --- a/docs/layouts/partials/head/favicons.html +++ b/docs/layouts/partials/head/favicons.html @@ -1,4 +1,8 @@ + +{{ if os.FileExists "static/favicon.svg" -}} + +{{ end -}} diff --git a/docs/layouts/partials/head/head.html b/docs/layouts/partials/head/head.html index 9c1ecb35..12e2a8c2 100644 --- a/docs/layouts/partials/head/head.html +++ b/docs/layouts/partials/head/head.html @@ -7,4 +7,5 @@ {{ block "head/stylesheet" . }}{{ partial "head/stylesheet.html" . }}{{ end }} {{ block "head/seo" . }}{{ partial "head/seo.html" . }}{{ end }} {{ block "head/favicons" . }}{{ partial "head/favicons.html" . }}{{ end }} - \ No newline at end of file + {{ block "head/custom-head" . }}{{ partial "head/custom-head.html" . }}{{ end }} + diff --git a/docs/layouts/partials/header/header.html b/docs/layouts/partials/header/header.html index 93debd52..77940f4c 100644 --- a/docs/layouts/partials/header/header.html +++ b/docs/layouts/partials/header/header.html @@ -2,38 +2,58 @@ {{ partial "header/alert.html" . }} {{ end -}} -{{ if eq .Site.Params.options.flexSearch false -}} -
+{{ if eq .Site.Params.options.navbarSticky true -}} +
{{ end -}}
-
{{ end -}} -{{- $showFlexSearch := .Site.Params.options.flexSearch }} -{{- if $showFlexSearch }} - {{- if and (isset .Site.Params.options "searchsectionsshow") (not (eq .Site.Params.options.searchSectionsShow "ALL")) }} - {{- $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) (and .IsHome (in .Site.Params.options.searchSectionsShow "HomePage")) }} - {{- end }} -{{- end }} - -{{- if $showFlexSearch }} - - +{{ if eq .Section "docs" -}}
{{ else if ne .CurrentSection .FirstSection -}} -