package pagemeta
import "github.com/gohugoio/hugo/hugolib/pagemeta"
Index ¶
- type FrontMatterDescriptor
- type FrontMatterHandler
- func NewFrontmatterHandler(logger *jww.Notepad, cfg config.Provider) (FrontMatterHandler, error)
- func (f FrontMatterHandler) HandleDates(d *FrontMatterDescriptor) error
- func (f FrontMatterHandler) IsDateKey(key string) bool
- type PageDates
- type URLPath
Types ¶
type FrontMatterDescriptor ¶
type FrontMatterDescriptor struct { // This the Page's front matter. Frontmatter map[string]interface{} // This is the Page's base filename, e.g. page.md. BaseFilename string // The content file's mod time. ModTime time.Time // May be set from the author date in Git. GitAuthorDate time.Time // This is the Page's params. Params map[string]interface{} // This is the Page's dates. Dates *PageDates // This is the Page's Slug etc. PageURLs *URLPath }
FrontMatterDescriptor describes how to handle front matter for a given Page. It has pointers to values in the receiving page which gets updated.
type FrontMatterHandler ¶
type FrontMatterHandler struct {
// contains filtered or unexported fields
}
FrontMatterHandler maps front matter into Page fields and .Params. Note that we currently have only extracted the date logic.
func NewFrontmatterHandler ¶
NewFrontmatterHandler creates a new FrontMatterHandler with the given logger and configuration. If no logger is provided, one will be created.
func (FrontMatterHandler) HandleDates ¶
func (f FrontMatterHandler) HandleDates(d *FrontMatterDescriptor) error
HandleDates updates all the dates given the current configuration and the supplied front matter params. Note that this requires all lower-case keys in the params map.
func (FrontMatterHandler) IsDateKey ¶
func (f FrontMatterHandler) IsDateKey(key string) bool
IsDateKey returns whether the given front matter key is considered a date by the current configuration.
type PageDates ¶
type PageDates struct { Date time.Time Lastmod time.Time PublishDate time.Time ExpiryDate time.Time }
type URLPath ¶
Source Files ¶
page_frontmatter.go pagemeta.go
- Version
- v0.49.1
- Published
- Oct 10, 2018
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 45 seconds ago –
Tools for package owners.