diff --git a/README.md b/README.md index ee15816..327f919 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,34 @@ Title # The current page title, shorthand for Page.Title Content # The current page's HTML content. ``` -For example, to show a list of the 5 most recent posts: +The `Page` variable is an instance of the object below: + +``` +type Page struct { + // Title of this page + Title string + + // Template this page uses for rendering. Defaults to "default.html". + Template string + + // Time this page was published (parsed from file name). + DatePublished time.Time + + // Time this page was last modified on the filesystem. + DateModified time.Time + + // The full URL to this page, including the site URL. + Permalink string + + // URL path for this page, relative to site URL + UrlPath string + + // Path to source file for this page, relative to content root + Filepath string +} +``` + +To show a list of the 5 most recent posts: ```gotemplate {{ range (slice .Posts 0 5) }} diff --git a/gozer.go b/gozer.go index 9e671fd..1efe07b 100644 --- a/gozer.go +++ b/gozer.go @@ -45,12 +45,25 @@ type Site struct { } type Page struct { + // Title of this page Title string + + // Template this page uses for rendering. Defaults to "default.html". Template string + + // Time this page was published (parsed from file name). DatePublished time.Time + + // Time this page was last modified (from filesystem). DateModified time.Time + + // The full URL to this page (incl. site URL) Permalink string + + // URL path for this page, relative to site URL UrlPath string + + // Path to source file for this page, relative to content root Filepath string }