hugolib, source, tpl: Fix docs

See #2014
This commit is contained in:
bogem 2016-11-21 23:01:42 +01:00 committed by Bjørn Erik Pedersen
parent e81c06c3f0
commit 75e55cd06f
3 changed files with 12 additions and 7 deletions

View file

@ -227,7 +227,8 @@ func (p Pages) groupByDateField(sorter func(p Pages) Pages, formatter func(p *Pa
return r, nil
}
// GroupByDate groups by the given page's Date value in the given format and with the given order.
// GroupByDate groups by the given page's Date value in
// the given format and with the given order.
// Valid values for order is asc, desc, rev and reverse.
// For valid format strings, see https://golang.org/pkg/time/#Time.Format
func (p Pages) GroupByDate(format string, order ...string) (PagesGroup, error) {
@ -240,7 +241,8 @@ func (p Pages) GroupByDate(format string, order ...string) (PagesGroup, error) {
return p.groupByDateField(sorter, formatter, order...)
}
// GroupByPublishDate groups by the given page's PublishDate value in the given format and with the given order.
// GroupByPublishDate groups by the given page's PublishDate value in
// the given format and with the given order.
// Valid values for order is asc, desc, rev and reverse.
// For valid format strings, see https://golang.org/pkg/time/#Time.Format
func (p Pages) GroupByPublishDate(format string, order ...string) (PagesGroup, error) {
@ -253,7 +255,8 @@ func (p Pages) GroupByPublishDate(format string, order ...string) (PagesGroup, e
return p.groupByDateField(sorter, formatter, order...)
}
// GroupByExpireDate groups by the given page's ExpireDate value in the given format and with the given order.
// GroupByExpiryDate groups by the given page's ExpireDate value in
// the given format and with the given order.
// Valid values for order is asc, desc, rev and reverse.
// For valid format strings, see https://golang.org/pkg/time/#Time.Format
func (p Pages) GroupByExpiryDate(format string, order ...string) (PagesGroup, error) {
@ -266,7 +269,8 @@ func (p Pages) GroupByExpiryDate(format string, order ...string) (PagesGroup, er
return p.groupByDateField(sorter, formatter, order...)
}
// GroupByParamDate groups by a date set as a param on the page in the given format and with the given order.
// GroupByParamDate groups by a date set as a param on the page in
// the given format and with the given order.
// Valid values for order is asc, desc, rev and reverse.
// For valid format strings, see https://golang.org/pkg/time/#Time.Format
func (p Pages) GroupByParamDate(key string, format string, order ...string) (PagesGroup, error) {

View file

@ -54,12 +54,13 @@ func (f *File) Bytes() []byte {
return helpers.ReaderToBytes(f.Contents)
}
// BaseFileName Filename without extension.
// BaseFileName is a filename without extension.
func (f *File) BaseFileName() string {
return f.baseName
}
// Filename with no extension, not even the optional language extension part.
// TranslationBaseName is a filename with no extension,
// not even the optional language extension part.
func (f *File) TranslationBaseName() string {
return f.translationBaseName
}

View file

@ -68,7 +68,7 @@ type GoHTMLTemplate struct {
errors []*templateErr
}
// The "Global" Template System
// T is the "global" template system
func T() Template {
if tmpl == nil {
tmpl = New()