summaryrefslogtreecommitdiffstats
path: root/output
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2018-09-06 17:00:19 -0500
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-09-07 08:25:51 +0200
commit3f45e729f4e0296bb1a3558d60087bec8321444b (patch)
tree7f8d5ad32c7fe6962ebc0ac974786f4338584e1f /output
parentffaa73dc8aa860edb3476b2a460774071b8470a4 (diff)
output: Fix golint godoc issues
Diffstat (limited to 'output')
-rw-r--r--output/layout_base.go3
-rw-r--r--output/outputFormat.go9
2 files changed, 9 insertions, 3 deletions
diff --git a/output/layout_base.go b/output/layout_base.go
index d3c52347c..b8930df82 100644
--- a/output/layout_base.go
+++ b/output/layout_base.go
@@ -30,6 +30,7 @@ var (
goTemplateInnerMarkers = [][]byte{[]byte("{{define"), []byte("{{ define"), []byte("{{- define"), []byte("{{-define")}
)
+// TemplateNames represents a template naming scheme.
type TemplateNames struct {
// The name used as key in the template map. Note that this will be
// prefixed with "_text/" if it should be parsed with text/template.
@@ -39,6 +40,7 @@ type TemplateNames struct {
MasterFilename string
}
+// TemplateLookupDescriptor describes the template lookup configuration.
type TemplateLookupDescriptor struct {
// The full path to the site root.
WorkingDir string
@@ -62,6 +64,7 @@ func isShorthCodeOrPartial(name string) bool {
return strings.HasPrefix(name, "shortcodes/") || strings.HasPrefix(name, "partials/")
}
+// CreateTemplateNames returns a TemplateNames object for a given template.
func CreateTemplateNames(d TemplateLookupDescriptor) (TemplateNames, error) {
name := filepath.ToSlash(d.RelPath)
diff --git a/output/outputFormat.go b/output/outputFormat.go
index 30bf903b4..ec1838b39 100644
--- a/output/outputFormat.go
+++ b/output/outputFormat.go
@@ -71,10 +71,8 @@ type Format struct {
NotAlternative bool `json:"notAlternative"`
}
+// An ordered list of built-in output formats.
var (
- // An ordered list of built-in output formats
- //
- // See https://www.ampproject.org/learn/overview/
AMPFormat = Format{
Name: "AMP",
MediaType: media.HTMLType,
@@ -82,6 +80,7 @@ var (
Path: "amp",
Rel: "amphtml",
IsHTML: true,
+ // See https://www.ampproject.org/learn/overview/
}
CalendarFormat = Format{
@@ -150,6 +149,7 @@ var (
}
)
+// DefaultFormats contains the default output formats supported by Hugo.
var DefaultFormats = Formats{
AMPFormat,
CalendarFormat,
@@ -166,6 +166,7 @@ func init() {
sort.Sort(DefaultFormats)
}
+// Formats is a slice of Format.
type Formats []Format
func (formats Formats) Len() int { return len(formats) }
@@ -330,10 +331,12 @@ func decode(mediaTypes media.Types, input, output interface{}) error {
return decoder.Decode(input)
}
+// BaseFilename returns the base filename of formats.
func (formats Format) BaseFilename() string {
return formats.BaseName + formats.MediaType.FullSuffix()
}
+// MarshalJSON returns the JSON encoding of formats.
func (formats Format) MarshalJSON() ([]byte, error) {
type Alias Format
return json.Marshal(&struct {