This commit is contained in:
Bjørn Erik Pedersen 2018-06-11 22:32:19 +02:00
commit e02629f81a
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
21 changed files with 41 additions and 35 deletions

View file

@ -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 %}}

View file

@ -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

View file

@ -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/

View file

@ -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 Pages `.Now` (uppercase with leading dot), which causes build error that looks like the following:

View file

@ -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 %}}