From 4a7fb7f35123ccc93ed8a00d5f44822a4b3b973f Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Tue, 24 Dec 2024 11:30:52 -0500 Subject: [PATCH 1/5] Add Title to hugo.yaml and modify navbar to use it navbar.html by defalut puts the title on every page. This update modifies it to not put the title on the home page. The title already is a central part of the text within the page and having it on the home page is redundant. Defining the title in the config comes in useful for other Hugo templates that want to use the title of the website. --- config/_default/hugo.yaml | 107 ++++++++++++++++++----------------- layouts/partials/navbar.html | 75 ++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 52 deletions(-) create mode 100644 layouts/partials/navbar.html diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml index f3a589831..2578bce2d 100644 --- a/config/_default/hugo.yaml +++ b/config/_default/hugo.yaml @@ -1,52 +1,55 @@ -# ******************************************************************* -# -# Hugo parameters for Interlisp.org -# -# An overview of hugo configuration files can be found at: -# https://gohugo.io/getting-started/configuration/#configure-server -# - -# relativeURLs: Enable to force all relative URLs to be relative to content root -relativeURLs: false - -# canonifyURLs: Convert relative URLs to absolute URLs -canonifyURLs: false - -# enableRobotsTXT: Enable generation of robots.txt file. When enabled this -# will overwrite the default robots.txt file that disallows crawling. -# Default to false and set to true for production in config/production/hugo.yaml -enableRobotsTXT: false - -# assetDir: Location where Hugo looks for assets -assetDir: static - -# Enable .GitInfo object for each page. This will give values to .Lastmod etc. -enableGitInfo: false - -# Top Level Language defaults -# See languages.yaml for language specific values -defaultContentLanguage: "en" -defaultContentLanguageInSubdir: false - -# Useful when translating. -enableMissingTranslationPlaceholders: true - -# Disable rendering of the specified page kinds -disableKinds: - - taxonomy - - term - - RSS - -# Code Highlighting configuration -# Not Used. Code highlighting is controlled using the highlighting -# section in `markup.yaml` -#pygmentsCodeFences: false -#pygmentsUseClasses: false -# Use the new Chroma Go highlighter in Hugo. -# pygmentsUseClassic: false -# pygmentsOptions: linenos=table -# See https://help.farbox.com/pygments.html - -# Comment out if you don't want the "print entire section" link enabled. -# [outputs] -# section = ["HTML", "print"] +# ******************************************************************* +# +# Hugo parameters for Interlisp.org +# +# An overview of hugo configuration files can be found at: +# https://gohugo.io/getting-started/configuration/#configure-server +# +# title: The title that appears in the navbar of every page. We have +# edited navbar.html to not show the title in the navbar of the home page. +title: "The Medley Interlisp Project" + +# relativeURLs: Enable to force all relative URLs to be relative to content root +relativeURLs: false + +# canonifyURLs: Convert relative URLs to absolute URLs +canonifyURLs: false + +# enableRobotsTXT: Enable generation of robots.txt file. When enabled this +# will overwrite the default robots.txt file that disallows crawling. +# Default to false and set to true for production in config/production/hugo.yaml +enableRobotsTXT: false + +# assetDir: Location where Hugo looks for assets +assetDir: static + +# Enable .GitInfo object for each page. This will give values to .Lastmod etc. +enableGitInfo: false + +# Top Level Language defaults +# See languages.yaml for language specific values +defaultContentLanguage: "en" +defaultContentLanguageInSubdir: false + +# Useful when translating. +enableMissingTranslationPlaceholders: true + +# Disable rendering of the specified page kinds +disableKinds: + - taxonomy + - term + - RSS + +# Code Highlighting configuration +# Not Used. Code highlighting is controlled using the highlighting +# section in `markup.yaml` +#pygmentsCodeFences: false +#pygmentsUseClasses: false +# Use the new Chroma Go highlighter in Hugo. +# pygmentsUseClassic: false +# pygmentsOptions: linenos=table +# See https://help.farbox.com/pygments.html + +# Comment out if you don't want the "print entire section" link enabled. +# [outputs] +# section = ["HTML", "print"] diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html new file mode 100644 index 000000000..297808a69 --- /dev/null +++ b/layouts/partials/navbar.html @@ -0,0 +1,75 @@ +{{ $cover := and + (.HasShortcode "blocks/cover") + (not .Site.Params.ui.navbar_translucent_over_cover_disable) +-}} +{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}} + + \ No newline at end of file From 167bf7419282a1d5e7d9ac2c07f665cd867731f7 Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Tue, 24 Dec 2024 17:26:13 -0500 Subject: [PATCH 2/5] Add RSS Feed to History, Software and Project pages. RSS Feed generates feed containing all subpages from these sections. --- config/_default/hugo.yaml | 10 +++++- content/en/project/_index.md | 3 ++ content/en/software/_index.md | 3 ++ layouts/_default/rss.xml | 61 +++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/rss.xml diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml index f3a589831..272ac9e1c 100644 --- a/config/_default/hugo.yaml +++ b/config/_default/hugo.yaml @@ -5,6 +5,9 @@ # An overview of hugo configuration files can be found at: # https://gohugo.io/getting-started/configuration/#configure-server # +# title: The title that appears in the navbar of every page. We have +# edited navbar.html to not show the title in the navbar of the home page. +title: "The Medley Interlisp Project" # relativeURLs: Enable to force all relative URLs to be relative to content root relativeURLs: false @@ -35,7 +38,12 @@ enableMissingTranslationPlaceholders: true disableKinds: - taxonomy - term - - RSS + +outputs: + home: + - HTML + section: + - HTML # Code Highlighting configuration # Not Used. Code highlighting is controlled using the highlighting diff --git a/content/en/project/_index.md b/content/en/project/_index.md index 8effb7205..53ad7c832 100644 --- a/content/en/project/_index.md +++ b/content/en/project/_index.md @@ -2,6 +2,9 @@ Title: The Medley Interlisp Project weight: 2 type: docs +outputs: + - html + - rss aliases: - /hugo/ - /medley/project/ diff --git a/content/en/software/_index.md b/content/en/software/_index.md index ccd091858..796401ff7 100644 --- a/content/en/software/_index.md +++ b/content/en/software/_index.md @@ -1,6 +1,9 @@ --- title: Software type: docs +outputs: + - html + - rss aliases: --- diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 000000000..69126f700 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,61 @@ +{{- $authorName := "" }} +{{- with .Site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} + +{{- $pages := slice }} +{{- $mainPages := where .Pages "Kind" "in" (slice "page" "section") }} +{{- $pages = $pages | union $mainPages }} + +{{- range .Sections }} + {{- $sectionPages := where .Pages "Kind" "in" (slice "page" "section") }} + {{- $pages = $pages | union $sectionPages }} + {{- range .Sections }} + {{- $subSectionPages := where .Pages "Kind" "in" (slice "page" "section") }} + {{- $pages = $pages | union $subSectionPages }} + {{- end }} +{{- end }} + +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} + {{- $pages = $pages | first $limit }} +{{- end }} + + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + 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 }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Summary | html }} + {{ range .Params.tags }} + {{ . }} + {{ end }} + + {{ end }} + + From df65935e16340533ad9a1ff299c4c4ff12d64bbe Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Tue, 24 Dec 2024 17:31:23 -0500 Subject: [PATCH 3/5] Add rss Feed to Footer Update rssFeed url value to project/status page Add frontmatter and enable git info These changes allow us to get the last modified date for pages. Update page-meta-lastmod file to not show git commit info --- config/_default/hugo.yaml | 9 ++++++++- config/_default/params.yaml | 4 ++++ content/en/project/_index.md | 3 --- content/en/project/status/_index.md | 3 +++ content/en/software/_index.md | 3 --- layouts/_default/rss.xml | 3 +++ layouts/partials/footer/links.html | 17 +++++++++++++++++ layouts/partials/page-meta-lastmod.html | 13 +++++++++++++ 8 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 layouts/partials/footer/links.html create mode 100644 layouts/partials/page-meta-lastmod.html diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml index 272ac9e1c..89b80dc5a 100644 --- a/config/_default/hugo.yaml +++ b/config/_default/hugo.yaml @@ -24,7 +24,7 @@ enableRobotsTXT: false assetDir: static # Enable .GitInfo object for each page. This will give values to .Lastmod etc. -enableGitInfo: false +enableGitInfo: true # Top Level Language defaults # See languages.yaml for language specific values @@ -45,6 +45,13 @@ outputs: section: - HTML +frontmatter: + date: + - date + - pubdate + - :git + - :default + # Code Highlighting configuration # Not Used. Code highlighting is controlled using the highlighting # section in `markup.yaml` diff --git a/config/_default/params.yaml b/config/_default/params.yaml index 98850125b..7f98e30f3 100644 --- a/config/_default/params.yaml +++ b/config/_default/params.yaml @@ -79,6 +79,10 @@ links: url: "https://bsky.app/profile/interlisp.org" icon: "fa-brands fa-bluesky" desc: "We're on Bluesky too!" + - name: "RSS Feed" + url: "project/status/index.xml" + icon: "fa fa-rss" + desc: "Subscribe to our feed for the latest updates" # - name: "Stack Overflow" # url: "https://stackoverflow.com/questions/tagged/graphviz" # icon: "fab fa-stack-overflow" diff --git a/content/en/project/_index.md b/content/en/project/_index.md index 53ad7c832..8effb7205 100644 --- a/content/en/project/_index.md +++ b/content/en/project/_index.md @@ -2,9 +2,6 @@ Title: The Medley Interlisp Project weight: 2 type: docs -outputs: - - html - - rss aliases: - /hugo/ - /medley/project/ diff --git a/content/en/project/status/_index.md b/content/en/project/status/_index.md index fb1780904..e1998228d 100644 --- a/content/en/project/status/_index.md +++ b/content/en/project/status/_index.md @@ -2,6 +2,9 @@ title: News and Status Reports type: docs weight: 2 +outputs: + - html + - rss aliases: - /hugo/news/ - /medley/project/news/ diff --git a/content/en/software/_index.md b/content/en/software/_index.md index 796401ff7..ccd091858 100644 --- a/content/en/software/_index.md +++ b/content/en/software/_index.md @@ -1,9 +1,6 @@ --- title: Software type: docs -outputs: - - html - - rss aliases: --- diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 69126f700..e06a3920e 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -12,6 +12,9 @@ {{- $pctx := . }} {{- if .IsHome }}{{ $pctx = .Site }}{{ end }} + {{- $pages := slice }} {{- $mainPages := where .Pages "Kind" "in" (slice "page" "section") }} {{- $pages = $pages | union $mainPages }} diff --git a/layouts/partials/footer/links.html b/layouts/partials/footer/links.html new file mode 100644 index 000000000..8fb1e38b4 --- /dev/null +++ b/layouts/partials/footer/links.html @@ -0,0 +1,17 @@ + diff --git a/layouts/partials/page-meta-lastmod.html b/layouts/partials/page-meta-lastmod.html new file mode 100644 index 000000000..1b4e36a05 --- /dev/null +++ b/layouts/partials/page-meta-lastmod.html @@ -0,0 +1,13 @@ +{{ if and .GitInfo .Site.Params.github_repo -}} +
+ +
+{{ end -}} \ No newline at end of file From 096ac7b62e501a7f9dbbc6ade5caf318ceeb0dbe Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Thu, 26 Dec 2024 16:39:44 -0500 Subject: [PATCH 4/5] Update config files to rename RSS Feed to rss.xml --- config/_default/hugo.yaml | 4 ++++ config/_default/params.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml index 89b80dc5a..7ce1140d5 100644 --- a/config/_default/hugo.yaml +++ b/config/_default/hugo.yaml @@ -52,6 +52,10 @@ frontmatter: - :git - :default +outputFormats: + rss: + baseName: rss + # Code Highlighting configuration # Not Used. Code highlighting is controlled using the highlighting # section in `markup.yaml` diff --git a/config/_default/params.yaml b/config/_default/params.yaml index 7f98e30f3..4b708c243 100644 --- a/config/_default/params.yaml +++ b/config/_default/params.yaml @@ -80,7 +80,7 @@ links: icon: "fa-brands fa-bluesky" desc: "We're on Bluesky too!" - name: "RSS Feed" - url: "project/status/index.xml" + url: "project/status/rss.xml" icon: "fa fa-rss" desc: "Subscribe to our feed for the latest updates" # - name: "Stack Overflow" From a17d408ed671eadbee04b8d932edd09548611839 Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Thu, 26 Dec 2024 17:18:02 -0500 Subject: [PATCH 5/5] Update title and description lines Title and Description are set to Updates from the Medley Interlisp Project. --- layouts/_default/rss.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index e06a3920e..22f0c5531 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -35,9 +35,9 @@ - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + Updates from the Medley Interlisp Project {{ .Permalink }} - Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Updates from the Medley Interlisp Project Hugo -- gohugo.io{{ with .Site.LanguageCode }} {{.}}{{end}}{{ with .Site.Author.email }} {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }}