diff options
author | Jorin Vogel <[email protected]> | 2017-08-02 14:25:05 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-08-03 15:57:51 +0200 |
commit | 81c13171a985b89f2af6682dbd1d4b8766cb9af7 (patch) | |
tree | db39d78bbe6da0ea3f3dd3d2f94c7e1571ad8fd6 /output | |
parent | 9891c0fb0eb274b8a95b62c40070a87a6e04088c (diff) | |
download | hugo-81c13171a985b89f2af6682dbd1d4b8766cb9af7.tar.gz hugo-81c13171a985b89f2af6682dbd1d4b8766cb9af7.zip |
Add some missing doc comments
As pointed out by the linter, some exported functions and types are
missing doc comments.
The linter warnings have been reduced from 194 to 116.
Not all missing comments have been added in this commit though.
Diffstat (limited to 'output')
-rw-r--r-- | output/layout.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/output/layout.go b/output/layout.go index 6c054b6c4..ee3305758 100644 --- a/output/layout.go +++ b/output/layout.go @@ -30,7 +30,7 @@ type LayoutDescriptor struct { Layout string } -// Layout calculates the layout template to use to render a given output type. +// LayoutHandler calculates the layout template to use to render a given output type. type LayoutHandler struct { hasTheme bool @@ -44,6 +44,7 @@ type layoutCacheKey struct { f Format } +// NewLayoutHandler creates a new LayoutHandler. func NewLayoutHandler(hasTheme bool) *LayoutHandler { return &LayoutHandler{hasTheme: hasTheme, cache: make(map[layoutCacheKey][]string)} } @@ -75,7 +76,7 @@ _default/indexes.VARIATIONS ` layoutsTaxonomy = ` taxonomy/SECTION.VARIATIONS -indexes/SECTION.VARIATIONS +indexes/SECTION.VARIATIONS _default/taxonomy.VARIATIONS _default/list.VARIATIONS ` @@ -86,6 +87,8 @@ indexes/indexes.VARIATIONS ` ) +// For returns a layout for the given LayoutDescriptor and options. +// Layouts are rendered and cached internally. func (l *LayoutHandler) For(d LayoutDescriptor, layoutOverride string, f Format) ([]string, error) { // We will get lots of requests for the same layouts, so avoid recalculations. |