From 3fcdc6c4b5d087e78b4f20ce2aa6a6ff7006d993 Mon Sep 17 00:00:00 2001 From: Emruz Hossain Date: Fri, 7 Feb 2025 02:16:58 +0600 Subject: [PATCH] Make RSS feed path configurable Fixes #997 Add configuration option for RSS feed path * Add `rssPath` configuration option in `exampleSite/hugo.yaml` under the `params` section to specify the desired RSS feed path. * Set the default value of `rssPath` to `/rss.xml`. * Update `layouts/_default/baseof.html` to include the RSS feed link with the configured `rssPath` value. * Use the default path `/index.xml` if `rssPath` is not specified. --- exampleSite/hugo.yaml | 3 ++- layouts/_default/baseof.html | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index f4d3921..7b790d2 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -1,4 +1,3 @@ - baseURL: http://example.org/ languageCode: en-us title: Example Site @@ -300,6 +299,8 @@ params: readingTime: enable: true + # Add RSS feed path configuration + rssPath: /rss.xml # Provide footer configuration. footer: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 0bc1689..0c46413 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,6 +16,8 @@ {{ .Content | safeJS }} {{ end }} + {{ $rssPath := .Site.Params.rssPath | default "/index.xml" }} +