summaryrefslogtreecommitdiffstats
path: root/output/outputFormat.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-22 09:54:56 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 15:43:56 +0200
commitc7dbee2321af2f0d61bdc976829681f3799582a9 (patch)
treefe92dc2115586b210c6efc34fbffcda7a6a4f341 /output/outputFormat.go
parent29d3778ba10f806cc2e252c4eec0f3798905c9a6 (diff)
hugolib, output: Add Rel to the output format
To make it super-easy to create rel-links.
Diffstat (limited to 'output/outputFormat.go')
-rw-r--r--output/outputFormat.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/output/outputFormat.go b/output/outputFormat.go
index 392414cca..3812030d1 100644
--- a/output/outputFormat.go
+++ b/output/outputFormat.go
@@ -23,26 +23,26 @@ import (
var (
// An ordered list of built-in output formats
// See https://www.ampproject.org/learn/overview/
- // TODO
- // <link rel="amphtml" href="{{ .Permalink }}">
- // canonical
AMPType = Format{
Name: "AMP",
MediaType: media.HTMLType,
BaseName: "index",
Path: "amp",
+ Rel: "amphtml",
}
CSSType = Format{
Name: "CSS",
MediaType: media.CSSType,
BaseName: "styles",
+ Rel: "stylesheet",
}
HTMLType = Format{
Name: "HTML",
MediaType: media.HTMLType,
BaseName: "index",
+ Rel: "canonical",
}
JSONType = Format{
@@ -50,6 +50,7 @@ var (
MediaType: media.JSONType,
BaseName: "index",
IsPlainText: true,
+ Rel: "alternate",
}
RSSType = Format{
@@ -57,6 +58,7 @@ var (
MediaType: media.RSSType,
BaseName: "index",
NoUgly: true,
+ Rel: "alternate",
}
)
@@ -84,6 +86,16 @@ type Format struct {
// The base output file name used when not using "ugly URLs", defaults to "index".
BaseName string
+ // The value to use for rel links
+ //
+ // See https://www.w3schools.com/tags/att_link_rel.asp
+ //
+ // AMP has a special requirement in this department, see:
+ // https://www.ampproject.org/docs/guides/deploy/discovery
+ // I.e.:
+ // <link rel="amphtml" href="https://www.example.com/url/to/amp/document.html">
+ Rel string
+
// The protocol to use, i.e. "webcal://". Defaults to the protocol of the baseURL.
Protocol string