mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
333646c52d
commit
04889a5ee6
1 changed files with 14 additions and 0 deletions
|
@ -161,6 +161,20 @@ Also available is `.Site` which has the following:
|
|||
**.Site.BuildDrafts** A boolean (Default: false) to indicate whether to build drafts. Defined in the site configuration.<br>
|
||||
**.Site.Data** Custom data, see [Data Files](/extras/datafiles/).<br>
|
||||
|
||||
## File Variables
|
||||
|
||||
The `.File` variable gives you additional information of a page.
|
||||
|
||||
> **Note:** `.File` is only accessible on *Pages* but **not** on *Nodes* (like the homepage and list pages).
|
||||
|
||||
Available are the following attributes:
|
||||
|
||||
**.File.Path** The original relative path of the page, e.g. `content/posts/foo.md`<br>
|
||||
**.File.LogicalName** The name of the content file that represents a page, e.g. `foo.md`<br>
|
||||
**.File.BaseFileName** The filename without extension, e.g. `foo`<br>
|
||||
**.File.Ext** or **.File.Extension** The file extension of the content file, e.g. `md`<br>
|
||||
**.File.Dir** Given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned, e.g. `posts/dir1/dir2/`<br>
|
||||
|
||||
## Hugo Variables
|
||||
|
||||
Also available is `.Hugo` which has the following:
|
||||
|
|
Loading…
Reference in a new issue