summaryrefslogtreecommitdiffstats
path: root/output
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-24 16:54:37 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 15:43:56 +0200
commit5761b93c96e89a1e269156c179841301e5808fad (patch)
treee587df59eadc45a2ab86c86c65a2956d1812b961 /output
parent87188496fbb68c39567ec3ee3a55a9305a13e48b (diff)
hugolib, output: Fix RSSLink vs output formats
And remove the now superflous setPageURLs method.
Diffstat (limited to 'output')
-rw-r--r--output/outputFormat.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/output/outputFormat.go b/output/outputFormat.go
index 2ef5fb62b..7137775db 100644
--- a/output/outputFormat.go
+++ b/output/outputFormat.go
@@ -23,6 +23,7 @@ import (
var (
// An ordered list of built-in output formats
// See https://www.ampproject.org/learn/overview/
+ // TODO(bep) output rename to AMPFormat etc.
AMPType = Format{
Name: "AMP",
MediaType: media.HTMLType,
@@ -84,6 +85,17 @@ var builtInTypes = map[string]Format{
type Formats []Format
+func (formats Formats) GetByName(name string) (f Format, found bool) {
+ for _, ff := range formats {
+ if name == ff.Name {
+ f = ff
+ found = true
+ return
+ }
+ }
+ return
+}
+
// Format represents an output represenation, usually to a file on disk.
type Format struct {
// The Name is used as an identifier. Internal output formats (i.e. HTML and RSS)