From 08077605ac57fc2010f7afc756b00548a415db4e Mon Sep 17 00:00:00 2001 From: adnano Date: Mon, 21 Dec 2020 16:41:05 -0500 Subject: [PATCH] Improve configuration of multiple URLs --- config.go | 5 +++-- doc/kiln.1.scd | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config.go b/config.go index 15c9ce9..59359f8 100644 --- a/config.go +++ b/config.go @@ -2,6 +2,7 @@ package main import ( "os" + "strings" "text/template" "git.sr.ht/~adnano/go-ini" @@ -36,8 +37,8 @@ func (c *Config) Load(path string) error { switch key { case "title": c.Title = value - case "url": - c.URLs = append(c.URLs, value) + case "urls": + c.URLs = strings.Fields(value) } case "feeds": c.Feeds[key] = value diff --git a/doc/kiln.1.scd b/doc/kiln.1.scd index ed7e53d..85ec9ef 100644 --- a/doc/kiln.1.scd +++ b/doc/kiln.1.scd @@ -71,8 +71,8 @@ Site metadata contains the following information: :[ *Description* | Title : The title of the site. -| URL -: The URL of the site. +| URLs +: The URLs of the site. To configure these variables, see *CONFIGURATION*. @@ -135,7 +135,7 @@ Atom feed templates are provided with the following information: Feeds are written to the directory path plus "atom.xml". -The default feed template uses the site URL, if present, to make relative links into absolute URLs. +The default feed template uses the site URLs, if present, to make relative links into absolute URLs. ## HTML TEMPLATES @@ -163,12 +163,12 @@ The following keys are supported: :[ *Description* | title : Site title -| url -: Site URL. +| urls +: A list of site URLs separated by whitespace. Site URLs are only used when generating Atom feeds. -Site URLs should not end with a trailing slash. -More than one site URL may be specified by specifying multiple url keys. +Site URLs may contain paths, but should not end with a trailing slash. +Multiple site URLs may be specified if they are separated by whitespace. This allows a site that is hosted on both Gemini and HTTP to specify URLs for both locations. The following sections are supported: