mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Squashed 'docs/' changes from fdea5430f..0584815c8
0584815c8 Add a page about Pages methods (Next, Prev) 653dc8db5 Add note about default bgColor git-subtree-dir: docs git-subtree-split: 0584815c8a9ef49c9682b6468a9f2a1e9f05be46
This commit is contained in:
parent
b9bd35d72e
commit
5070ba6c9e
2 changed files with 32 additions and 0 deletions
|
@ -133,6 +133,8 @@ You can set the background color to use with a 3 or 6 digit hex code starting wi
|
|||
|
||||
For color codes, see https://www.google.com/search?q=color+picker
|
||||
|
||||
**Note** that you also set a default background color to use, see [Image Processing Config](#image-processing-config).
|
||||
|
||||
### JPEG Quality
|
||||
Only relevant for JPEG images, values 1 to 100 inclusive, higher is better. Default is 75.
|
||||
|
||||
|
|
30
content/en/variables/pages.md
Normal file
30
content/en/variables/pages.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: Pages Methods
|
||||
linktitle:
|
||||
description: Pages is the core page collection in Hugo and has many useful methods.
|
||||
date: 2019-10-20
|
||||
categories: [variables and params]
|
||||
keywords: [pages]
|
||||
draft: false
|
||||
menu:
|
||||
docs:
|
||||
title: "methods defined on a page collection"
|
||||
parent: "variables"
|
||||
weight: 21
|
||||
weight: 21
|
||||
sections_weight: 20
|
||||
aliases: [/pages]
|
||||
toc: true
|
||||
---
|
||||
|
||||
Also see [List templates](/templates/lists) for an overview of sort methods.
|
||||
|
||||
## .Next PAGE
|
||||
|
||||
`.Next` and `.Prev` on `Pages` work similar to the methods with the same names on `.Page`, but are more flexible (and slightly slower) as they can be used on any page collection.
|
||||
|
||||
`.Next` points **up** to the next page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}`. Calling `.Next` with the first page in the collection returns `nil`.
|
||||
|
||||
## .Prev PAGE
|
||||
|
||||
`.Prev` points **down** to the previous page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Prev . }}{{.RelPermalink}}{{end}}`. Calling `.Prev` with the last page in the collection returns `nil`.
|
Loading…
Reference in a new issue