mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-03 00:50:11 +03:00
Merge commit 'b239595af5
'
This commit is contained in:
commit
e02629f81a
21 changed files with 41 additions and 35 deletions
|
@ -35,9 +35,9 @@ You can limit the number of matches in the list with a third parameter. The foll
|
|||
```
|
||||
|
||||
{{% note %}}
|
||||
Hugo uses Golang's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
|
||||
Hugo uses Go's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
|
||||
|
||||
If you are just learning RegEx, or at least Golang's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
|
||||
If you are just learning RegEx, or at least Go's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ Assuming a key-value of `date: 2017-03-03` in a content file's front matter, you
|
|||
{{ .PublishDate.Format "January 2, 2006" }} => March 3, 2017
|
||||
```
|
||||
|
||||
For formatting *any* string representations of dates defined in your front matter, see the [`dateFormat` function][dateFormat], which will still leverage the Golang layout string explained below but uses a slightly different syntax.
|
||||
For formatting *any* string representations of dates defined in your front matter, see the [`dateFormat` function][dateFormat], which will still leverage the Go layout string explained below but uses a slightly different syntax.
|
||||
|
||||
## Go's Layout String
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ toc: false
|
|||
aliases: []
|
||||
---
|
||||
|
||||
`len` is a built-in function in Golang that returns the length of a variable according to its type. From the Golang documentation:
|
||||
`len` is a built-in function in Go that returns the length of a variable according to its type. From the Go documentation:
|
||||
|
||||
> Array: the number of elements in v.
|
||||
>
|
||||
|
@ -57,4 +57,4 @@ Note the use of `.RegularPages`, a [site variable][] that counts all regular con
|
|||
[list templates]: /templates/lists/
|
||||
[section]: /content-management/sections/
|
||||
[site variable]: /variables/site/
|
||||
[`where`]: /functions/where/
|
||||
[`where`]: /functions/where/
|
||||
|
|
|
@ -37,7 +37,7 @@ would produce the following:
|
|||
</div>
|
||||
```
|
||||
|
||||
The above example uses the [`.Format` function](/functions/format), which page includes a full listing of date formatting using Golang's layout string.
|
||||
The above example uses the [`.Format` function](/functions/format), which page includes a full listing of date formatting using Go's layout string.
|
||||
|
||||
{{% note %}}
|
||||
Older Hugo themes may still be using the obsolete Page’s `.Now` (uppercase with leading dot), which causes build error that looks like the following:
|
||||
|
|
|
@ -25,7 +25,7 @@ aliases: []
|
|||
```
|
||||
|
||||
{{% note %}}
|
||||
Hugo uses Golang's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
|
||||
Hugo uses Go's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
|
||||
|
||||
If you are just learning RegEx, or at least Golang's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
|
||||
If you are just learning RegEx, or at least Go's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
|
||||
{{% /note %}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue