From 22968db841f30c0e7fa462fece7003c9b4bd177d Mon Sep 17 00:00:00 2001 From: Will Faught Date: Mon, 3 Jun 2024 21:55:11 -0700 Subject: [PATCH] Remove page param id --- archetypes/default.md | 1 - layouts/_default/list.atom.xml | 19 ++----------------- layouts/_default/list.rss.xml | 7 ------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/archetypes/default.md b/archetypes/default.md index 0b914787..a826c3df 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -4,7 +4,6 @@ categories = [] date = "{{ .Date }}" description = "" draft = true -id = "{{ print .File.Path $now.UnixNano | sha1 }}" link = "" tags = [] title = "{{ replace (strings.TrimPrefix (print ($now.Format `2006-01-02`) `-`) .Name) `-` ` ` | title }}" diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index cd0401ae..4150a2b2 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -4,8 +4,7 @@ {{ $format := "2006-01-02T15:04:05Z07:00" }} {{ $html := $page.AlternativeOutputFormats.Get "html" }} {{ $icon := $page.Param "paige.feed.atom.icon" }} -{{ $id := "" }} -{{ $ids := dict }} +{{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") .RelPermalink }} {{ $language := site.LanguageCode | default site.Language.Lang }} {{ $limit := site.Config.Services.RSS.Limit }} {{ $logo := $page.Param "paige.feed.atom.logo" }} @@ -20,14 +19,6 @@ {{ $icon = absLangURL $icon }} {{ end }} -{{ if $page.Params.id }} - {{ $id = printf "%s?id=%v" (urls.JoinPath site.BaseURL "/") $page.Params.id }} -{{ else if not $page.Date.IsZero }} - {{ $id = printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host ($page.Date.Format "2006-01-02") ($page.Date.Format $format) }} -{{ else }} - {{ $id = $page.Permalink }} -{{ end }} - {{ if $logo }} {{ $logo = absLangURL $logo }} {{ end }} @@ -118,7 +109,7 @@ {{ range $subpage := $subpages }} {{ $content := .Content }} - {{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") (cond (.Params.id | not) .RelPermalink .Params.id) }} + {{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") .RelPermalink }} {{ $paramlink := and .Params.link (not (.Param "paige.feed.link_to_page")) | not | not }} {{ $published := cond (not .PublishDate.IsZero) (.PublishDate.Format $format) "" }} {{ $rights := site.Copyright | markdownify }} @@ -139,12 +130,6 @@ {{ $content = .Description | markdownify}} {{ end }} - {{ with index $ids $id }} - {{ warnf "layouts/_default/list.atom.xml: pages %s and %s have the same ID" . $subpage.RelPermalink }} - {{ end }} - - {{ $ids = merge (dict $id .RelPermalink) $ids }} - {{ if not $title }} {{ warnf "layouts/_default/list.atom.xml: page %s does not have a title" .RelPermalink }} {{ end }} diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml index 5cbb2906..a4ab6657 100644 --- a/layouts/_default/list.rss.xml +++ b/layouts/_default/list.rss.xml @@ -4,7 +4,6 @@ {{ $description := or $page.Description "Recent content" }} {{ $feed := ($page.OutputFormats.Get "rss").Permalink }} {{ $format := "Mon, 02 Jan 2006 15:04:05 MST" }} -{{ $guids := dict }} {{ $html := $page.AlternativeOutputFormats.Get "html" }} {{ $language := site.LanguageCode | default site.Language.Lang }} {{ $lastbuilddate := (partial "paige/changed.html" $page).Format $format }} @@ -109,12 +108,6 @@ {{ warnf "layouts/_default/rss.xml: page %s does not have a title or description" .RelPermalink }} {{ end }} - {{ with index $guids $guid }} - {{ warnf "layouts/_default/rss.xml: pages %s and %s have the same GUID" . $subpage.RelPermalink }} - {{ end }} - - {{ $guids = merge (dict $guid .RelPermalink) $guids }} - {{ with $author }} {{ . }} {{ end }}