diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/_markup/render-link.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/_markup/render-link.html index 5583d53d7..9b6cad114 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/_markup/render-link.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/_markup/render-link.html @@ -1,4 +1,4 @@ -{{- /* Last modified: 2023-09-04T09:23:04-07:00 */}} +{{- /* Last modified: 2024-04-26T13:54:00-07:00 */}} {{- /* Copyright 2023 Veriphor LLC @@ -118,7 +118,7 @@ either of these shortcodes in conjunction with this render hook. {{- $attrs = merge $attrs (dict "rel" "external") }} {{- else }} {{- with $u.Path }} - {{- with $p := or ($.Page.GetPage .) ($.Page.GetPage (strings.TrimRight "/" .)) }} + {{- with $p := or ($.PageInner.GetPage .) ($.PageInner.GetPage (strings.TrimRight "/" .)) }} {{- /* Destination is a page. */}} {{- $href := .RelPermalink }} {{- with $u.RawQuery }} @@ -137,7 +137,7 @@ either of these shortcodes in conjunction with this render hook. {{- end }} {{- $attrs = dict "href" $href }} {{- else }} - {{- with $.Page.Resources.Get $u.Path }} + {{- with $.PageInner.Resources.Get $u.Path }} {{- /* Destination is a page resource; drop query and fragment. */}} {{- $attrs = dict "href" .RelPermalink }} {{- else }} @@ -185,14 +185,14 @@ either of these shortcodes in conjunction with this render hook. {{- end }} {{- end }} {{- end }} -{{- with .Title }} - {{- $attrs = merge $attrs (dict "title" .) }} -{{- end -}} +{{- $attrs = merge $attrs (dict "title" (.Title | transform.HTMLEscape)) }} {{- /* Render anchor element. */ -}} {{ .Text | safeHTML }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.rss.xml b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.rss.xml index 1d3498a1e..26afc1816 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.rss.xml +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.rss.xml @@ -1,38 +1,68 @@ +{{- printf "" | safeHTML }} - {{ .Site.Title }} – {{ .Title }} + Hugo News + Recent news about Hugo, a static site generator written in Go, optimized for speed and designed for flexibility. {{ .Permalink }} - Recent Hugo news from gohugo.io - Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - - {{ "img/hugo.png" | absURL }} - GoHugo.io - {{ .Permalink }} - - {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{ end }} - {{ range first 50 (where .Site.RegularPages "Type" "in" (slice "news" "showcase")) }} - - {{ .Section | title }}: {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }} - - {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} - {{ with $img }} - {{ $img := .Resize "640x" }} - {{ printf "]]>" $img.Permalink $img.Width $img.Height | safeHTML }} - {{ end }} - {{ .Content | html }} - - - {{ end }} + Hugo {{ hugo.Version }} + {{ or site.Language.LanguageCode site.Language.Lang }} + {{- with site.Copyright }} + {{ . }} + {{- end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + + {{- $news_items := slice }} + + {{- /* Get releases from GitHub. */}} + {{- $u := "https://api.github.com/repos/gohugoio/hugo/releases" }} + {{- $releases := partial "utilities/get-remote-data.html" $u }} + {{- $releases = where $releases "draft" false }} + {{- $releases = where $releases "prerelease" false }} + {{- range $releases | first 20 }} + {{- $summary := printf + "Hugo %s was released on %s. See [release notes](%s) for details." + .tag_name + (.published_at | time.AsTime | time.Format "2 Jan 2006") + .html_url + }} + {{- $ctx := dict + "PublishDate" (.published_at | time.AsTime) + "Title" (printf "Release %s" .name) + "Permalink" .html_url + "Section" "news" + "Summary" ($summary | $.Page.RenderString) + }} + {{- $news_items = $news_items | append $ctx }} + {{- end }} + + {{- /* Get content pages from news section. */}} + {{- range where site.RegularPages "Section" "news" }} + {{- $ctx := dict + "PublishDate" .PublishDate + "Title" .Title + "RelPermalink" .RelPermalink + "Section" "news" + "Summary" .Summary + "Params" (dict "description" .Description) + }} + {{- $news_items = $news_items | append $ctx }} + {{- end }} + {{- /* Sort, limit, and render lastBuildDate. */}} + {{- $limit := cond (gt site.Config.Services.RSS.Limit 1) site.Config.Services.RSS.Limit 999 }} + {{- $news_items = sort $news_items "PublishDate" "desc" | first $limit }} + {{ (index $news_items 0).PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + + {{- /* Render items. */}} + {{- range $news_items }} + + {{ .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ .Permalink }} + {{ .Summary | transform.XMLEscape | safeHTML }} + + {{- end }} - \ No newline at end of file + diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html index 5165c8a13..a41e45a2c 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html @@ -18,7 +18,7 @@ {{/* Get releases from GitHub. */}} {{ $u := "https://api.github.com/repos/gohugoio/hugo/releases" }} - {{ $releases := partial "inline/get-remote-data.html" $u }} + {{ $releases := partial "utilities/get-remote-data.html" $u }} {{ $releases = where $releases "draft" false }} {{ $releases = where $releases "prerelease" false }} {{ range $releases | first 20 }} @@ -55,16 +55,3 @@ {{ end }} - -{{ define "partials/inline/get-remote-data.html" }} - {{ $u := . }} - {{ $r := "" }} - {{ with $r = resources.GetRemote $u }} - {{ with .Err }} - {{ errorf "%s" . }} - {{ end }} - {{ else }} - {{ errorf "Unable to get remote resource %q" $u }} - {{ end }} - {{ return ($r | transform.Unmarshal) }} -{{ end }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml new file mode 100644 index 000000000..40bca59eb --- /dev/null +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml @@ -0,0 +1,68 @@ +{{- printf "" | safeHTML }} + + + Hugo News + Recent news about Hugo, a static site generator written in Go, optimized for speed and designed for flexibility. + {{ .Permalink }} + Hugo {{ hugo.Version }} + {{ or site.Language.LanguageCode site.Language.Lang }} + {{- with site.Copyright }} + {{ . }} + {{- end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + + {{- $news_items := slice }} + + {{- /* Get releases from GitHub. */}} + {{- $u := "https://api.github.com/repos/gohugoio/hugo/releases" }} + {{- $releases := partial "utilities/get-remote-data.html" $u }} + {{- $releases = where $releases "draft" false }} + {{- $releases = where $releases "prerelease" false }} + {{- range $releases | first 20 }} + {{- $summary := printf + "Hugo %s was released on %s. See [release notes](%s) for details." + .tag_name + (.published_at | time.AsTime | time.Format "2 Jan 2006") + .html_url + }} + {{- $ctx := dict + "PublishDate" (.published_at | time.AsTime) + "Title" (printf "Release %s" .name) + "Permalink" .html_url + "Section" "news" + "Summary" ($summary | $.Page.RenderString) + }} + {{- $news_items = $news_items | append $ctx }} + {{- end }} + + {{- /* Get content pages from news section. */}} + {{- range .Pages }} + {{- $ctx := dict + "PublishDate" .PublishDate + "Title" .Title + "RelPermalink" .RelPermalink + "Section" "news" + "Summary" .Summary + "Params" (dict "description" .Description) + }} + {{- $news_items = $news_items | append $ctx }} + {{- end }} + {{- /* Sort, limit, and render lastBuildDate. */}} + {{- $limit := cond (gt site.Config.Services.RSS.Limit 1) site.Config.Services.RSS.Limit 999 }} + {{- $news_items = sort $news_items "PublishDate" "desc" | first $limit }} + {{ (index $news_items 0).PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + + {{- /* Render items. */}} + {{- range $news_items }} + + {{ .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ .Permalink }} + {{ .Summary | transform.XMLEscape | safeHTML }} + + {{- end }} + + diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/utilities/get-remote-data.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/utilities/get-remote-data.html new file mode 100644 index 000000000..69ac41da4 --- /dev/null +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/utilities/get-remote-data.html @@ -0,0 +1,23 @@ +{{/* +Parses the serialized data from the given URL and returns a map or an array. + +Supports CSV, JSON, TOML, YAML, and XML. + +@param {string} . The URL from which to retrieve the serialized data. +@returns {any} + +@example {{ partial "get-remote-data.html" "https://example.org/foo.json" }} +*/}} + +{{ $url := . }} +{{ $data := dict }} +{{ with resources.GetRemote $url }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $data = .Content | transform.Unmarshal }} + {{ end }} +{{ else }} + {{ errorf "Unable to get remote resource %q" $url }} +{{ end }} +{{ return $data }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html index 87fae1612..606d2219c 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html @@ -27,9 +27,7 @@ button will be hidden if any of the following conditions is true: {{- warnf "This call to the %q shortcode should be removed: %s. The button is now hidden because the specified version (%s) is older than the display threshold." $.Name $.Position $version }} {{- end }} {{- else }} - + New in v{{ $version }} {{- end }} {{- else }} {{- errorf "The %q shortcode requires a positional parameter (version). See %s" .Name .Position }} diff --git a/_vendor/modules.txt b/_vendor/modules.txt index b41881bb9..37bdc1bad 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1 +1 @@ -# github.com/gohugoio/gohugoioTheme v0.0.0-20240302183348-b1860f349180 +# github.com/gohugoio/gohugoioTheme v0.0.0-20240426212330-f38e99e0d88d diff --git a/go.mod b/go.mod index 2ff071743..1c0131da4 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs go 1.16 -require github.com/gohugoio/gohugoioTheme v0.0.0-20240302183348-b1860f349180 // indirect +require github.com/gohugoio/gohugoioTheme v0.0.0-20240426212330-f38e99e0d88d // indirect diff --git a/go.sum b/go.sum index afcdec8c0..465a186b6 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/gohugoio/gohugoioTheme v0.0.0-20240302183348-b1860f349180 h1:QMzk5J6Im/HG3ZeFfmy+cfn5XRZT5ZCbMGbLpcQKAfk= -github.com/gohugoio/gohugoioTheme v0.0.0-20240302183348-b1860f349180/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM= +github.com/gohugoio/gohugoioTheme v0.0.0-20240426212330-f38e99e0d88d h1:EaFz80Aqh3Ej20VmUSNe3K+F0NbT8UueXLP/VqkK9Dw= +github.com/gohugoio/gohugoioTheme v0.0.0-20240426212330-f38e99e0d88d/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=