mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Merge commit 'b239595af5a9fc1fc9a1ccc666c3ab06ccc32f04'
This commit is contained in:
@@ -29,7 +29,7 @@ Go templates provide an extremely simple template language that adheres to the b
|
||||
|
||||
## Basic Syntax
|
||||
|
||||
Golang templates are HTML files with the addition of [variables][variables] and [functions][functions]. Golang template variables and functions are accessible within `{{ }}`.
|
||||
Go templates are HTML files with the addition of [variables][variables] and [functions][functions]. Go template variables and functions are accessible within `{{ }}`.
|
||||
|
||||
### Access a Predefined Variable
|
||||
|
||||
@@ -104,7 +104,7 @@ Go templates only ship with a few basic functions but also provide a mechanism f
|
||||
Note that both examples make use of Go template's [math functions][].
|
||||
|
||||
{{% note "Additional Boolean Operators" %}}
|
||||
There are more boolean operators than those listed in the Hugo docs in the [Golang template documentation](http://golang.org/pkg/text/template/#hdr-Functions).
|
||||
There are more boolean operators than those listed in the Hugo docs in the [Go template documentation](http://golang.org/pkg/text/template/#hdr-Functions).
|
||||
{{% /note %}}
|
||||
|
||||
## Includes
|
||||
@@ -526,8 +526,8 @@ Go allows you to do more than what's shown here. Using Hugo's [`where` function]
|
||||
[first]: /functions/first/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[functions]: /functions/ "See the full list of Hugo's templating functions with a quick start reference guide and basic and advanced examples."
|
||||
[Go html/template]: http://golang.org/pkg/html/template/ "Godocs references for Golang's html templating"
|
||||
[gohtmltemplate]: http://golang.org/pkg/html/template/ "Godocs references for Golang's html templating"
|
||||
[Go html/template]: http://golang.org/pkg/html/template/ "Godocs references for Go's html templating"
|
||||
[gohtmltemplate]: http://golang.org/pkg/html/template/ "Godocs references for Go's html templating"
|
||||
[index]: /functions/index/
|
||||
[math functions]: /functions/math/
|
||||
[partials]: /templates/partials/ "Link to the partial templates page inside of the templating section of the Hugo docs"
|
||||
|
@@ -77,12 +77,12 @@ Using the above example, let's assume you have the following in `content/post/_i
|
||||
|
||||
{{< code file="content/post/_index.md" >}}
|
||||
---
|
||||
title: My Golang Journey
|
||||
title: My Go Journey
|
||||
date: 2017-03-23
|
||||
publishdate: 2017-03-24
|
||||
---
|
||||
|
||||
I decided to start learning Golang in March 2017.
|
||||
I decided to start learning Go in March 2017.
|
||||
|
||||
Follow my journey through this new blog.
|
||||
{{< /code >}}
|
||||
@@ -118,9 +118,9 @@ This above will output the following HTML:
|
||||
<main>
|
||||
<article>
|
||||
<header>
|
||||
<h1>My Golang Journey</h1>
|
||||
<h1>My Go Journey</h1>
|
||||
</header>
|
||||
<p>I decided to start learning Golang in March 2017.</p>
|
||||
<p>I decided to start learning Go in March 2017.</p>
|
||||
<p>Follow my journey through this new blog.</p>
|
||||
</article>
|
||||
<ul>
|
||||
@@ -457,7 +457,7 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
|
||||
|
||||
### By Page Parameter in Date Format
|
||||
|
||||
The following template takes grouping by `date` a step further and uses Golang's layout string. See the [`Format` function][] for more examples of how to use Golang's layout string to format dates in Hugo.
|
||||
The following template takes grouping by `date` a step further and uses Go's layout string. See the [`Format` function][] for more examples of how to use Go's layout string to format dates in Hugo.
|
||||
|
||||
{{< code file="layouts/partials/by-page-param-as-date.html" >}}
|
||||
<!-- Groups content by month according to the "param_key" field in front matter -->
|
||||
|
Reference in New Issue
Block a user