Upgrade docsy to 0.11.0 and hugo to 0.139.0 (#1996)

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-11-19 22:40:34 +01:00 committed by GitHub
parent c5d7eb7a2d
commit d5c56a4f17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 83 additions and 72 deletions

View file

@ -6,23 +6,26 @@
*/}}
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js">
<html itemscope itemtype="http://schema.org/WebPage"
{{- with .Site.Language.LanguageDirection }} dir="{{ . }}" {{- end -}}
{{ with .Site.Language.Lang }} lang="{{ . }}" {{- end }} {{/**/ -}}
class="no-js">
<head>
{{ partial "head.html" . }}
</head>
<body class="td-{{ .Kind }}">
<body class="td-{{ .Kind }}{{ with .Page.Params.body_class }} {{ . }}{{ end }}">
<header>
{{ partial "navbar.html" . }}
</header>
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<div class="col-12 col-md-3 col-xl-3 td-sidebar d-print-none">
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
{{ partial "sidebar.html" . }}
</div>
<main class="col-12 col-md-9 col-xl-7 pl-md-5" role="main">
</aside>
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main">
{{ partial "version-banner.html" . }}
{{ partial "breadcrumb.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
</main>
</div>

View file

@ -1,39 +0,0 @@
{{/*
A modified version of the footer.html partial in Docsy.
*/}}
{{ $links := .Site.Params.links }}
<footer class="py-5 row d-print-none">
<div class="container-fluid mx-sm-5">
<div class="row">
<div class="col-12 text-center text-xs-center order-sm-3">
{{ with $links }}
{{ with index . "developer"}}
{{ template "footer-links-block" . }}
{{ end }}
{{ end }}
</div>
</div>
<div class="row">
<div class="col-12 text-center py-2 order-sm-3">
{{ with .Site.Params.copyright }}<small>&copy; {{ now.Year}} {{ .}}</small>{{ end }}
{{ if not .Site.Params.ui.footer_about_disable }}
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
{{ end }}
</div>
</div>
</div>
</footer>
{{ define "footer-links-block" }}
<ul class="list-inline mb-0">
{{ range . }}
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}" aria-label="{{ .name }}">
<a class="text-dark" target="_blank" rel="noopener noreferrer" href="{{ .url }}">
<i class="{{ .icon }}"></i>
</a>
</li>
{{ end }}
</ul>
{{ end }}

View file

@ -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 -}}
<div class="mt-2 mb-3">
{{ partial "footer/copyright.html" . -}}
</div>
{{ with .Site.Params.privacy_policy -}}
<span class="ms-2"><a href="{{ . }}" target="_blank" rel="noopener">{{ T "footer_privacy_policy" }}</a></span>
{{- 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" -}}
<p class="td-footer__about mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
{{- end -}}
{{ end -}}

View file

@ -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 -}}
<nav class="td-navbar navbar-light js-navbar-scroll
{{- if $cover }} td-navbar-cover {{- end }}">
<nav class="td-navbar js-navbar-scroll
{{- if $cover }} td-navbar-cover {{- end }}" data-bs-theme="light">
<div class="container-fluid flex-column flex-md-row">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
{{- /**/ -}}
@ -26,10 +26,11 @@
</span>
{{- /**/ -}}
<span class="navbar-brand__name">
specification
specification
</span>
{{- /**/ -}}
<span class="navbar-version"> &mdash; {{ partial "version-string" . }}</span>
<span class="navbar-version"> &mdash; {{ partial "version-string" . }}</span>
{{- /**/ -}}
</a>
<div class="td-navbar-nav-scroll ms-md-auto" id="main_navbar">
<ul class="navbar-nav">
@ -66,6 +67,11 @@
{{ partial "navbar-lang-selector.html" . -}}
</li>
{{ end -}}
{{ if .Site.Params.ui.showLightDarkModeMenu -}}
<li class="td-light-dark-menu nav-item dropdown">
{{ partial "theme-toggler" . }}
</li>
{{ end -}}
</ul>
</div>
<div class="d-none d-lg-block">

View file

@ -1,10 +1,10 @@
{{/*
{{- /*
A modified version of the siderbar-tree.html partial in Docsy, adding:
* The "toc.html" partial at L45.
*/}}
*/ -}}
{{/* We cache this partial for bigger sites and set the active class client side. */ -}}
{{ $sidebarCacheLimit := .Site.Params.ui.sidebar_cache_limit | default 2000 -}}
@ -38,7 +38,7 @@
{{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}}
{{ $ulNr := 0 -}}
{{ $ulShow := .Site.Params.ui.ul_show | default 1 -}}
{{ $sidebarMenuTruncate := .Site.Params.ui.sidebar_menu_truncate | default 50 -}}
{{ $sidebarMenuTruncate := .Site.Params.ui.sidebar_menu_truncate | default 100 -}}
<ul class="td-sidebar-nav__section pe-md-3 ul-{{ $ulNr }}">
{{ template "section-tree-nav-section" (dict "page" . "section" $navRoot "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" (add $ulShow 1)) }}
</ul>
@ -59,6 +59,11 @@
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}}
{{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}}
{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}}
{{ $truncatedEntryCount := sub (len $pages_tmp) $sidebarMenuTruncate -}}
{{ if gt $truncatedEntryCount 0 -}}
{{ warnf "WARNING: %d sidebar entries have been truncated. To avoid this, increase `params.ui.sidebar_menu_truncate` to at least %d (from %d) in your config file. Section: %s"
$truncatedEntryCount (len $pages_tmp) $sidebarMenuTruncate $s.Path -}}
{{ end -}}
{{ $withChild := gt (len $pages) 0 -}}
{{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}}
{{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}}
@ -80,4 +85,4 @@
</ul>
{{- end }}
</li>
{{- end }}
{{- end -}}