mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
docs: Add Pages to variables section
And some other minor doc fixes. Closes #2297 Closes #2649
This commit is contained in:
parent
382582fcda
commit
a5b3b07657
4 changed files with 5 additions and 4 deletions
|
@ -190,7 +190,7 @@ The rendering of the main navigation works as usual. `.Site.Menus` will just con
|
|||
|
||||
```html
|
||||
<ul>
|
||||
{{- $current := . -}}
|
||||
{{- $currentPage := . -}}
|
||||
{{ range .Site.Menus.main -}}
|
||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
|
|
|
@ -102,7 +102,7 @@ Since Hugo 0.18, "everything" is a `Page` that can have content and metadata, li
|
|||
|
||||
To add content and frontmatter to the home page, a section, a taxonomy or a taxonomy terms listing, add a markdown file with the base name `_index` on the relevant place on the file system.
|
||||
|
||||
For the default Markdown content, the filename will be `_index.html`.
|
||||
For the default Markdown content, the filename will be `_index.md`.
|
||||
|
||||
Se the example directory tree below.
|
||||
|
||||
|
|
|
@ -992,9 +992,9 @@ The response of the GitHub API contains the base64-encoded version of the [READM
|
|||
|
||||
|
||||
## .Site.GetPage
|
||||
Every `Page` as a `Kind` attribute that shows what kind of page it is. While this attribute can be used to list pages of a certain `kind` using `where`, often it can be useful to fetch a single page by its path.
|
||||
Every `Page` has a `Kind` attribute that shows what kind of page it is. While this attribute can be used to list pages of a certain `kind` using `where`, often it can be useful to fetch a single page by its path.
|
||||
|
||||
GetPage looks up an index page of a given `Kind` and `path`. This method may support regular pages in the future, but currently it is a convenient way of getting the index pages such as the home page or a section from a template:
|
||||
`GetPage` looks up an index page of a given `Kind` and `path`. This method may support regular pages in the future, but currently it is a convenient way of getting the index pages, such as the home page or a section, from a template:
|
||||
|
||||
```
|
||||
{{ with .Site.GetPage "section" "blog" }}{{ .Title }}{{ end }}
|
||||
|
|
|
@ -48,6 +48,7 @@ matter, content or derived from file location.
|
|||
**.LinkTitle** Access when creating links to this content. Will use `linktitle` if set in front matter, else `title`.<br>
|
||||
**.Next** Pointer to the following content (based on pub date).<br>
|
||||
**.NextInSection** Pointer to the following content within the same section (based on pub date)<br>
|
||||
**.Pages** a collection of associated pages. This will be nil for regular content pages. This is an alias for **.Data.Pages**.
|
||||
**.Permalink** The Permanent link for this page.<br>
|
||||
**.Prev** Pointer to the previous content (based on pub date).<br>
|
||||
**.PrevInSection** Pointer to the previous content within the same section (based on pub date). For example, `{{if .PrevInSection}}{{.PrevInSection.Permalink}}{{end}}`.<br>
|
||||
|
|
Loading…
Reference in a new issue