From d5c56a4f1765333dc31dcdc66adb913c28d65a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 19 Nov 2024 22:40:34 +0100 Subject: [PATCH] Upgrade docsy to 0.11.0 and hugo to 0.139.0 (#1996) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .github/workflows/main.yml | 3 +- README.md | 2 +- assets/scss/_styles_project.scss | 5 ++- .../internal/newsfragments/1996.clarification | 1 + config.toml | 19 +++++---- go.mod | 2 +- go.sum | 8 ++-- layouts/docs/baseof.html | 15 ++++--- layouts/partials/footer.html | 39 ------------------- layouts/partials/footer/center.html | 30 ++++++++++++++ layouts/partials/navbar.html | 18 ++++++--- layouts/partials/sidebar-tree.html | 13 +++++-- 12 files changed, 83 insertions(+), 72 deletions(-) create mode 100644 changelogs/internal/newsfragments/1996.clarification delete mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/footer/center.html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d67cd441..25a2fb68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,7 @@ name: "Spec" env: - # Cannot build the spec with Hugo 0.125.0 and docsy < 0.10.0 because of https://github.com/google/docsy/issues/1930 - HUGO_VERSION: 0.124.1 + HUGO_VERSION: 0.139.0 on: push: diff --git a/README.md b/README.md index a0ba854e..91afa6c5 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ place after an MSC has been accepted, not as part of a proposal itself. 1. Install the extended version (often the OS default) of Hugo: . Note that at least Hugo - v0.117.0 is required. + v0.123.1 is required. Alternatively, use the Docker image at https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index 5081d8e8..9b020715 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -122,8 +122,11 @@ Custom SCSS for the Matrix spec } /* Customise footer */ -footer { +.td-footer { box-shadow: 0px 0px 8px rgba(179, 179, 179, 0.25); + padding-top: 2rem; + color: var(--bs-body-color); + background-color: var(--bs-body-color-bg); } /* Auto numbering for headings */ diff --git a/changelogs/internal/newsfragments/1996.clarification b/changelogs/internal/newsfragments/1996.clarification new file mode 100644 index 00000000..2147c241 --- /dev/null +++ b/changelogs/internal/newsfragments/1996.clarification @@ -0,0 +1 @@ +Upgrade docsy to 0.11.0 and hugo to 0.138.0. diff --git a/config.toml b/config.toml index 2494ad1e..d57b6a5b 100644 --- a/config.toml +++ b/config.toml @@ -55,7 +55,6 @@ description = "Home of the Matrix specification for decentralised communication" [params] copyright = "The Matrix.org Foundation CIC" -privacy_policy = "https://matrix.org/legal/privacy-notice" [params.version] # must be one of "unstable", "current", "historical" @@ -71,8 +70,6 @@ current_version_url = "https://spec.matrix.org/latest" # User interface configuration [params.ui] -# Set to true to disable the About link in the site footer -footer_about_disable = false # Collapse HTTP API and event
elements rendered_data_collapsed = false # Hide the search entry in the sidebar @@ -88,22 +85,28 @@ sidebar_menu_compact = true # icon = "fa fa-envelope" # desc = "Discussion and help from your fellow users" # Developer relevant links. These will show up on right side of footer and in the community page if you have one. -[[params.links.developer]] +# [[params.links.developer]] +# name = "GitHub" +# url = "https://github.com/matrix-org" +# icon = "fab fa-github" +# desc = "Matrix on GitHub" +# Custom links shown in the center of the footer. (Only supported by our fork of docsy's 'footer/central' partial.) +[[params.links.bottom]] name = "GitHub" url = "https://github.com/matrix-org" icon = "fab fa-github" desc = "Matrix on GitHub" -[[params.links.developer]] +[[params.links.bottom]] name = "GitLab" url = "https://gitlab.matrix.org/matrix-org" icon = "fab fa-gitlab" desc = "Matrix on GitLab" -[[params.links.developer]] +[[params.links.bottom]] name = "YouTube" url = "https://www.youtube.com/channel/UCVFkW-chclhuyYRbmmfwt6w" icon = "fab fa-youtube" desc = "Matrix YouTube channel" -[[params.links.developer]] +[[params.links.bottom]] name = "Twitter" url = "https://twitter.com/matrixdotorg" icon = "fab fa-twitter" @@ -130,7 +133,7 @@ sidebar_menu_compact = true [module] [module.hugoVersion] extended = true - min = "0.117.0" + min = "0.123.1" [[module.imports]] path = "github.com/matrix-org/docsy" disable = false diff --git a/go.mod b/go.mod index d17af303..52d0f21c 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/matrix-org/matrix-spec go 1.12 -require github.com/matrix-org/docsy v0.0.0-20241030165433-a14705b7e3ca // indirect +require github.com/matrix-org/docsy v0.0.0-20241106102557-ec7b98ee4014 // indirect diff --git a/go.sum b/go.sum index d76f3534..04125160 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/matrix-org/docsy v0.0.0-20241030165433-a14705b7e3ca h1:WqKYQIF3JdWxY6b+OZQbdCjczOmELuUxpXhXSXJ/F58= -github.com/matrix-org/docsy v0.0.0-20241030165433-a14705b7e3ca/go.mod h1:TAN2cSMJzy0hnx9OYDbBYluS8raV61UHxT/tfjaLt3g= -github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= +github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/matrix-org/docsy v0.0.0-20241106102557-ec7b98ee4014 h1:CNvxuuURuxkEjA0QN+lRKELc7PRDsX270e8v4GDF3II= +github.com/matrix-org/docsy v0.0.0-20241106102557-ec7b98ee4014/go.mod h1:4Ek1bcdbfU/j8hIatEjNhIs1Yua85FtQf3kLvoYZ0bQ= +github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index 3e058fd0..a167f72b 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -6,23 +6,26 @@ */}} - + {{ partial "head.html" . }} - +
{{ partial "navbar.html" . }}
-
+
-
+ +
{{ partial "version-banner.html" . }} - {{ partial "breadcrumb.html" . }} + {{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} {{ block "main" . }}{{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html deleted file mode 100644 index 3506f834..00000000 --- a/layouts/partials/footer.html +++ /dev/null @@ -1,39 +0,0 @@ -{{/* - - A modified version of the footer.html partial in Docsy. - -*/}} - -{{ $links := .Site.Params.links }} -
-
-
-
- {{ with $links }} - {{ with index . "developer"}} - {{ template "footer-links-block" . }} - {{ end }} - {{ end }} -
-
-
-
- {{ with .Site.Params.copyright }}© {{ now.Year}} {{ .}}{{ end }} - {{ if not .Site.Params.ui.footer_about_disable }} - {{ with .Site.GetPage "about" }}

{{ .Title }}

{{ end }} - {{ end }} -
-
-
-
-{{ define "footer-links-block" }} -
    - {{ range . }} -
  • - - - -
  • - {{ end }} -
-{{ end }} diff --git a/layouts/partials/footer/center.html b/layouts/partials/footer/center.html new file mode 100644 index 00000000..cd3f04e0 --- /dev/null +++ b/layouts/partials/footer/center.html @@ -0,0 +1,30 @@ +{{- /* + + Modified version of the footer/center.html partial of Docsy, adding "bottom" + links on top of the copyright. + +*/ -}} + +{{ with .Site.Params.links -}} + {{ with index . "bottom" -}} + {{- partial "footer/links.html" . -}} + {{ end -}} +{{ end -}} + +
+{{ partial "footer/copyright.html" . -}} +
+ +{{ with .Site.Params.privacy_policy -}} + {{ T "footer_privacy_policy" }} +{{- end -}} + +{{ if ne .Site.Params.ui.footer_about_disable nil -}} + {{ warnf "Config parameter '.params.ui.footer_about_disable' is DEPRECATED, use '.params.ui.footer_about_enable' instead." -}} +{{ end -}} + +{{ if or .Site.Params.ui.footer_about_enable (eq .Site.Params.ui.footer_about_disable false) -}} + {{ with .Site.GetPage "about" -}} + + {{- end -}} +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index db6a982a..ca8347ee 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -1,10 +1,10 @@ -{{/* +{{- /* A version of the navbar.html partial in Docsy, only modified to include the spec version, which is calculated using an inline `version-string` partial. -*/}} +*/ -}} {{ $cover := and (.HasShortcode "blocks/cover") @@ -12,8 +12,8 @@ -}} {{ $baseURL := urls.Parse $.Site.Params.Baseurl -}} -