From 91d6692b637459b7d7ba53eee9d7579c098c0dcf Mon Sep 17 00:00:00 2001 From: Matthew Wildman Date: Tue, 23 Apr 2024 12:58:31 -0400 Subject: [PATCH 1/2] Update theme (#6908) --- .../content/testpages/authormeta/_index.md | 9 ++++++- .../layouts/contributors/term.html | 18 ++++++++----- ...get-authors.html => get-contributors.html} | 0 .../sections/content/title-byline.html | 26 +++++++++---------- _vendor/modules.txt | 2 +- go.mod | 2 +- go.sum | 2 ++ 7 files changed, 37 insertions(+), 22 deletions(-) rename _vendor/github.com/linode/linode-docs-theme/layouts/partials/funcs/{get-authors.html => get-contributors.html} (100%) diff --git a/_vendor/github.com/linode/linode-docs-theme/content/testpages/authormeta/_index.md b/_vendor/github.com/linode/linode-docs-theme/content/testpages/authormeta/_index.md index b98a024b132..75d63230927 100644 --- a/_vendor/github.com/linode/linode-docs-theme/content/testpages/authormeta/_index.md +++ b/_vendor/github.com/linode/linode-docs-theme/content/testpages/authormeta/_index.md @@ -12,4 +12,11 @@ Additional pages: - [Single author, no contributors (just published)](single-author-no-contributors-published/) - [Single author, no contributors (modified after publication)](single-author-no-contributors-modified/) -- [Single author, no contributors (published and modified later that day)](single-author-no-contributors-published-and-modified-later-that-day/) \ No newline at end of file +- [Single author, no contributors (published and modified later that day)](single-author-no-contributors-published-and-modified-later-that-day/) + +## Real Examples + +- Single author, no other contributors (just published, not yet modified): [A Comparison of High Availability PostgreSQL Solutions](/docs/guides/comparison-of-high-availability-postgresql-solutions/) +- Single author, one other contributor: [Configure Linux as a Router (IP Forwarding)](/docs/guides/linux-router-and-ip-forwarding/) +- Single author, no contributors (modified after publication): [Live Streaming With LiveKit and OBS Studio](/docs/guides/live-streaming-with-livekit-and-obs/) +- Multiple authors, no other contributors: [Controlling Linode LKE Costs Using Kubecost](/docs/guides/controlling-linode-lke-costs-using-kubecost/) \ No newline at end of file diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/contributors/term.html b/_vendor/github.com/linode/linode-docs-theme/layouts/contributors/term.html index 5f017ebb9bd..7d0f051ee3b 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/contributors/term.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/contributors/term.html @@ -18,24 +18,29 @@ {{ else }} {{ if or .Params.link .Params.email }} -
+
{{ $url := urls.Parse .Params.link }} - {{ $host := $url.Host | strings.TrimPrefix "www." }} {{ with .Params.link }} +
+ Website: {{ $host | upper }}{{ . }} +
{{ end }} {{ with .Params.email }} +
+ Email: EMAIL{{ . }} +
{{ end }}
{{ end }} @@ -49,9 +54,10 @@ {{ if not $isLinodeAuthor }} {{ $contributions := slice }} {{ $authorships := slice }} - {{ $term := .Data.Term | anchorize }} + {{ $nameAnchorized := .Data.Term | anchorize }} + {{ $name := .Title }} {{ range .Pages }} - {{ if and .Params.authors (collections.In .Params.authors $term) }} + {{ if or (collections.In .Params.authors $name) (collections.In .Params.authors $nameAnchorized) }} {{ $authorships = $authorships | append . }} {{ else }} {{ $contributions = $contributions | append . }} diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/funcs/get-authors.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/funcs/get-contributors.html similarity index 100% rename from _vendor/github.com/linode/linode-docs-theme/layouts/partials/funcs/get-authors.html rename to _vendor/github.com/linode/linode-docs-theme/layouts/partials/funcs/get-contributors.html diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/content/title-byline.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/content/title-byline.html index d527849d5c9..cbde8075523 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/content/title-byline.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/content/title-byline.html @@ -20,18 +20,18 @@ {{ else }} Updated {{ end }} - {{ $authors := partial "funcs/get-authors.html" . }} + {{ $contributors := partial "funcs/get-contributors.html" . }} - {{ if (and (eq (len $authors.authors) 1) (not $authors.contributors)) }} + {{ if (and (eq (len $contributors.authors) 1) (not $contributors.contributors)) }} {{/* Single author, no contributors. */}} - {{ with (index $authors.authors 0) }} + {{ with (index $contributors.authors 0) }} {{ if $isModified }}Originally authored {{ end }}by {{ template "tbl-author-link" . }} {{ end }} {{ else }} - {{ $numContributions := add (len $authors.authors) (len $authors.contributors) }} + {{ $numContributions := add (len $contributors.authors) (len $contributors.contributors) }} - {{ if $authors.authors }} + {{ if $contributors.authors }}

- {{ cond (eq (len $authors.authors) 1) "Author:" "Authors:" }} - {{ range $i, $e := $authors.authors -}} + {{ cond (eq (len $contributors.authors) 1) "Author:" "Authors:" }} + {{ range $i, $e := $contributors.authors -}} {{- if $i -}}, {{ end }}{{ template "tbl-author-link" . }} {{- end -}}

{{ end }} - {{ if $authors.contributors }} + {{ if $contributors.contributors }}

- {{ if $authors.authors }}Other contributors:{{ end }} - {{ range $i, $e := $authors.contributors -}} + {{ if $contributors.authors }}Other contributors:{{ end }} + {{ range $i, $e := $contributors.contributors -}} {{ if $i -}} ,  {{ end }}{{ template "tbl-author-link" . -}} @@ -65,7 +65,7 @@ {{ end }} {{ if .File }} {{ $path := .Params.path | default .File.Path }} - {{ $historyRef := printf "https://github.com/linode/docs/blob/develop/docs/%s" $path }} + {{ $historyRef := printf "https://github.com/linode/docs/commits/develop/docs/%s" $path }} - {{ if (and (eq (len $authors.authors) 1) (gt (len $authors.contributors) 1)) }} + {{ if (and (eq (len $contributors.authors) 1) (ge (len $contributors.contributors) 1)) }} {{/* Single author, multiple contributors. */}} - {{ $author := index $authors.authors 0 }} + {{ $author := index $contributors.authors 0 }} Originally authored by {{ template "tbl-author-link" $author }} Date: Tue, 23 Apr 2024 13:07:57 -0400 Subject: [PATCH 2/2] Theme update (#6909) - Remove fingerprints from files in /docs/cachewarmers/ --- .../partials/sections/search/create-cachewarmers-urls.html | 4 ++-- _vendor/modules.txt | 2 +- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/search/create-cachewarmers-urls.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/search/create-cachewarmers-urls.html index ec98c9f7839..fe22db1ca6a 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/search/create-cachewarmers-urls.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/search/create-cachewarmers-urls.html @@ -46,7 +46,7 @@ {{ $res := index $data.results $i }} {{ $targetResource := resources.FromString $targetPath (jsonify $res) }} {{ if (ne hugo.Environment "development") }} - {{ $targetResource = $targetResource | minify | fingerprint }} + {{ $targetResource = $targetResource | minify }} {{ end }} {{ $v = merge $v (dict $name $targetResource.RelPermalink) }} {{ end }} @@ -72,7 +72,7 @@ {{ $targetPath := printf "cachewarmers/sections/%s.json" $name }} {{ $targetResource := resources.FromString $targetPath (jsonify $currentSectionData) }} {{ if (ne hugo.Environment "development") }} - {{ $targetResource = $targetResource | minify | fingerprint }} + {{ $targetResource = $targetResource | minify }} {{ end }} {{ $v = merge $v (dict $currentSection $targetResource.RelPermalink) }} {{ end }} diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 2190f609eee..dd612f7f0d6 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/linode/linode-docs-theme v0.0.0-20240423162135-fcca3a0c8c89 +# github.com/linode/linode-docs-theme v0.0.0-20240423165854-a2056513af25 # github.com/linode/linode-website-partials v0.0.0-20240130163753-4a933fe77633 # github.com/gohugoio/hugo-mod-jslibs-dist/alpinejs/v3 v3.401.201 # github.com/gohugoio/hugo-mod-jslibs/turbo/v7 v7.20300.20000 diff --git a/go.mod b/go.mod index 2c027995057..b4e9ae39a3a 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +5,5 @@ go 1.15 require ( github.com/hotwired/turbo v7.0.1+incompatible // indirect github.com/linode/linode-api-docs/v4 v4.174.0 // indirect - github.com/linode/linode-docs-theme v0.0.0-20240423162135-fcca3a0c8c89 // indirect + github.com/linode/linode-docs-theme v0.0.0-20240423165854-a2056513af25 // indirect ) diff --git a/go.sum b/go.sum index 2c71dfec0f0..6806c5a4538 100644 --- a/go.sum +++ b/go.sum @@ -255,6 +255,8 @@ github.com/linode/linode-docs-theme v0.0.0-20240422191254-1f4704524ff0 h1:z0XU8z github.com/linode/linode-docs-theme v0.0.0-20240422191254-1f4704524ff0/go.mod h1:pLFUnAD7hJW1C2wheL3HqtWIN6Xy0kywHHf33YyfUTI= github.com/linode/linode-docs-theme v0.0.0-20240423162135-fcca3a0c8c89 h1:Q6uC3VVIU4xs7cJNuqHXQbC/ReK1DjZZvMCYtcEOL5s= github.com/linode/linode-docs-theme v0.0.0-20240423162135-fcca3a0c8c89/go.mod h1:pLFUnAD7hJW1C2wheL3HqtWIN6Xy0kywHHf33YyfUTI= +github.com/linode/linode-docs-theme v0.0.0-20240423165854-a2056513af25 h1:XlGFuVQ3GighmP/S5CoLe09wbdPYYOUk9TmeTBZff4U= +github.com/linode/linode-docs-theme v0.0.0-20240423165854-a2056513af25/go.mod h1:pLFUnAD7hJW1C2wheL3HqtWIN6Xy0kywHHf33YyfUTI= github.com/linode/linode-website-partials v0.0.0-20221205205120-b6ea1aaa59fb/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= github.com/linode/linode-website-partials v0.0.0-20221222200538-99862e429110/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= github.com/linode/linode-website-partials v0.0.0-20230201145731-a8703d0a954a/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao=