diff --git a/netlify.toml b/netlify.toml index 2b7cd616..05f9b877 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,5 @@ [build] -command = "cd website && hugo --gc --minify" +command = "cd website && hugo --gc --minify --baseURL $DEPLOY_PRIME_URL" publish = "website/public" [build.environment] diff --git a/website/assets/scss/_styles_project.scss b/website/assets/scss/_styles_project.scss new file mode 100644 index 00000000..4af74d9f --- /dev/null +++ b/website/assets/scss/_styles_project.scss @@ -0,0 +1,5 @@ +.version-banner { + position: sticky; + top: 5rem; + z-index: 1; +} \ No newline at end of file diff --git a/website/layouts/partials/doc_latest_version.html b/website/layouts/partials/doc_latest_version.html new file mode 100644 index 00000000..3f9aaf80 --- /dev/null +++ b/website/layouts/partials/doc_latest_version.html @@ -0,0 +1,10 @@ +{{ $page := .Site.Params.url_latest_version }} +{{ $doc_latest_version := replaceRE (.Section | printf "^/%s") .Site.Params.url_latest_version .Page.RelPermalink | path.Clean }} +{{ range $p := (where .Site.Pages "Section" (.Site.Params.url_latest_version | strings.TrimPrefix "/")) }} +{{ $page = cond (eq $doc_latest_version ($p.RelPermalink | path.Clean)) $p.RelPermalink $page }} +{{ range .Aliases }} +{{ $alias := cond (hasPrefix . "/") . (path.Join $p.RelPermalink ".." .) }} +{{ $page = cond (eq $alias $doc_latest_version) $p.RelPermalink $page}} +{{ end }} +{{ end }} +{{ return $page }} \ No newline at end of file diff --git a/website/layouts/partials/hooks/head-end.html b/website/layouts/partials/hooks/head-end.html index 357c44a2..cd455b5a 100644 --- a/website/layouts/partials/hooks/head-end.html +++ b/website/layouts/partials/hooks/head-end.html @@ -4,4 +4,16 @@ {{ if (findRE " +{{ end }} + + +{{ if .Section }} + {{ $latest_version := .Site.Params.url_latest_version }} + {{ $current_version := .Section | printf "/%s" }} + {{ if ne $latest_version $current_version }} + {{ $latest_doc := partial "doc_latest_version.html" . }} + {{ if ne $latest_doc $latest_version }} + + {{ end }} + {{ end }} {{ end }} \ No newline at end of file diff --git a/website/themes/docsy/layouts/partials/version-banner.html b/website/layouts/partials/version-banner.html similarity index 62% rename from website/themes/docsy/layouts/partials/version-banner.html rename to website/layouts/partials/version-banner.html index ff87881e..6940585d 100644 --- a/website/themes/docsy/layouts/partials/version-banner.html +++ b/website/layouts/partials/version-banner.html @@ -2,26 +2,27 @@ If yes, display a banner. --> {{ $latest_version := .Site.Params.url_latest_version }} {{ $current_version := .Section | printf "/%s" }} +{{ $latest_doc := partial "doc_latest_version.html" . }} {{ if .FirstSection.Params.prerelease }} - {{ $color := "primary" }} -
+ {{ $color := "info" }} +
{{ with $current_version }}

Version {{ trim . "/" | markdownify }} of the - documentation is for the Sidero version being developed. - {{ with $latest_version }}For the latest stable version of Sidero, see the - latest version.

+ documentation is for the Sidero Metal version being developed. + {{ with $latest_version }}For the latest stable version of Sidero Metal, see the + latest version.

{{ end }} {{ end }}
{{ else if ne $latest_version $current_version }} - {{ $color := "primary" }} -
+ {{ $color := "warning" }} +
{{ with $current_version }}

Version {{ trim . "/" | markdownify }} of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. {{ with $latest_version }}For up-to-date documentation, see the - latest version.

+ latest version.

{{ end }} {{ end }}
-{{ end }} +{{ end }} \ No newline at end of file