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.
This commit is contained in:
Emruz Hossain 2025-02-07 02:16:58 +06:00
parent ba6bb5d369
commit 3fcdc6c4b5
2 changed files with 4 additions and 1 deletions

View file

@ -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:

View file

@ -16,6 +16,8 @@
{{ .Content | safeJS }}
</script>
{{ end }}
{{ $rssPath := .Site.Params.rssPath | default "/index.xml" }}
<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" href="{{ $rssPath | relURL }}">
</head>
<body class="type-{{ .Page.Type }} kind-{{ .Page.Kind }}" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="80">