cerca

lean forum software (pmc local branch)
Log | Files | Refs | README | LICENSE

commit 5a07069d5daed046f1bb9fc77b8f568e43249d9b
parent e7fd18a2c195e83f99c8c91cb0b61f436005f49c
Author: cblgh <cblgh@cblgh.org>
Date:   Mon, 12 Dec 2022 11:57:20 +0100

update defaults and document rss

Diffstat:
MREADME.md | 5+++++
Mdefaults/sample-config.toml | 5+++++
Mserver/server.go | 6+++++-
3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -39,6 +39,11 @@ name = "" # whatever you want to name your forum; primarily used as display in t conduct_url = "" # optional + recommended: if omitted, the CoC checkboxes in /register will be hidden language = "English" # Swedish, English. contributions for more translations welcome! +[rss] +feed_name = "" # defaults to [general]'s name if unset +feed_description = "" +forum_url = "" # should be forum index route https://example.com. used to generate post routes for feed, must be set to generate a feed + [documents] logo = "content/logo.html" # can contain emoji, <img>, <svg> etc. see defaults/sample-logo.html in repo for instructions about = "content/about.md" diff --git a/defaults/sample-config.toml b/defaults/sample-config.toml @@ -3,6 +3,11 @@ name = "" # whatever you want to name your forum; primarily used as display in t conduct_url = "" # optional + recommended: if omitted, the CoC checkboxes in /register will be hidden language = "English" # Swedish, English. contributions for more translations welcome! +[rss] +feed_name = "" # defaults to [general]'s name if unset +feed_description = "" +forum_url = "" # should be forum index route https://example.com. used to generate post routes for feed, must be set to generate a feed + [documents] logo = "content/logo.html" # can contain emoji, <img>, <svg> etc. see defaults/sample-logo.html in repo for instructions about = "content/about.md" diff --git a/server/server.go b/server/server.go @@ -364,7 +364,11 @@ func GenerateRSS(db *database.DB, config types.Config) string { entry := rss.OutputRSSItem(fulltime, t.Title, fmt.Sprintf("[%s] %s posted", date, t.Author), posturl) entries[i] = entry } - feed := rss.OutputRSS(config.RSS.Name, config.RSS.URL, config.RSS.Description, entries) + feedName := config.RSS.Name + if feedName == "" { + feedName = config.Community.Name + } + feed := rss.OutputRSS(feedName, config.RSS.URL, config.RSS.Description, entries) return feed }