Merge branch 'master' into menu-link-title
@ -1,11 +1,13 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: []
|
||||
keywords: []
|
||||
tags: []
|
||||
weight: 00
|
||||
slug: ""
|
||||
aliases: []
|
||||
toc: false
|
||||
draft: true
|
||||
---
|
||||
---
|
17
archetypes/functions.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: [functions]
|
||||
tags: []
|
||||
ns: ""
|
||||
signature: []
|
||||
workson: []
|
||||
hugoversion: ""
|
||||
aliases: []
|
||||
relatedfuncs: []
|
||||
toc: false
|
||||
deprecated: false
|
||||
---
|
@ -71,7 +71,7 @@ twitter = "GoHugoIO"
|
||||
[params]
|
||||
description = "The world’s fastest framework for building websites"
|
||||
## Used for views in rendered HTML (i.e., rather than using the .Hugo variable)
|
||||
release = "0.31.1"
|
||||
release = "0.33"
|
||||
## Setting this to true will add a "noindex" to *EVERY* page on the site
|
||||
removefromexternalsearch = false
|
||||
## Gh repo for site footer (include trailing slash)
|
||||
|
209
content/about/new-in-032/index.md
Normal file
@ -0,0 +1,209 @@
|
||||
---
|
||||
title: Hugo 0.32 HOWTO
|
||||
description: About page bundles, image processing and more.
|
||||
date: 2017-12-28
|
||||
keywords: [ssg,static,performance,security]
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 10
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: true
|
||||
images:
|
||||
- images/blog/sunset.jpg
|
||||
---
|
||||
|
||||
|
||||
{{% note %}}
|
||||
This documentation belongs in other places in this documentation site, but is put here first ... to get something up and running fast.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
Also see this demo project from [bep](https://github.com/bep/), the clever Norwegian behind these new features:
|
||||
|
||||
* http://hugotest.bep.is/
|
||||
* https://github.com/bep/hugotest (source)
|
||||
|
||||
## Page Resources
|
||||
|
||||
### Organize Your Content
|
||||
|
||||
{{< figure src="/images/hugo-content-bundles.png" title="Pages with image resources" >}}
|
||||
|
||||
The content folder above shows a mix of content pages (`md` (i.e. markdown) files) and image resources.
|
||||
|
||||
{{% note %}}
|
||||
You can use any file type as a content resource as long as it is a MIME type recognized by Hugo (`json` files will, as one example, work fine). If you want to get exotic, you can define your [own media type](/templates/output-formats/#media-types).
|
||||
{{% /note %}}
|
||||
|
||||
The 3 page bundles marked in red explained from top to bottom:
|
||||
|
||||
1. The home page with one image resource (`1-logo.png`)
|
||||
2. The blog section with two images resources and two pages resources (`content1.md`, `content2.md`). Note that the `_index.md` represents the URL for this section.
|
||||
3. An article (`hugo-is-cool`) with a folder with some images and one content resource (`cats-info.md`). Note that the `index.md` represents the URL for this article.
|
||||
|
||||
The content files below `blog/posts` are just regular standalone pages.
|
||||
|
||||
{{% note %}}
|
||||
Note that changes to any resource inside the `content` folder will trigger a reload when running in watch (aka server or live reload mode), it will even work with `--navigateToChanged`.
|
||||
{{% /note %}}
|
||||
|
||||
#### Sort Order
|
||||
|
||||
* Pages are sorted according to standard Hugo page sorting rules.
|
||||
* Images and other resources are sorted in lexicographical order.
|
||||
|
||||
### Handle Page Resources in Templates
|
||||
|
||||
|
||||
#### List all Resources
|
||||
|
||||
```html
|
||||
{{ range .Resources }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .ResourceType | title }}</a></li>
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
For an absolute URL, use `.Permalink`.
|
||||
|
||||
**Note:** The permalink will be relative to the content page, respecting permalink settings. Also, included page resources will not have a value for `RelPermalink`.
|
||||
|
||||
#### List All Resources by Type
|
||||
|
||||
```html
|
||||
{{ with .Resources.ByType "image" }}
|
||||
{{ end }}
|
||||
|
||||
```
|
||||
|
||||
Type here is `page` for pages, else the main type in the MIME type, so `image`, `json` etc.
|
||||
|
||||
#### Get a Specific Resource
|
||||
|
||||
```html
|
||||
{{ $logo := .Resources.GetByPrefix "logo" }}
|
||||
{{ with $logo }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
#### Include Page Resource Content
|
||||
|
||||
```html
|
||||
{{ with .Resources.ByType "page" }}
|
||||
{{ range . }}
|
||||
<h3>{{ .Title }}</h3>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Image Processing
|
||||
|
||||
The `image` resource implements the methods `Resize`, `Fit` and `Fill`:
|
||||
|
||||
Resize
|
||||
: Resize to the given dimension, `{{ $logo.Resize "200x" }}` will resize to 200 pixels wide and preserve the aspect ratio. Use `{{ $logo.Resize "200x100" }}` to control both height and width.
|
||||
|
||||
Fit
|
||||
: Scale down the image to fit the given dimensions, e.g. `{{ $logo.Fit "200x100" }}` will fit the image inside a box that is 200 pixels wide and 100 pixels high.
|
||||
|
||||
Fill
|
||||
: Resize and crop the image given dimensions, e.g. `{{ $logo.Fill "200x100" }}` will resize and crop to width 200 and height 100
|
||||
|
||||
|
||||
{{% note %}}
|
||||
Image operations in Hugo currently **do not preserve EXIF data** as this is not supported by Go's [image package](https://github.com/golang/go/search?q=exif&type=Issues&utf8=%E2%9C%93). This will be improved on in the future.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
### Image Processing Examples
|
||||
|
||||
_The photo of the sunset used in the examples below is Copyright [Bjørn Erik Pedersen](https://commons.wikimedia.org/wiki/User:Bep) (Creative Commons Attribution-Share Alike 4.0 International license)_
|
||||
|
||||
|
||||
{{< imgproc sunset Resize "300x" >}}
|
||||
|
||||
{{< imgproc sunset Fill "90x120 left" >}}
|
||||
|
||||
{{< imgproc sunset Fill "90x120 right" >}}
|
||||
|
||||
{{< imgproc sunset Fit "90x90" >}}
|
||||
|
||||
{{< imgproc sunset Resize "300x q10" >}}
|
||||
|
||||
|
||||
This is the shortcode used in the examples above:
|
||||
|
||||
|
||||
{{< code file="layouts/shortcodes/imgproc.html" >}}
|
||||
{{< readfile file="layouts/shortcodes/imgproc.html" >}}
|
||||
{{< /code >}}
|
||||
|
||||
And it is used like this:
|
||||
|
||||
```html
|
||||
{{</* imgproc sunset Resize "300x" */>}}
|
||||
```
|
||||
|
||||
### Image Processing Options
|
||||
|
||||
In addition to the dimensions (e.g. `200x100`) where either height or width can be omitted, Hugo supports a set of additional image options:
|
||||
|
||||
Anchor
|
||||
: Only relevant for `Fill`. This is useful for thumbnail generation where the main motive is located in, say, the left corner. Valid are `Center`, `TopLeft`, `Top`, `TopRight`, `Left`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`. Example: `{{ $logo.Fill "200x100 BottomLeft" }}`
|
||||
|
||||
JPEG Quality
|
||||
: Only relevant for JPEG images, values 1 to 100 inclusive, higher is better. Default is 75. `{{ $logo.Resize "200x q50" }}`
|
||||
|
||||
Rotate
|
||||
: Rotates an image by the given angle counter-clockwise. The rotation will be performed first to get the dimensions correct. `{{ $logo.Resize "200x r90" }}`. The main use of this is to be able to manually correct for [EXIF orientation](https://github.com/golang/go/issues/4341) of JPEG images.
|
||||
|
||||
Resample Filter
|
||||
: Filter used in resizing. Default is `Box`, a simple and fast resampling filter appropriate for downscaling. See https://github.com/disintegration/imaging for more. If you want to trade quality for faster processing, this may be a option to test.
|
||||
|
||||
|
||||
|
||||
### Performance
|
||||
|
||||
Processed images are stored below `<project-dir>/resources` (can be set with `resourceDir` config setting). This folder is deliberately placed in the project, as it is recommended to check these into source control as part of the project. These images are not "Hugo fast" to generate, but once generated they can be reused.
|
||||
|
||||
If you change your image settings (e.g. size), remove or rename images etc., you will end up with unused images taking up space and cluttering your project.
|
||||
|
||||
To clean up, run:
|
||||
|
||||
```bash
|
||||
hugo --gc
|
||||
```
|
||||
|
||||
|
||||
{{% note %}}
|
||||
**GC** is short for **Garbage Collection**.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
### Default Image Processing Config
|
||||
|
||||
You can configure an `imaging` section in `config.toml` with default image processing options:
|
||||
|
||||
```toml
|
||||
[imaging]
|
||||
# Default resample filter used for resizing. Default is Box,
|
||||
# a simple and fast averaging filter appropriate for downscaling.
|
||||
# See https://github.com/disintegration/imaging
|
||||
resampleFilter = "box"
|
||||
|
||||
# Defatult JPEG quality setting. Default is 75.
|
||||
quality = 68
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
BIN
content/about/new-in-032/sunset.jpg
Normal file
After Width: | Height: | Size: 88 KiB |
@ -1,45 +0,0 @@
|
||||
---
|
||||
title: Roadmap
|
||||
linktitle: Roadmap
|
||||
description: Take a look at what's in the pipeline for future versions of the Hugo project.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [about hugo]
|
||||
keywords: [about,contribute,roadmap]
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 50
|
||||
weight: 50
|
||||
sections_weight: 50
|
||||
draft: false
|
||||
aliases: [/meta/roadmap]
|
||||
toc: false
|
||||
---
|
||||
|
||||
Se the Hugo [GitHub Milestones][milestones].
|
||||
|
||||
We are not too far away from Hugo 1.0.
|
||||
|
||||
[bep](https://github.com/bep/) currently leads the Hugo development. The roadmap is in his head.
|
||||
|
||||
## Contributions Welcome
|
||||
|
||||
Feel free to [contribute to Hugo's development][devcontribute], [improve Hugo's documentation][doccontribute], or [open a new issue][newissue] if you have an idea for a new feature.
|
||||
|
||||
[#98]: https://github.com/gohugoio/hugo/issues/98
|
||||
[#1014]: https://github.com/gohugoio/hugo/issues/1014
|
||||
[#1435]: https://github.com/gohugoio/hugo/issues/1435
|
||||
[#1436]: https://github.com/gohugoio/hugo/issues/1436
|
||||
[devcontribute]: /contribute/development/
|
||||
[doccontribute]: /contribute/documentation/
|
||||
[hosting and deployment]: /hosting-and-deployment/
|
||||
[migrate]: /tools/migrations/
|
||||
[milestones]: https://github.com/gohugoio/hugo/milestones/
|
||||
[newissue]: https://github.com/gohugoio/hugo/issues/
|
||||
[related forum thread]: https://discourse.gohugo.io/t/web-based-editor/155
|
||||
[themes]: /themes/
|
||||
[themescontrib]: /contribute/themes/
|
||||
[tutorials]: /tutorials
|
||||
[***your*** best ideas!]: /contribute/
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo"
|
||||
slug: hugo
|
||||
url: /commands/hugo/
|
||||
@ -42,6 +42,7 @@ hugo [flags]
|
||||
--disableSitemap do not build Sitemap file
|
||||
--enableGitInfo add Git revision, date and author info to the pages
|
||||
--forceSyncStatic copy all files when static is changed.
|
||||
--gc enable to run some cleanup tasks (remove unused cache files) after the build
|
||||
-h, --help help for hugo
|
||||
--i18n-warnings print missing translations
|
||||
--ignoreCache ignores the cache directory
|
||||
@ -80,4 +81,4 @@ hugo [flags]
|
||||
* [hugo undraft](/commands/hugo_undraft/) - Undraft resets the content's draft status
|
||||
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo benchmark"
|
||||
slug: hugo_benchmark
|
||||
url: /commands/hugo_benchmark/
|
||||
@ -38,6 +38,7 @@ hugo benchmark [flags]
|
||||
--disableSitemap do not build Sitemap file
|
||||
--enableGitInfo add Git revision, date and author info to the pages
|
||||
--forceSyncStatic copy all files when static is changed.
|
||||
--gc enable to run some cleanup tasks (remove unused cache files) after the build
|
||||
-h, --help help for benchmark
|
||||
--i18n-warnings print missing translations
|
||||
--ignoreCache ignores the cache directory
|
||||
@ -72,4 +73,4 @@ hugo benchmark [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo check"
|
||||
slug: hugo_check
|
||||
url: /commands/hugo_check/
|
||||
@ -35,4 +35,4 @@ Contains some verification checks
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo check ulimit"
|
||||
slug: hugo_check_ulimit
|
||||
url: /commands/hugo_check_ulimit/
|
||||
@ -39,4 +39,4 @@ hugo check ulimit [flags]
|
||||
### SEE ALSO
|
||||
* [hugo check](/commands/hugo_check/) - Contains some verification checks
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo config"
|
||||
slug: hugo_config
|
||||
url: /commands/hugo_config/
|
||||
@ -38,4 +38,4 @@ hugo config [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo convert"
|
||||
slug: hugo_convert
|
||||
url: /commands/hugo_convert/
|
||||
@ -42,4 +42,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
|
||||
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo convert toJSON"
|
||||
slug: hugo_convert_toJSON
|
||||
url: /commands/hugo_convert_tojson/
|
||||
@ -42,4 +42,4 @@ hugo convert toJSON [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo convert toTOML"
|
||||
slug: hugo_convert_toTOML
|
||||
url: /commands/hugo_convert_totoml/
|
||||
@ -42,4 +42,4 @@ hugo convert toTOML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo convert toYAML"
|
||||
slug: hugo_convert_toYAML
|
||||
url: /commands/hugo_convert_toyaml/
|
||||
@ -42,4 +42,4 @@ hugo convert toYAML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo env"
|
||||
slug: hugo_env
|
||||
url: /commands/hugo_env/
|
||||
@ -38,4 +38,4 @@ hugo env [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo gen"
|
||||
slug: hugo_gen
|
||||
url: /commands/hugo_gen/
|
||||
@ -38,4 +38,4 @@ A collection of several useful generators.
|
||||
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
|
||||
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo gen autocomplete"
|
||||
slug: hugo_gen_autocomplete
|
||||
url: /commands/hugo_gen_autocomplete/
|
||||
@ -56,4 +56,4 @@ hugo gen autocomplete [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo gen chromastyles"
|
||||
slug: hugo_gen_chromastyles
|
||||
url: /commands/hugo_gen_chromastyles/
|
||||
@ -43,4 +43,4 @@ hugo gen chromastyles [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo gen doc"
|
||||
slug: hugo_gen_doc
|
||||
url: /commands/hugo_gen_doc/
|
||||
@ -45,4 +45,4 @@ hugo gen doc [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo gen man"
|
||||
slug: hugo_gen_man
|
||||
url: /commands/hugo_gen_man/
|
||||
@ -41,4 +41,4 @@ hugo gen man [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo import"
|
||||
slug: hugo_import
|
||||
url: /commands/hugo_import/
|
||||
@ -37,4 +37,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo import jekyll"
|
||||
slug: hugo_import_jekyll
|
||||
url: /commands/hugo_import_jekyll/
|
||||
@ -41,4 +41,4 @@ hugo import jekyll [flags]
|
||||
### SEE ALSO
|
||||
* [hugo import](/commands/hugo_import/) - Import your site from others.
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo list"
|
||||
slug: hugo_list
|
||||
url: /commands/hugo_list/
|
||||
@ -40,4 +40,4 @@ List requires a subcommand, e.g. `hugo list drafts`.
|
||||
* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
|
||||
* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo list drafts"
|
||||
slug: hugo_list_drafts
|
||||
url: /commands/hugo_list_drafts/
|
||||
@ -39,4 +39,4 @@ hugo list drafts [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo list expired"
|
||||
slug: hugo_list_expired
|
||||
url: /commands/hugo_list_expired/
|
||||
@ -40,4 +40,4 @@ hugo list expired [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo list future"
|
||||
slug: hugo_list_future
|
||||
url: /commands/hugo_list_future/
|
||||
@ -40,4 +40,4 @@ hugo list future [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo new"
|
||||
slug: hugo_new
|
||||
url: /commands/hugo_new/
|
||||
@ -48,4 +48,4 @@ hugo new [path] [flags]
|
||||
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
|
||||
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo new site"
|
||||
slug: hugo_new_site
|
||||
url: /commands/hugo_new_site/
|
||||
@ -43,4 +43,4 @@ hugo new site [path] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo new theme"
|
||||
slug: hugo_new_theme
|
||||
url: /commands/hugo_new_theme/
|
||||
@ -42,4 +42,4 @@ hugo new theme [name] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo server"
|
||||
slug: hugo_server
|
||||
url: /commands/hugo_server/
|
||||
@ -50,6 +50,7 @@ hugo server [flags]
|
||||
--disableSitemap do not build Sitemap file
|
||||
--enableGitInfo add Git revision, date and author info to the pages
|
||||
--forceSyncStatic copy all files when static is changed.
|
||||
--gc enable to run some cleanup tasks (remove unused cache files) after the build
|
||||
-h, --help help for server
|
||||
--i18n-warnings print missing translations
|
||||
--ignoreCache ignores the cache directory
|
||||
@ -90,4 +91,4 @@ hugo server [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo undraft"
|
||||
slug: hugo_undraft
|
||||
url: /commands/hugo_undraft/
|
||||
@ -40,4 +40,4 @@ hugo undraft path/to/content [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-11-18T10:28:35+01:00
|
||||
date: 2017-12-28T18:49:29+01:00
|
||||
title: "hugo version"
|
||||
slug: hugo_version
|
||||
url: /commands/hugo_version/
|
||||
@ -38,4 +38,4 @@ hugo version [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-Nov-2017
|
||||
###### Auto generated by spf13/cobra on 28-Dec-2017
|
||||
|
@ -6,7 +6,7 @@ date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-04-06
|
||||
categories: [content management]
|
||||
keywords: [markdown,asciidoc,mmark,content format]
|
||||
keywords: [markdown,asciidoc,mmark,pandoc,content format]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
@ -195,12 +195,19 @@ With this setup, everything is in place for a natural usage of MathJax on pages
|
||||
|
||||
## Additional Formats Through External Helpers
|
||||
|
||||
Hugo has new concept called _external helpers_. It means that you can write your content using [Asciidoc][ascii], [reStructuredText][rest]. If you have files with associated extensions, Hugo will call external commands to generate the content. ([See the Hugo source code for external helpers][helperssource].)
|
||||
Hugo has a new concept called _external helpers_. It means that you can write your content using [Asciidoc][ascii], [reStructuredText][rest], or [pandoc]. If you have files with associated extensions, Hugo will call external commands to generate the content. ([See the Hugo source code for external helpers][helperssource].)
|
||||
|
||||
For example, for Asciidoc files, Hugo will try to call the `asciidoctor` or `asciidoc` command. This means that you will have to install the associated tool on your machine to be able to use these formats. ([See the Asciidoctor docs for installation instructions](http://asciidoctor.org/docs/install-toolchain/)).
|
||||
|
||||
To use these formats, just use the standard extension and the front matter exactly as you would do with natively supported `.md` files.
|
||||
|
||||
Hugo passes reasonable default arguments to these external helpers by default:
|
||||
|
||||
- `asciidoc`: `--no-header-footer --safe -`
|
||||
- `asciidoctor`: `--no-header-footer --safe --trace -`
|
||||
- `rst2html`: `--leave-comments --initial-header-level=2`
|
||||
- `pandoc`: `--mathjax`
|
||||
|
||||
{{% warning "Performance of External Helpers" %}}
|
||||
Because additional formats are external commands generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome.
|
||||
{{% /warning %}}
|
||||
@ -235,6 +242,7 @@ Markdown syntax is simple enough to learn in a single sitting. The following are
|
||||
[mmark]: https://github.com/miekg/mmark
|
||||
[mmarkgh]: https://github.com/miekg/mmark/wiki/Syntax
|
||||
[org]: http://orgmode.org/
|
||||
[pandoc]: http://www.pandoc.org/
|
||||
[Pygments]: http://pygments.org/
|
||||
[rest]: http://docutils.sourceforge.net/rst.html
|
||||
[sc]: /content-management/shortcodes/
|
||||
|
@ -13,7 +13,7 @@ menu:
|
||||
weight: 150
|
||||
weight: 150 #rem
|
||||
draft: false
|
||||
aliases: [/content/multilingual/,/content-management/multilingual/]
|
||||
aliases: [/content/multilingual/,/content-management/multilingual/,/tutorials/create-a-multilingual-site/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
@ -34,14 +34,12 @@ help = "Help"
|
||||
[Languages.en]
|
||||
title = "My blog"
|
||||
weight = 1
|
||||
[Languages.en.params]
|
||||
linkedin = "english-link"
|
||||
|
||||
[Languages.fr]
|
||||
copyright = "Tout est à moi"
|
||||
title = "Mon blog"
|
||||
weight = 2
|
||||
[Languages.fr.params]
|
||||
linkedin = "lien-francais"
|
||||
[Languages.fr.navigation]
|
||||
help = "Aide"
|
||||
|
@ -19,6 +19,14 @@ toc: true
|
||||
|
||||
{{< youtube 0GZxidrlaRM >}}
|
||||
|
||||
## Content Bundles and Image Processing
|
||||
|
||||
See [This Page](/about/new-in-032/). We will get the relevant parts of the rest of the Hugo docs updated. Eventually.
|
||||
|
||||
{{< todo >}}
|
||||
Remove the above when done.
|
||||
{{< /todo >}}
|
||||
|
||||
## Organization of Content Source
|
||||
|
||||
In Hugo, your content should be organized in a manner that reflects the rendered website.
|
||||
|
@ -240,7 +240,7 @@ If you need to add custom metadata to your taxonomy terms, you will need to crea
|
||||
---
|
||||
{{< /code >}}
|
||||
|
||||
You can later use your custom metadata as shown in the [Taxonomy Terms Templates documentation](/templates/taxonomy-templates/#displaying-custom-meta-data-in-taxonomy-terms-templates).
|
||||
You can later use your custom metadata as shown in the [Taxonomy Terms Templates documentation](/templates/taxonomy-templates/#displaying-custom-metadata-in-taxonomy-terms-templates).
|
||||
|
||||
[`urlize` template function]: /functions/urlize/
|
||||
[content section]: /content-management/sections/
|
||||
|
26
content/functions/cond.md
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
title: "cond"
|
||||
date: 2017-09-08
|
||||
description: "Return one of two arguments, depending on the value of a third argument."
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
signature: ["cond CONTROL VAR1 VAR2"]
|
||||
aliases: [/functions/cond/]
|
||||
hugoversion: 0.27
|
||||
relatedfuncs: [default]
|
||||
toc: false
|
||||
draft: false
|
||||
needsexamples: false
|
||||
---
|
||||
|
||||
`cond` returns *VAR1* if *CONTROL* is true, or *VAR2* if it is not.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
{{ cond (eq (len $geese) 1) "goose" "geese" }}
|
||||
```
|
||||
|
||||
Would emit "goose" if the `$geese` array has exactly 1 item, or "geese" otherwise.
|
@ -24,3 +24,28 @@ Useful for turning strings into numbers.
|
||||
```
|
||||
{{ int "123" }} → 123
|
||||
```
|
||||
|
||||
{{% note "Usage Note" %}}
|
||||
If the input string is supposed to represent a decimal number, and if it has
|
||||
leading 0's, then those 0's will have to be removed before passing the string
|
||||
to the `int` function, else that string will be tried to be parsed as an octal
|
||||
number representation.
|
||||
|
||||
The [`strings.TrimLeft` function](/functions/strings.trimleft/) can be used for
|
||||
this purpose.
|
||||
|
||||
```
|
||||
{{ int ("0987" | strings.TrimLeft "0") }}
|
||||
{{ int ("00987" | strings.TrimLeft "0") }}
|
||||
```
|
||||
|
||||
**Explanation**
|
||||
|
||||
The `int` function eventually calls the `ParseInt` function from the Go library
|
||||
`strconv`.
|
||||
|
||||
From its [documentation](https://golang.org/pkg/strconv/#ParseInt):
|
||||
|
||||
> the base is implied by the string's prefix: base 16 for "0x", base 8 for "0",
|
||||
> and base 10 otherwise.
|
||||
{{% /note %}}
|
||||
|
@ -66,7 +66,7 @@ choco install hugo -confirm
|
||||
#### Prerequisite Tools
|
||||
|
||||
* [Git][installgit]
|
||||
* [Go 1.5+][installgo]
|
||||
* [Go (latest or previous version)][installgo]
|
||||
* [govendor][]
|
||||
|
||||
#### Vendored Dependencies
|
||||
@ -424,10 +424,6 @@ In any of the [Linux distributions that support snaps][snaps]:
|
||||
snap install hugo
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
Hugo-as-a-snap can write only inside the user’s `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps’ confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143).
|
||||
{{% /note %}}
|
||||
|
||||
### Debian and Ubuntu
|
||||
|
||||
Debian and Ubuntu provide a `hugo` version via `apt-get`:
|
||||
@ -445,6 +441,10 @@ sudo apt-get install hugo
|
||||
|
||||
* Might not be the latest version, especially if you are using an older, stable version (e.g., Ubuntu 16.04 LTS). Until backports and PPA are available, you may consider installing the Hugo snap package to get the latest version of Hugo.
|
||||
|
||||
{{% note %}}
|
||||
Hugo-as-a-snap can write only inside the user’s `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps’ confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143). Use ```sudo apt-get install hugo --classic``` to disable the default security model if you want hugo to be able to have write access in other paths besides the user’s `$HOME` directory.
|
||||
{{% /note %}}
|
||||
|
||||
### Arch Linux
|
||||
|
||||
You can also install Hugo from the Arch Linux [community](https://www.archlinux.org/packages/community/x86_64/hugo/) repository. Applies also for derivatives such as Manjaro.
|
||||
|
95
content/news/0.32-relnotes-ready.md
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
---
|
||||
date: 2017-12-31
|
||||
title: "Hugo 0.32: Page Bundles and Image Processing!"
|
||||
description: "Images and other resources with page-relative links, resize, scale and crop images, and much more."
|
||||
slug: "0.32-relnotes"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-32-poster.png
|
||||
---
|
||||
|
||||
Hugo `0.32` features **Page Bundles and Image Processing** by [@bep](https://github.com/bep), which is very cool and useful on so many levels. Read about it in more detail in the [Hugo documentation](https://gohugo.io/about/new-in-032/), but some of the highlights include:
|
||||
|
||||
* Automatic bundling of a content page with its resources. Resources can be anything: Images, `JSON` files ... and also other content pages.
|
||||
* A `Resource` will have its `RelPermalink` and `Permalink` relative to the "owning page". This makes the complete article with both text and images portable (just send a ZIP file with a folder to your editor), and it can be previewed directly on GitHub.
|
||||
* Powerful and simple to use image processing with the new `.Resize`, `.Fill`, and `.Fit` methods on the new `Image` resource.
|
||||
* Full support for symbolic links inside `/content`, both for regular files and directories.
|
||||
|
||||
The built-in benchmarks in Hugo show that this is also the [fastest and most memory effective](https://gist.github.com/bep/2a9bbd221de2da5d39c8b32085c658f7) Hugo version to date. But note that the build time total reported in the console is now adjusted to be the *real total*, including the copy of static files. So, if it reports more milliseconds, it is still most likely faster ...
|
||||
|
||||
This release represents **30 contributions by 7 contributors** to the main Hugo code base.
|
||||
|
||||
[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@betaveros](https://github.com/betaveros), [@chaseadamsio](https://github.com/chaseadamsio), and [@kropp](https://github.com/kropp). And as always big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the documentation and the themes site in pristine condition.
|
||||
|
||||
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
|
||||
which has received **17 contributions by 7 contributors**. A special thanks to [@bep](https://github.com/bep), [@felicianotech](https://github.com/felicianotech), [@maiki](https://github.com/maiki), and [@carlchengli](https://github.com/carlchengli) for their work on the documentation site.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 22061+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 454+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 193+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
Today is **New Year's Eve.** It is the last day of 2017, a year that have seen a **string of pearls of Hugo releases**, making Hugo _the_ top choice for website development:
|
||||
|
||||
* 0.32, December 2017: **Page Bundles and Image Processing** edition.
|
||||
* 0.31, November 2017: The Language **Multihost Edition!** with one `baseURL` per language.
|
||||
* 0.30, October 2017: The Race Car Edition with the **Fast Render Mode**.
|
||||
* 0.29, September 2017: Added **Template Metrics**.
|
||||
* 0.28, September 2017: **Blistering fast and native syntax highlighting** from [Chroma](https://github.com/alecthomas/chroma).
|
||||
* 0.27, September 2017: Fast and flexible **Related Content.**
|
||||
* 0.26, August 2017: The **Language Style Edition** with AP Style or Chicago Style Title Case and « French Guillemets ».
|
||||
* 0.25, July 2017: The **Kinder Surprise** edition added, among other cool things, `hugo server --navigateToChanged` which navigates to the content page you start editing.
|
||||
* 0.24, June 2017: Was **The Revival of the Archetypes!** Now archetype files, i.e. the content file templates, can include template syntax with all of Hugo's functions and variables.
|
||||
* 0.23, June 2017: Hugo moved to it's own GitHub organization, **gohugoio**.
|
||||
* 0.22, June 2017: Added **nested sections**, a long sought after feature.
|
||||
* 0.21, May 2017: Full support for shortcodes per output format (think **AMP**).
|
||||
* 0.20, April 2017: Was all about **Custom Output Formats**.
|
||||
* 0.19, February 2017: Native Emacs Org-mode content support and lots of internal upgrades.
|
||||
|
||||
## Notes
|
||||
|
||||
* The build total in the console is now the ... total (i.e. it now includes both the copy of the static files and the Hugo build). So if your Hugo site seems to build slightly slower, it is in reality probably slightly faster than before this release.
|
||||
* Images and other static resources in folders with "_index.md" will have its `RelPermalink` relative to its page.
|
||||
* Images and other static resources in or below "index.md" folders will have its `RelPermalink` relative to its page (respecting permalink settings etc.)
|
||||
* Content pages in or below "index.md" will not get their own `URL`, but will be part of the `.Resources` collection of its page.
|
||||
* `.Site.Files` is deprecated.
|
||||
* Hugo no longer minfies CSS files inside `/content`. This was an undocumented "proof of concept feature". We may revisit the "assets handling" in a future release.
|
||||
* `Page.GetParam`does not lowercase your result anymore. If you really want to lowercase your params, do it with `.GetParam "myparam" | lower` or similar.
|
||||
|
||||
Previously deprecated that will now `ERROR`:
|
||||
|
||||
* `disable404`: Use `disableKinds=["404"]`
|
||||
* `disableRSS`: Use `disableKinds=["RSS"]`
|
||||
* `disableSitemap`: Use `disableKinds=["sitemap"]`
|
||||
* `disableRobotsTXT`: Use `disableKinds=["robotsTXT"]`
|
||||
|
||||
## Enhancements
|
||||
|
||||
* Add `.Title` and `.Page` to `MenuEntry` [9df3736f](https://github.com/gohugoio/hugo/commit/9df3736fec164c51d819797416dc263f2869be77) [@rmetzler](https://github.com/rmetzler) [#2784](https://github.com/gohugoio/hugo/issues/2784)
|
||||
* Add `Pandoc` support [e69da7a4](https://github.com/gohugoio/hugo/commit/e69da7a4cb725987f153707bf2fc59c135007e2a) [@betaveros](https://github.com/betaveros) [#234](https://github.com/gohugoio/hugo/issues/234)
|
||||
* Implement Page bundling and image handling [3cdf19e9](https://github.com/gohugoio/hugo/commit/3cdf19e9b7e46c57a9bb43ff02199177feb55768) [@bep](https://github.com/bep) [#3651](https://github.com/gohugoio/hugo/issues/3651)[#3158](https://github.com/gohugoio/hugo/issues/3158)[#1014](https://github.com/gohugoio/hugo/issues/1014)[#2021](https://github.com/gohugoio/hugo/issues/2021)[#1240](https://github.com/gohugoio/hugo/issues/1240)[#3757](https://github.com/gohugoio/hugo/issues/3757)
|
||||
* Make `chomp` return the type it receives [22cd89ad](https://github.com/gohugoio/hugo/commit/22cd89adc4792a3b55389d38acd4acfae3786775) [@kropp](https://github.com/kropp) [#2187](https://github.com/gohugoio/hugo/issues/2187)
|
||||
* Reuse the `BlackFriday` config instance when possible [db4b7a5c](https://github.com/gohugoio/hugo/commit/db4b7a5c6742c75f9cd9627d3b054d3a72802ec8) [@bep](https://github.com/bep)
|
||||
* Remove the goroutines from the shortcode lexer [24369410](https://github.com/gohugoio/hugo/commit/243694102a60da2fb1050020f68384539f9f9ef5) [@bep](https://github.com/bep)
|
||||
* Improve site benchmarks [051fa343](https://github.com/gohugoio/hugo/commit/051fa343d06d6c070df742f7cbd125432fcab665) [@bep](https://github.com/bep)
|
||||
* Update `Chroma` to `v0.2.0` [79892101](https://github.com/gohugoio/hugo/commit/7989210120dbde78da3741e2ef01b13f4aa78692) [@bep](https://github.com/bep) [#4087](https://github.com/gohugoio/hugo/issues/4087)
|
||||
* Update `goorgeous` to `v1.1.0` [7f2ae3ef](https://github.com/gohugoio/hugo/commit/7f2ae3ef39f27a9bd26ddb9258b073a840faf491) [@chaseadamsio](https://github.com/chaseadamsio)
|
||||
* Add test for homepage content for all rendering engines [407c2402](https://github.com/gohugoio/hugo/commit/407c24020ef2db90cf33fd07e7522b2257013722) [@bep](https://github.com/bep) [#4166](https://github.com/gohugoio/hugo/issues/4166)
|
||||
* Add output formats definition to benchmarks [a2d81ce9](https://github.com/gohugoio/hugo/commit/a2d81ce983d45b5742c93bd472503c88286f099a) [@bep](https://github.com/bep)
|
||||
|
||||
## Fixes
|
||||
|
||||
### Templates
|
||||
|
||||
* Do not unescape input to `highlight` [c067f345](https://github.com/gohugoio/hugo/commit/c067f34558b82455b63b9ce8f5983b4b4849c7cf) [@bep](https://github.com/bep) [#4179](https://github.com/gohugoio/hugo/issues/4179)
|
||||
* Properly close image file in `imageConfig` [6d79beb5](https://github.com/gohugoio/hugo/commit/6d79beb5f67dbb54d7714c3195addf9d8e3924e8) [@bep](https://github.com/bep)
|
||||
* Fix `opengraph` video range template [23f69efb](https://github.com/gohugoio/hugo/commit/23f69efb3914946b39ce673fcc0f2e3a9ed9d878) [@drlogout](https://github.com/drlogout) [#4136](https://github.com/gohugoio/hugo/issues/4136)
|
||||
* Fix `humanize` for multi-byte runes [e7652180](https://github.com/gohugoio/hugo/commit/e7652180a13ce149041c48a1c2754c471df569c8) [@bep](https://github.com/bep) [#4133](https://github.com/gohugoio/hugo/issues/4133)
|
||||
|
||||
### Other
|
||||
|
||||
* Fix broken live reload without a server port. [25114986](https://github.com/gohugoio/hugo/commit/25114986086e5877a0b4108d8cf5e4e95f377241) [@sainaen](https://github.com/sainaen) [#4141](https://github.com/gohugoio/hugo/issues/4141)
|
||||
* Make sure all language homes are always re-rendered in fast render mode [72903be5](https://github.com/gohugoio/hugo/commit/72903be587e9c4e3644f60b11e26238ec03da2db) [@bep](https://github.com/bep) [#4125](https://github.com/gohugoio/hugo/issues/4125)
|
||||
* Do not `tolower` result from Page.GetParam [1c114d53](https://github.com/gohugoio/hugo/commit/1c114d539b0755724443fe28c90b12fe2a19085a) [@bep](https://github.com/bep) [#4187](https://github.com/gohugoio/hugo/issues/4187)
|
19
content/news/0.32.1-relnotes-ready.md
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
---
|
||||
date: 2018-01-02
|
||||
title: "0.32.1: Two bugfixes"
|
||||
description: "Fixes image processing in shortcodes."
|
||||
slug: "0.32.1-relnotes"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
---
|
||||
|
||||
This fixes 2 bugs from the Hugo 0.32 release.
|
||||
|
||||
* Fix image processing from shortcodes in non-server mode. [@bep](https://github.com/bep) [#4202](https://github.com/gohugoio/hugo/issues/4202)
|
||||
* Fix broken `hugo --renderToMemory`. Note that this is only useful for benchmark testing, as there is no easy way to actually view the result. [d36d71ed](https://github.com/gohugoio/hugo/commit/d36d71edd3b04df3b34edf4d108e3995a244c4f0) [@bep](https://github.com/bep) [#4212](https://github.com/gohugoio/hugo/issues/4212)
|
||||
|
||||
|
||||
|
||||
|
24
content/news/0.32.2-relnotes-ready.md
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
---
|
||||
date: 2018-01-03
|
||||
title: "0.32.2: One bugfix"
|
||||
description: "Fixes one issue with publishing of processed images when no cache."
|
||||
slug: "0.32.2-relnotes"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
This is a bug-fix release with one important fix.
|
||||
|
||||
|
||||
* Handle publish of processed images to /public on fresh build with no image cache in /resources (as reported by one person in a Netlify build) [196da49c](https://github.com/gohugoio/hugo/commit/196da49c9d906fbae6d389fdd32b80c27cb38de4) [@bep](https://github.com/bep) [#4213](https://github.com/gohugoio/hugo/issues/4213)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
31
content/news/0.32.3-relnotes-ready.md
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
---
|
||||
date: 2018-01-08
|
||||
title: "Hugo 0.32.3: Some important bug fixes"
|
||||
description: "Fixes multilingual resource (images etc.) handling etc."
|
||||
slug: "0.32.3-relnotes"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
Hugo `0.32` was a big and [really cool](https://gohugo.io/news/0.32-relnotes/) release, and the [Hugo Forum](https://discourse.gohugo.io/) has been filled with questions from people wanting to upgrade their Hugo sites to be able to use the new image processing feature etc.
|
||||
|
||||
And with that we have discovered some issues, which this release should fix, mostly releated to multilingual sites:
|
||||
|
||||
* Fix multihost detection for sites without language definition [8969331f](https://github.com/gohugoio/hugo/commit/8969331f5be352939883074034adac6b7086ddc8) [@bep](https://github.com/bep) [#4221](https://github.com/gohugoio/hugo/issues/4221)
|
||||
* Fix hugo benchmark --renderToMemory [059e8458](https://github.com/gohugoio/hugo/commit/059e8458d690dbb9fcd3ebd58cfc61b062d3138e) [@bep](https://github.com/bep) [#4218](https://github.com/gohugoio/hugo/issues/4218)
|
||||
* Fix URLs for bundle resources in multihost mode [ab82a27d](https://github.com/gohugoio/hugo/commit/ab82a27d055c3aa177821d81a45a5c6e972aa29e) [@bep](https://github.com/bep) [#4217](https://github.com/gohugoio/hugo/issues/4217)
|
||||
* Fix sub-folder baseURL handling for Page resources [f25d8a9e](https://github.com/gohugoio/hugo/commit/f25d8a9e17fb65fa41dafdcbf0358853d68eaf45) [@bep](https://github.com/bep) [#4228](https://github.com/gohugoio/hugo/issues/4228)
|
||||
* Avoid processing and storing same image for each language [4b04db0f](https://github.com/gohugoio/hugo/commit/4b04db0f0855a1f54895d6c93c52dcea4b1ce3ca) [@bep](https://github.com/bep) [#4231](https://github.com/gohugoio/hugo/issues/4231)
|
||||
* Resources.ByType should return Resources [97c1866e](https://github.com/gohugoio/hugo/commit/97c1866e322284dec46db6f3d235807507f5b69f) [@bep](https://github.com/bep) [#4234](https://github.com/gohugoio/hugo/issues/4234)
|
||||
* Report build time on config.toml change [6feb1387](https://github.com/gohugoio/hugo/commit/6feb138785eeb9e813428d0df30010d9b5fb1059) [@bep](https://github.com/bep) [#4232](https://github.com/gohugoio/hugo/issues/4232)[#4224](https://github.com/gohugoio/hugo/issues/4224)
|
||||
* Fix handling of mixed-case taxonomy folders with content file [2d3189b2](https://github.com/gohugoio/hugo/commit/2d3189b22760e0a8995dae082a6bc5480f770bfe) [@bep](https://github.com/bep) [#4238](https://github.com/gohugoio/hugo/issues/4238)
|
||||
|
||||
|
||||
|
||||
|
||||
|
21
content/news/0.32.4-relnotes-ready.md
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
---
|
||||
date: 2018-01-11
|
||||
title: "0.32.4: Two bugfixes"
|
||||
description: "Fixes non-ASCII path handling for Page resources."
|
||||
slug: "0.32.4-relnotes"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
---
|
||||
|
||||
This is a bug-fix release with two of important fixes.
|
||||
|
||||
* Fix non-ASCII path handling for Page resources [f0eecc6a](https://github.com/gohugoio/hugo/commit/f0eecc6a4f541838e9930c98bc982546f65c7a4f) [@bep](https://github.com/bep) [#4241](https://github.com/gohugoio/hugo/issues/4241)
|
||||
* Fix `--cleanDestinationDir` [5235a5bf](https://github.com/gohugoio/hugo/commit/5235a5bf5ef44b3789341e1d25b681a7bb14771a) [@biodranik](https://github.com/biodranik) [#4246](https://github.com/gohugoio/hugo/issues/4246)[#4248](https://github.com/gohugoio/hugo/issues/4248)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
80
content/news/0.33-relnotes-ready.md
Normal file
@ -0,0 +1,80 @@
|
||||
|
||||
---
|
||||
date: 2018-01-18
|
||||
title: "Hugo 0.33: The New Kinder Surprise!"
|
||||
description: "Hugo 0.33 comes with resource (images etc.) metadata, `type` and `layout` for all page types, `url` in front matter for list pages …"
|
||||
slug: "0.33-relnotes"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-33-poster.png
|
||||
|
||||
---
|
||||
|
||||
Hugo `0.33` is the first main Hugo release of the new year, and it is safe to say that [@bep](https://github.com/bep) has turned off his lazy Christmas mode :smiley:
|
||||
|
||||
This is a full makeover of the layout selection logic with full custom `layout` and `type` support (many have asked for this). Also, Hugo now respects the `url` value in front matter for all page types, including sections. Also, you can now configure `uglyURLs` per section.
|
||||
|
||||
But this release is also a follow-up to the `0.32` release which was all about bundles with resources and powerful image processing. With this release it is now simple to add metadata to your images and other bundle resources.
|
||||
|
||||
[@bep](https://github.com/bep) has added a section with examples of both `resources` configuration in both `YAML` and `TOML` front matter in his [test site](http://hugotest.bep.is/resourcemeta/). The example below shows a sample of how it would look like in `YAML`:
|
||||
|
||||
```yaml
|
||||
date: 2017-01-17
|
||||
title: My Bundle With YAML Resource Metadata
|
||||
resources:
|
||||
- src: "image-4.png"
|
||||
title: "The Fourth Image"
|
||||
- src: "*.png"
|
||||
name: "my-cool-image-:counter"
|
||||
title: "The Image #:counter"
|
||||
params:
|
||||
byline: "bep"
|
||||
```
|
||||
|
||||
This release represents **41 contributions by 3 contributors** to the main Hugo code base.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 22553+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 448+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 197+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Notes
|
||||
* We have re-implemented and unified the template layout lookup logic. This has made it more powerful and much simpler to understand. We don't expect any sites to break because of this. We have tested lots of Hugo sites, including the 200 [themes](http://themes.gohugo.io/).
|
||||
* The `indexes` type is removed from template lookup. It's not in the documentation, and is a legacy term inherited from very old Hugo versions.
|
||||
* If you have sub-dirs in your shiny new bundles (e.g. `my-bundle/images`) and use the `*Prefix*` methods to find them, we have made an unintended change that affects you. See [this issue](https://github.com/gohugoio/hugo/issues/4295).
|
||||
|
||||
## Enhancements
|
||||
|
||||
### Templates
|
||||
|
||||
* Respect `Type` and `Layout` for list template selection [51dd462c](https://github.com/gohugoio/hugo/commit/51dd462c3958f7cf032b06503f1f200a6aceebb9) [@bep](https://github.com/bep) [#3005](https://github.com/gohugoio/hugo/issues/3005)[#3245](https://github.com/gohugoio/hugo/issues/3245)
|
||||
|
||||
### Core
|
||||
|
||||
* Allow `url` in front matter for list type pages [8a409894](https://github.com/gohugoio/hugo/commit/8a409894bdb0972e152a2eccc47a2738568e1cfc) [@bep](https://github.com/bep) [#4263](https://github.com/gohugoio/hugo/issues/4263)
|
||||
* Improve `.Site.GetPage` for regular translated pages. Before this change it was not possible to say "get me the current language edition of the given content page if possible." Now you can do that by doing a lookup without any extensions: `.Site.GetPage "page" "post/mypost"` [9409bc0f](https://github.com/gohugoio/hugo/commit/9409bc0f799a8057836a14ccdf2833a55902175e) [@bep](https://github.com/bep) [#4285](https://github.com/gohugoio/hugo/issues/4285)
|
||||
* Add front matter metadata to `Resource` [20c9b6ec](https://github.com/gohugoio/hugo/commit/20c9b6ec81171d1c586ea31d5d08b40b0edaffc6) [@bep](https://github.com/bep) [#4244](https://github.com/gohugoio/hugo/issues/4244)
|
||||
* Implement `Resources.ByPrefix` [46db900d](https://github.com/gohugoio/hugo/commit/46db900dab9c0e6fcd9d227f10a32fb24f5c8bd9) [@bep](https://github.com/bep) [#4266](https://github.com/gohugoio/hugo/issues/4266)
|
||||
* Make `GetByPrefix` work for Page resources [60c9f3b1](https://github.com/gohugoio/hugo/commit/60c9f3b1c34b69771e25a66906f150f460d73223) [@bep](https://github.com/bep) [#4264](https://github.com/gohugoio/hugo/issues/4264)
|
||||
* Make `Resources.GetByPrefix` case insensitive [db85e834](https://github.com/gohugoio/hugo/commit/db85e83403913cff4b8737b138932b28e5bf6160) [@bep](https://github.com/bep) [#4258](https://github.com/gohugoio/hugo/issues/4258)
|
||||
* Update `Chroma` and other third-party deps [64f0e9d1](https://github.com/gohugoio/hugo/commit/64f0e9d1c1d4ff2249fd9cf9749e70485002b36d) [@bep](https://github.com/bep) [#4267](https://github.com/gohugoio/hugo/issues/4267)
|
||||
* Remove superflous `BuildDate` logic [13d53b31](https://github.com/gohugoio/hugo/commit/13d53b31f19240879122d6b7e4aaeb60b5130a3c) [@bep](https://github.com/bep) [#4272](https://github.com/gohugoio/hugo/issues/4272)
|
||||
* Run benchmarks 3 times [b6ea6d07](https://github.com/gohugoio/hugo/commit/b6ea6d07d0b072d850fb066c78976acd6c2f5e81) [@bep](https://github.com/bep)
|
||||
* Support `uglyURLs` per section [57e10f17](https://github.com/gohugoio/hugo/commit/57e10f174e51cc5e1cf5f37eed30a0f3b153dd64) [@bep](https://github.com/bep) [#4256](https://github.com/gohugoio/hugo/issues/4256)
|
||||
* Update CONTRIBUTING.md [1046e936](https://github.com/gohugoio/hugo/commit/1046e9363f2e382fd0b4aac838735ae4cbbebe5a) [@vassudanagunta](https://github.com/vassudanagunta)
|
||||
* Support offline builds [d5803da1](https://github.com/gohugoio/hugo/commit/d5803da1befba5446d1b2c1ad16f6467dc7b3991) [@vassudanagunta](https://github.com/vassudanagunta)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix handling of mixed-case taxonomy folders with content file [2d3189b2](https://github.com/gohugoio/hugo/commit/2d3189b22760e0a8995dae082a6bc5480f770bfe) [@bep](https://github.com/bep) [#4238](https://github.com/gohugoio/hugo/issues/4238)
|
||||
* Fix handling of very long image file names [ecaf1451](https://github.com/gohugoio/hugo/commit/ecaf14514e06321823bdd10235cf23e7d654ba77) [@bep](https://github.com/bep) [#4261](https://github.com/gohugoio/hugo/issues/4261)
|
||||
* Update `Afero` to avoid panic on "file name is too long" [f8a119b6](https://github.com/gohugoio/hugo/commit/f8a119b606d55aa4f31f16e5a3cadc929c99e4f8) [@bep](https://github.com/bep) [#4240](https://github.com/gohugoio/hugo/issues/4240)
|
||||
* And now really fix the server watch logic [d4f8f88e](https://github.com/gohugoio/hugo/commit/d4f8f88e67f958b8010f90cb9b9854114e52dac2) [@bep](https://github.com/bep) [#4275](https://github.com/gohugoio/hugo/issues/4275)
|
||||
* Fix server without watch [4e524ffc](https://github.com/gohugoio/hugo/commit/4e524ffcfff48c017717e261c6067416aa56410f) [@bep](https://github.com/bep) [#4275](https://github.com/gohugoio/hugo/issues/4275)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
`extensions`
|
||||
: default: **`[]`** <br>
|
||||
Purpose: Enable one or more Blackfriday's Markdown extensions (**`EXTENSION_*`**). <br>
|
||||
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINK_BREAK`. <br>
|
||||
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINE_BREAK`. <br>
|
||||
*See [Blackfriday extensions](#blackfriday-extensions) section for information on all extensions.*
|
||||
|
||||
`extensionsmask`
|
||||
|
@ -28,12 +28,7 @@ The homepage template is the *only* required template for building a site and th
|
||||
|
||||
## Homepage Template Lookup Order
|
||||
|
||||
The [lookup order][lookup] for the homepage template is as follows:
|
||||
|
||||
1. `/layouts/index.html`
|
||||
2. `/layouts/_default/list.html`
|
||||
3. `/themes/<THEME>/layouts/index.html`
|
||||
4. `/themes/<THEME>/layouts/_default/list.html`
|
||||
See [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
## Add Content and Front Matter to the Homepage
|
||||
|
||||
|
@ -31,6 +31,8 @@ Hugo uses the term *list* in its truest sense; i.e. a sequential arrangement of
|
||||
* [Section list pages][sectiontemps]
|
||||
* [RSS][rss]
|
||||
|
||||
For template lookup order, see [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
The idea of a list page comes from the [hierarchical mental model of the web][mentalmodel] and is best demonstrated visually:
|
||||
|
||||

|
||||
|
@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Hugo's Lookup Order
|
||||
linktitle: Template Lookup Order
|
||||
description: The lookup order is a prioritized list used by Hugo as it traverses your files looking for the appropriate corresponding file to render your content.
|
||||
description: Hugo searches for the layout to use for a given page in a well defined order, starting from the most specific.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-05-25
|
||||
categories: [templates,fundamentals]
|
||||
keywords: [lookup]
|
||||
keywords: [templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
@ -20,172 +20,73 @@ aliases: [/templates/lookup/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
Before creating your templates, it's important to know how Hugo looks for files within your project's [directory structure][].
|
||||
## Hugo Layouts Lookup Rules
|
||||
|
||||
Hugo uses a prioritized list called the **lookup order** as it traverses your `layouts` folder in your Hugo project *looking* for the appropriate template to render your content.
|
||||
Hugo takes the parameters listed below into consideration when choosing a layout for a given page. They are listed in a priority order. This should feel natural, but look at the table below for concrete examples of the different parameter variations.
|
||||
|
||||
The template lookup order is an inverted cascade: if template A isn’t present or specified, Hugo will look to template B. If template B isn't present or specified, Hugo will look for template C...and so on until it reaches the `_default/` directory for your project or theme. In many ways, the lookup order is similar to the programming concept of a [switch statement without fallthrough][switch].
|
||||
|
||||
The power of the lookup order is that it enables you to craft specific layouts and keep your templating [DRY][].
|
||||
Kind
|
||||
: The page `Kind` (the home page is one). See the example tables below per kind. This also determines if it is a **single page** (i.e. a regular content page. We then look for a template in `_default/single.html` for HTML) or a **list page** (section listings, home page, taxonomy lists, taxonomy terms. We then look for a template in `_default/list.html` for HTML).
|
||||
|
||||
Output Format
|
||||
: See [Custom Output Formats](/templates/output-formats). An output format has both a `name` (e.g. `rss`, `amp`, `html`) and a `suffix` (e.g. `xml`, `html`). We prefer matches with both (e.g. `index.amp.html`, but look for less specific templates.
|
||||
|
||||
Language
|
||||
: We will consider a language code in the template name. If the site language is `fr`, `index.fr.amp.html` will win over `index.amp.html`, but we will `index.amp.html` will be chosen before `index.fr.html`.
|
||||
|
||||
Layout
|
||||
: Can be set in page front matter.
|
||||
|
||||
Type
|
||||
: Is value of `type` if set in front matter, else it is the name of the root section (e.g. "blog"). If will always have a value, so if not set, the value is "page".
|
||||
|
||||
Section
|
||||
: Is relevant for `section`, `taxonomy` and `taxonomyTerm` types.
|
||||
|
||||
{{% note %}}
|
||||
Most Hugo websites will only need the default template files at the end of the lookup order (i.e. `_default/*.html`).
|
||||
{{% /note %}}
|
||||
|
||||
## Lookup Orders
|
||||
|
||||
The respective lookup order for each of Hugo's templates has been defined throughout the Hugo docs:
|
||||
|
||||
* [Homepage Template][home]
|
||||
* [Base Templates][base]
|
||||
* [Section Page Templates][sectionlookup]
|
||||
* [Taxonomy List Templates][taxonomylookup]
|
||||
* [Taxonomy Terms Templates][termslookup]
|
||||
* [Single Page Templates][singlelookup]
|
||||
* [RSS Templates][rsslookup]
|
||||
* [Shortcode Templates][sclookup]
|
||||
|
||||
## Template Lookup Examples
|
||||
|
||||
The lookup order is best illustrated through examples. The following shows you the process Hugo uses for finding the appropriate template to render your [single page templates][], but the concept holds true for all templates in Hugo.
|
||||
|
||||
1. The project is using the theme `mytheme` (specified in the project's [configuration][config]).
|
||||
2. The layouts and content directories for the project are as follows:
|
||||
**Tip:** The examples below looks long and complex. That is the flexibility talking. Most Hugo sites contain just a handful of templates:
|
||||
|
||||
```bash
|
||||
├── _default
|
||||
│ ├── baseof.html
|
||||
│ ├── list.html
|
||||
│ └── single.html
|
||||
└── index.html
|
||||
```
|
||||
.
|
||||
├── content
|
||||
│ ├── events
|
||||
│ │ ├── _index.md
|
||||
│ │ └── my-first-event.md
|
||||
│ └── posts
|
||||
│ ├── my-first-post.md
|
||||
│ └── my-second-post.md
|
||||
├── layouts
|
||||
│ ├── _default
|
||||
│ │ └── single.html
|
||||
│ ├── posts
|
||||
│ │ └── single.html
|
||||
│ └── reviews
|
||||
│ └── reviewarticle.html
|
||||
└── themes
|
||||
└── mytheme
|
||||
└── layouts
|
||||
├── _default
|
||||
│ ├── list.html
|
||||
│ └── single.html
|
||||
└── posts
|
||||
├── list.html
|
||||
└── single.html
|
||||
```
|
||||
|
||||
|
||||
Now we can look at the front matter for the three content (i.e.`.md`) files.
|
||||
|
||||
{{% note %}}
|
||||
Only three of the four markdown files in the above project are subject to the *single* page lookup order. `_index.md` is a specific `kind` in Hugo. Whereas `my-first-post.md`, `my-second-post.md`, and `my-first-event.md` are all of kind `page`, all `_index.md` files in a Hugo project are used to add content and front matter to [list pages](/templates/lists/). In this example, `events/_index.md` will render according to its [section template](/templates/section-templates/) and respective lookup order.
|
||||
{{% /note %}}
|
||||
|
||||
### Example: `my-first-post.md`
|
||||
|
||||
{{< code file="content/posts/my-first-post.md" copy="false" >}}
|
||||
---
|
||||
title: My First Post
|
||||
date: 2017-02-19
|
||||
description: This is my first post.
|
||||
---
|
||||
{{< /code >}}
|
||||
## Hugo Layouts Lookup Rules With Theme
|
||||
|
||||
In Hugo, layouts can live in either the project's or theme's layout folder, and the most specific layout will be chosen. Hugo will interleave the lookups:
|
||||
|
||||
|
||||
1. layouts/page/index.html
|
||||
2. demoTheme/layouts/page/index.html
|
||||
3. layouts/...
|
||||
|
||||
This way it is possible to override specific templates from the theme.
|
||||
|
||||
## Examples: Layout Lookup for Regular Pages
|
||||
|
||||
{{< datatable-filtered "output" "layouts" "Kind == page" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
|
||||
|
||||
## Examples: Layout Lookup for Home Page
|
||||
|
||||
{{< datatable-filtered "output" "layouts" "Kind == home" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
|
||||
|
||||
## Examples: Layout Lookup for Section Pages
|
||||
|
||||
{{< datatable-filtered "output" "layouts" "Kind == section" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
|
||||
|
||||
## Examples: Layout Lookup for Taxonomy List Pages
|
||||
|
||||
{{< datatable-filtered "output" "layouts" "Kind == taxonomy" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
|
||||
|
||||
## Examples: Layout Lookup for Taxonomy Terms Pages
|
||||
|
||||
{{< datatable-filtered "output" "layouts" "Kind == taxonomyTerm" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
|
||||
|
||||
When building your site, Hugo will go through the lookup order until it finds what it needs for `my-first-post.md`:
|
||||
|
||||
1. ~~`/layouts/UNSPECIFIED/UNSPECIFIED.html`~~
|
||||
2. ~~`/layouts/posts/UNSPECIFIED.html`~~
|
||||
3. ~~`/layouts/UNSPECIFIED/single.html`~~
|
||||
4. <span class="yes">`/layouts/posts/single.html`</span>
|
||||
<br><span class="break">BREAK</span>
|
||||
5. <span class="na">`/layouts/_default/single.html`</span>
|
||||
6. <span class="na">`/themes/<THEME>/layouts/UNSPECIFIED/UNSPECIFIED.html`</span>
|
||||
7. <span class="na">`/themes/<THEME>/layouts/posts/UNSPECIFIED.html`</span>
|
||||
8. <span class="na">`/themes/<THEME>/layouts/UNSPECIFIED/single.html`</span>
|
||||
9. <span class="na">`/themes/<THEME>/layouts/posts/single.html`</span>
|
||||
10. <span class="na">`/themes/<THEME>/layouts/_default/single.html`</span>
|
||||
|
||||
Notice the term `UNSPECIFIED` rather than `UNDEFINED`. If you don't tell Hugo the specific type and layout, it makes assumptions based on sane defaults. `my-first-post.md` does not specify a content `type` in its front matter. Therefore, Hugo assumes the content `type` and `section` (i.e. `posts`, which is defined by file location) are one in the same. ([Read more on sections][sections].)
|
||||
|
||||
`my-first-post.md` also does not specify a `layout` in its front matter. Therefore, Hugo assumes that `my-first-post.md`, which is of type `page` and a *single* piece of content, should default to the next occurrence of a `single.html` template in the lookup (#4).
|
||||
|
||||
### Example: `my-second-post.md`
|
||||
|
||||
{{< code file="content/posts/my-second-post.md" copy="false" >}}
|
||||
---
|
||||
title: My Second Post
|
||||
date: 2017-02-21
|
||||
description: This is my second post.
|
||||
type: review
|
||||
layout: reviewarticle
|
||||
---
|
||||
{{< /code >}}
|
||||
|
||||
Here is the way Hugo traverses the single-page lookup order for `my-second-post.md`:
|
||||
|
||||
1. <span class="yes">`/layouts/review/reviewarticle.html`</span>
|
||||
<br><span class="break">BREAK</span>
|
||||
2. <span class="na">`/layouts/posts/reviewarticle.html`</span>
|
||||
3. <span class="na">`/layouts/review/single.html`</span>
|
||||
4. <span class="na">`/layouts/posts/single.html`</span>
|
||||
5. <span class="na">`/layouts/_default/single.html`</span>
|
||||
6. <span class="na">`/themes/<THEME>/layouts/review/reviewarticle.html`</span>
|
||||
7. <span class="na">`/themes/<THEME>/layouts/posts/reviewarticle.html`</span>
|
||||
8. <span class="na">`/themes/<THEME>/layouts/review/single.html`</span>
|
||||
9. <span class="na">`/themes/<THEME>/layouts/posts/single.html`</span>
|
||||
10. <span class="na">`/themes/<THEME>/layouts/_default/single.html`</span>
|
||||
|
||||
The front matter in `my-second-post.md` specifies the content `type` (i.e. `review`) as well as the `layout` (i.e. `reviewarticle`). Hugo finds the layout it needs at the top level of the lookup (#1) and does not continue to search through the other templates.
|
||||
|
||||
{{% note "Type and not Types" %}}
|
||||
Notice that the directory for the template for `my-second-post.md` is `review` and not `reviews`. This is because *type is always singular when defined in front matter*.
|
||||
{{% /note%}}
|
||||
|
||||
### Example: `my-first-event.md`
|
||||
|
||||
{{< code file="content/events/my-first-event.md" copy="false" >}}
|
||||
---
|
||||
title: My First
|
||||
date: 2017-02-21
|
||||
description: This is an upcoming event..
|
||||
---
|
||||
{{< /code >}}
|
||||
|
||||
Here is the way Hugo traverses the single-page lookup order for `my-first-event.md`:
|
||||
|
||||
1. ~~`/layouts/UNSPECIFIED/UNSPECIFIED.html`~~
|
||||
2. ~~`/layouts/events/UNSPECIFIED.html`~~
|
||||
3. ~~`/layouts/UNSPECIFIED/single.html`~~
|
||||
4. ~~`/layouts/events/single.html`~~
|
||||
5. <span class="yes">`/layouts/_default/single.html`</span>
|
||||
<br><span class="break">BREAK</span>
|
||||
6. <span class="na">`/themes/<THEME>/layouts/UNSPECIFIED/UNSPECIFIED.html`</span>
|
||||
7. <span class="na">`/themes/<THEME>/layouts/events/UNSPECIFIED.html`</span>
|
||||
8. <span class="na">`/themes/<THEME>/layouts/UNSPECIFIED/single.html`</span>
|
||||
9. <span class="na">`/themes/<THEME>/layouts/events/single.html`</span>
|
||||
10. <span class="na">`/themes/<THEME>/layouts/_default/single.html`</span>
|
||||
|
||||
|
||||
{{% note %}}
|
||||
`my-first-event.md` is significant because it demonstrates the role of the lookup order in Hugo themes. Both the root project directory *and* the `mytheme` themes directory have a file at `_default/single.html`. Understanding this order allows you to [customize Hugo themes](/themes/customizing/) by creating template files with identical names in your project directory that step in front of theme template files in the lookup. This allows you to customize the look and feel of your website while maintaining compatibility with the theme's upstream.
|
||||
{{% /note %}}
|
||||
|
||||
[base]: /templates/base/#base-template-lookup-order
|
||||
[config]: /getting-started/configuration/
|
||||
[directory structure]: /getting-started/directory-structure/
|
||||
[DRY]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
|
||||
[home]: /templates/homepage/#homepage-template-lookup-order
|
||||
[rsslookup]: /templates/rss/#rss-template-lookup-order
|
||||
[sclookup]: /templates/shortcode-templates/#shortcode-template-lookup-order
|
||||
[sections]: /content-management/sections/
|
||||
[sectionlookup]: /templates/section-templates/#section-template-lookup-order
|
||||
[single page templates]: /templates/single-page-templates/
|
||||
[singlelookup]: /templates/single-page-templates/#single-page-template-lookup-order
|
||||
[switch]: https://en.wikipedia.org/wiki/Switch_statement#Fallthrough
|
||||
[taxonomylookup]: /templates/taxonomy-templates/#taxonomy-list-template-lookup-order
|
||||
[termslookup]: /templates/taxonomy-templates/#taxonomy-terms-template-lookup-order
|
||||
|
@ -28,40 +28,35 @@ The following is an example:
|
||||
{{< code file="layouts/partials/sidebar.html" download="sidebar.html" >}}
|
||||
<!-- sidebar start -->
|
||||
<aside>
|
||||
<div id="sidebar" class="nav-collapse">
|
||||
<!-- sidebar menu start-->
|
||||
<ul class="sidebar-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if .HasChildren }}
|
||||
|
||||
<li class="sub-menu{{if $currentPage.HasMenuCurrent "main" . }} active{{end}}">
|
||||
<a href="javascript:;" class="">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
<span class="menu-arrow arrow_carrot-right"></span>
|
||||
</a>
|
||||
<ul class="sub">
|
||||
{{ range .Children }}
|
||||
<li{{if $currentPage.IsMenuCurrent "main" . }} class="active"{{end}}><a href="{{.URL}}"> {{ .Name }} </a> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{else}}
|
||||
<li>
|
||||
<a href="{{ .URL }}" title="{{ .Title }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
<li> <a href="https://github.com/gohugoio/hugo/issues" target="blank">Questions and Issues</a> </li>
|
||||
<li> <a href="#" target="blank">Edit this Page</a> </li>
|
||||
</ul>
|
||||
<!-- sidebar menu end-->
|
||||
</div>
|
||||
<ul>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="#">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{else}}
|
||||
<li>
|
||||
<a href="{{.URL}}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<li>
|
||||
<a href="#" target="blank">Hardcoded Link 1</a>
|
||||
<li>
|
||||
<a href="#" target="blank">Hardcoded Link 2</a>
|
||||
</ul>
|
||||
</aside>
|
||||
<!--sidebar end-->
|
||||
{{< /code >}}
|
||||
|
||||
{{% note "`absLangURL` and `relLangURL`" %}}
|
||||
|
@ -5,7 +5,7 @@ description: Hugo ships with its own RSS 2.0 template that requires almost no co
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
keywords: [rss, xml]
|
||||
keywords: [rss, xml, templates]
|
||||
categories: [templates]
|
||||
menu:
|
||||
docs:
|
||||
@ -20,12 +20,7 @@ toc: true
|
||||
|
||||
## RSS Template Lookup Order
|
||||
|
||||
You can use a single RSS template to generate all of your RSS feeds or create a specific template for each individual feed.
|
||||
|
||||
1. `/layouts/section/<section>.rss.xml`
|
||||
2. `/layouts/_default/rss.xml`
|
||||
3. `/themes/<theme>/layouts/section/<section>.rss.xml`
|
||||
4. `/themes/<theme>/layouts/_default/rss.xml`
|
||||
See [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
{{% note "Hugo Ships with an RSS Template" %}}
|
||||
Hugo ships with its own [RSS 2.0 template](#the-embedded-rss-xml). The embedded template will be sufficient for most use cases.
|
||||
|
@ -6,7 +6,7 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates]
|
||||
keywords: [lists,sections]
|
||||
keywords: [lists,sections,templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
@ -24,18 +24,7 @@ To effectively leverage section page templates, you should first understand Hugo
|
||||
|
||||
## Section Template Lookup Order
|
||||
|
||||
The [lookup order][lookup] for section templates is as follows:
|
||||
|
||||
1. `/layouts/section/<SECTION>.html`
|
||||
2. `/layouts/<SECTION>/list.html`
|
||||
3. `/layouts/_default/section.html`
|
||||
4. `/layouts/_default/list.html`
|
||||
5. `/themes/<THEME>/layouts/section/<SECTION>.html`
|
||||
6. `/themes/<THEME>/layouts/<SECTION>/list.html`
|
||||
7. `/themes/<THEME>/layouts/_default/section.html`
|
||||
8. `/themes/<THEME>/layouts/_default/list.html`
|
||||
|
||||
{{< youtube jrMClsB3VsY >}}
|
||||
See [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
## `.Site.GetPage` with Sections
|
||||
|
||||
|
@ -6,7 +6,7 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates]
|
||||
keywords: [shortcodes]
|
||||
keywords: [shortcodes,templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
@ -137,6 +137,10 @@ You can also use the variable `.Page` to access all the normal [page variables][
|
||||
|
||||
A shortcodes can also be nested. In a nested shortcode, you can access the parent shortcode context with [`.Parent` variable][shortcodesvars]. This can be very useful for inheritance of common shortcode parameters from the root.
|
||||
|
||||
### Checking for Existence
|
||||
|
||||
You can check if a specific shortcode is used on a page by calling `.HasShortcode` in that page template, providing the name of the shortcode. This is sometimes useful when you want to include specific scripts or styles in the header that are only used by that shortcode.
|
||||
|
||||
## Custom Shortcode Examples
|
||||
|
||||
The following are examples of the different types of shortcodes you can create via shortcode template files in `/layouts/shortcodes`.
|
||||
|
@ -6,7 +6,7 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-04-06
|
||||
categories: [templates]
|
||||
keywords: [page]
|
||||
keywords: [page,templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
@ -20,22 +20,7 @@ toc: true
|
||||
|
||||
## Single Page Template Lookup Order
|
||||
|
||||
You can specify a [content's `type`][content type] and `layout` in a single content file's [front matter][]. However, you cannot specify `section` because this is determined based on file location (see [content section][section]).
|
||||
|
||||
Hugo assumes your content section and content type are the same unless you tell Hugo otherwise by providing a `type` directly in the front matter of a content file. This is why #1 and #3 come before #2 and #4, respectively, in the following lookup order. Values in angle brackets (`<>`) are variable.
|
||||
|
||||
1. `/layouts/<TYPE>/<LAYOUT>.html`
|
||||
2. `/layouts/<SECTION>/<LAYOUT>.html`
|
||||
3. `/layouts/<TYPE>/single.html`
|
||||
4. `/layouts/<SECTION>/single.html`
|
||||
5. `/layouts/_default/single.html`
|
||||
6. `/themes/<THEME>/layouts/<TYPE>/<LAYOUT>.html`
|
||||
7. `/themes/<THEME>/layouts/<SECTION>/<LAYOUT>.html`
|
||||
8. `/themes/<THEME>/layouts/<TYPE>/single.html`
|
||||
9. `/themes/<THEME>/layouts/<SECTION>/single.html`
|
||||
10. `/themes/<THEME>/layouts/_default/single.html`
|
||||
|
||||
{{< youtube ZYQ5k0RQzmo >}}
|
||||
See [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
## Example Single Page Templates
|
||||
|
||||
|
@ -6,7 +6,7 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates]
|
||||
keywords: [sitemap, xml]
|
||||
keywords: [sitemap, xml, templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
|
@ -6,7 +6,7 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates]
|
||||
keywords: [taxonomies,metadata,front matter,terms]
|
||||
keywords: [taxonomies,metadata,front matter,terms,templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
@ -35,32 +35,13 @@ Taxonomy list page templates are lists and therefore have all the variables and
|
||||
|
||||
### Taxonomy List Template Lookup Order
|
||||
|
||||
A taxonomy will be rendered at /`PLURAL`/`TERM`/ (e.g., http://spf13.com/topics/golang/) according to the following lookup order:
|
||||
|
||||
1. `/layouts/taxonomy/<SINGULAR>.html`
|
||||
2. `/layouts/_default/taxonomy.html`
|
||||
3. `/layouts/_default/list.html`
|
||||
4. `/themes/<THEME>/layouts/taxonomy/<SINGULAR>.html`
|
||||
5. `/themes/<THEME>/layouts/_default/taxonomy.html`
|
||||
6. `/themes/<THEME>/layouts/_default/list.html`
|
||||
See [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
## Taxonomy Terms Template
|
||||
|
||||
### Taxonomy Terms Templates Lookup Order
|
||||
|
||||
A taxonomy terms page will be rendered at `example.com/<PLURALTAXONOMYNAME>`/ (e.g., http://spf13.com/topics/) according to the following lookup order:
|
||||
|
||||
1. `/layouts/taxonomy/<SINGULAR>.terms.html`
|
||||
2. `/layouts/_default/terms.html`
|
||||
3. `/themes/<THEME>/layouts/taxonomy/<SINGULAR>.terms.html`
|
||||
4. `/themes/<THEME>/layouts/_default/terms.html`
|
||||
|
||||
{{% warning "The Taxonomy Terms Template has a Unique Lookup Order" %}}
|
||||
If Hugo does not find a terms template in `layout/` or `/themes/<THEME>/layouts/`, Hugo will *not* render a taxonomy terms page.
|
||||
{{% /warning %}}
|
||||
|
||||
<!-- Begin /taxonomies/methods/ -->
|
||||
Hugo makes a set of values and methods available on the various Taxonomy structures.
|
||||
See [Template Lookup](/templates/lookup-order/).
|
||||
|
||||
### Taxonomy Methods
|
||||
|
||||
|
@ -192,7 +192,7 @@ Any other value defined in the front matter in a content file, including taxonom
|
||||
```
|
||||
---
|
||||
title: My First Post
|
||||
date: date: 2017-02-20T15:26:23-06:00
|
||||
date: 2017-02-20T15:26:23-06:00
|
||||
categories: [one]
|
||||
tags: [two,three,four]
|
||||
```
|
||||
|
534
data/docs.json
@ -220,131 +220,463 @@
|
||||
],
|
||||
"layouts": [
|
||||
{
|
||||
"Example": "AMP home, with theme \"demoTheme\".",
|
||||
"OutputFormat": "AMP",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/index.amp.html",
|
||||
"layouts/index.html",
|
||||
"layouts/_default/list.amp.html",
|
||||
"layouts/_default/list.html",
|
||||
"demoTheme/layouts/index.amp.html",
|
||||
"demoTheme/layouts/index.html",
|
||||
"demoTheme/layouts/_default/list.amp.html",
|
||||
"demoTheme/layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "AMP home, French language\".",
|
||||
"OutputFormat": "AMP",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/index.fr.amp.html",
|
||||
"layouts/index.amp.html",
|
||||
"layouts/index.fr.html",
|
||||
"layouts/index.html",
|
||||
"layouts/_default/list.fr.amp.html",
|
||||
"layouts/_default/list.amp.html",
|
||||
"layouts/_default/list.fr.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "RSS home, no theme.",
|
||||
"OutputFormat": "RSS",
|
||||
"Suffix": "xml",
|
||||
"Template Lookup Order": [
|
||||
"layouts/rss.xml",
|
||||
"layouts/_default/rss.xml",
|
||||
"layouts/_internal/_default/rss.xml"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "JSON home, no theme.",
|
||||
"OutputFormat": "JSON",
|
||||
"Suffix": "json",
|
||||
"Template Lookup Order": [
|
||||
"layouts/index.json.json",
|
||||
"layouts/index.json",
|
||||
"layouts/_default/list.json.json",
|
||||
"layouts/_default/list.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "CSV regular, \"layout: demolayout\" in front matter.",
|
||||
"OutputFormat": "CSV",
|
||||
"Suffix": "csv",
|
||||
"Template Lookup Order": [
|
||||
"layouts/_default/demolayout.csv.csv",
|
||||
"layouts/_default/demolayout.csv"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "JSON regular, \"type: demotype\" in front matter.",
|
||||
"OutputFormat": "JSON",
|
||||
"Suffix": "json",
|
||||
"Template Lookup Order": [
|
||||
"layouts/demotype/single.json.json",
|
||||
"layouts/demotype/single.json",
|
||||
"layouts/_default/single.json.json",
|
||||
"layouts/_default/single.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "HTML regular.",
|
||||
"Example": "Single page in \"posts\" section",
|
||||
"Kind": "page",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/posts/single.html.html",
|
||||
"layouts/posts/single.html",
|
||||
"layouts/_default/single.html.html",
|
||||
"layouts/_default/single.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "AMP regular.",
|
||||
"Example": "Single page in \"posts\" section with layout set",
|
||||
"Kind": "page",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/posts/demolayout.html.html",
|
||||
"layouts/posts/single.html.html",
|
||||
"layouts/posts/demolayout.html",
|
||||
"layouts/posts/single.html",
|
||||
"layouts/_default/demolayout.html.html",
|
||||
"layouts/_default/single.html.html",
|
||||
"layouts/_default/demolayout.html",
|
||||
"layouts/_default/single.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Single page in \"posts\" section with theme",
|
||||
"Kind": "page",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/posts/single.html.html",
|
||||
"demoTheme/layouts/posts/single.html.html",
|
||||
"layouts/posts/single.html",
|
||||
"demoTheme/layouts/posts/single.html",
|
||||
"layouts/_default/single.html.html",
|
||||
"demoTheme/layouts/_default/single.html.html",
|
||||
"layouts/_default/single.html",
|
||||
"demoTheme/layouts/_default/single.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "AMP single page",
|
||||
"Kind": "page",
|
||||
"OutputFormat": "AMP",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/posts/single.amp.html",
|
||||
"layouts/posts/single.html",
|
||||
"layouts/_default/single.amp.html",
|
||||
"layouts/_default/single.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Calendar blog section.",
|
||||
"OutputFormat": "Calendar",
|
||||
"Suffix": "ics",
|
||||
"Example": "AMP single page, French language",
|
||||
"Kind": "page",
|
||||
"OutputFormat": "AMP",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/section/blog.calendar.ics",
|
||||
"layouts/section/blog.ics",
|
||||
"layouts/blog/list.calendar.ics",
|
||||
"layouts/blog/list.ics",
|
||||
"layouts/_default/section.calendar.ics",
|
||||
"layouts/_default/section.ics",
|
||||
"layouts/_default/list.calendar.ics",
|
||||
"layouts/_default/list.ics"
|
||||
"layouts/posts/single.fr.amp.html",
|
||||
"layouts/posts/single.amp.html",
|
||||
"layouts/posts/single.fr.html",
|
||||
"layouts/posts/single.html",
|
||||
"layouts/_default/single.fr.amp.html",
|
||||
"layouts/_default/single.amp.html",
|
||||
"layouts/_default/single.fr.html",
|
||||
"layouts/_default/single.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Calendar taxonomy list.",
|
||||
"OutputFormat": "Calendar",
|
||||
"Suffix": "ics",
|
||||
"Example": "Home page",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/taxonomy/tag.calendar.ics",
|
||||
"layouts/taxonomy/tag.ics",
|
||||
"layouts/_default/taxonomy.calendar.ics",
|
||||
"layouts/_default/taxonomy.ics",
|
||||
"layouts/_default/list.calendar.ics",
|
||||
"layouts/_default/list.ics"
|
||||
"layouts/page/index.html.html",
|
||||
"layouts/page/home.html.html",
|
||||
"layouts/page/list.html.html",
|
||||
"layouts/page/index.html",
|
||||
"layouts/page/home.html",
|
||||
"layouts/page/list.html",
|
||||
"layouts/index.html.html",
|
||||
"layouts/home.html.html",
|
||||
"layouts/list.html.html",
|
||||
"layouts/index.html",
|
||||
"layouts/home.html",
|
||||
"layouts/list.html",
|
||||
"layouts/_default/index.html.html",
|
||||
"layouts/_default/home.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/index.html",
|
||||
"layouts/_default/home.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Calendar taxonomy term.",
|
||||
"OutputFormat": "Calendar",
|
||||
"Suffix": "ics",
|
||||
"Example": "Home page with type set",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/taxonomy/tag.terms.calendar.ics",
|
||||
"layouts/taxonomy/tag.terms.ics",
|
||||
"layouts/_default/terms.calendar.ics",
|
||||
"layouts/_default/terms.ics"
|
||||
"layouts/demotype/index.html.html",
|
||||
"layouts/demotype/home.html.html",
|
||||
"layouts/demotype/list.html.html",
|
||||
"layouts/demotype/index.html",
|
||||
"layouts/demotype/home.html",
|
||||
"layouts/demotype/list.html",
|
||||
"layouts/index.html.html",
|
||||
"layouts/home.html.html",
|
||||
"layouts/list.html.html",
|
||||
"layouts/index.html",
|
||||
"layouts/home.html",
|
||||
"layouts/list.html",
|
||||
"layouts/_default/index.html.html",
|
||||
"layouts/_default/home.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/index.html",
|
||||
"layouts/_default/home.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Home page with layout set",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/page/demolayout.html.html",
|
||||
"layouts/page/index.html.html",
|
||||
"layouts/page/home.html.html",
|
||||
"layouts/page/list.html.html",
|
||||
"layouts/page/demolayout.html",
|
||||
"layouts/page/index.html",
|
||||
"layouts/page/home.html",
|
||||
"layouts/page/list.html",
|
||||
"layouts/demolayout.html.html",
|
||||
"layouts/index.html.html",
|
||||
"layouts/home.html.html",
|
||||
"layouts/list.html.html",
|
||||
"layouts/demolayout.html",
|
||||
"layouts/index.html",
|
||||
"layouts/home.html",
|
||||
"layouts/list.html",
|
||||
"layouts/_default/demolayout.html.html",
|
||||
"layouts/_default/index.html.html",
|
||||
"layouts/_default/home.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/demolayout.html",
|
||||
"layouts/_default/index.html",
|
||||
"layouts/_default/home.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Home page with theme",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/page/index.html.html",
|
||||
"demoTheme/layouts/page/index.html.html",
|
||||
"layouts/page/home.html.html",
|
||||
"demoTheme/layouts/page/home.html.html",
|
||||
"layouts/page/list.html.html",
|
||||
"demoTheme/layouts/page/list.html.html",
|
||||
"layouts/page/index.html",
|
||||
"demoTheme/layouts/page/index.html",
|
||||
"layouts/page/home.html",
|
||||
"demoTheme/layouts/page/home.html",
|
||||
"layouts/page/list.html",
|
||||
"demoTheme/layouts/page/list.html",
|
||||
"layouts/index.html.html",
|
||||
"demoTheme/layouts/index.html.html",
|
||||
"layouts/home.html.html",
|
||||
"demoTheme/layouts/home.html.html",
|
||||
"layouts/list.html.html",
|
||||
"demoTheme/layouts/list.html.html",
|
||||
"layouts/index.html",
|
||||
"demoTheme/layouts/index.html",
|
||||
"layouts/home.html",
|
||||
"demoTheme/layouts/home.html",
|
||||
"layouts/list.html",
|
||||
"demoTheme/layouts/list.html",
|
||||
"layouts/_default/index.html.html",
|
||||
"demoTheme/layouts/_default/index.html.html",
|
||||
"layouts/_default/home.html.html",
|
||||
"demoTheme/layouts/_default/home.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"demoTheme/layouts/_default/list.html.html",
|
||||
"layouts/_default/index.html",
|
||||
"demoTheme/layouts/_default/index.html",
|
||||
"layouts/_default/home.html",
|
||||
"demoTheme/layouts/_default/home.html",
|
||||
"layouts/_default/list.html",
|
||||
"demoTheme/layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "AMP home, French language\"",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "AMP",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/page/index.fr.amp.html",
|
||||
"layouts/page/home.fr.amp.html",
|
||||
"layouts/page/list.fr.amp.html",
|
||||
"layouts/page/index.amp.html",
|
||||
"layouts/page/home.amp.html",
|
||||
"layouts/page/list.amp.html",
|
||||
"layouts/page/index.fr.html",
|
||||
"layouts/page/home.fr.html",
|
||||
"layouts/page/list.fr.html",
|
||||
"layouts/page/index.html",
|
||||
"layouts/page/home.html",
|
||||
"layouts/page/list.html",
|
||||
"layouts/index.fr.amp.html",
|
||||
"layouts/home.fr.amp.html",
|
||||
"layouts/list.fr.amp.html",
|
||||
"layouts/index.amp.html",
|
||||
"layouts/home.amp.html",
|
||||
"layouts/list.amp.html",
|
||||
"layouts/index.fr.html",
|
||||
"layouts/home.fr.html",
|
||||
"layouts/list.fr.html",
|
||||
"layouts/index.html",
|
||||
"layouts/home.html",
|
||||
"layouts/list.html",
|
||||
"layouts/_default/index.fr.amp.html",
|
||||
"layouts/_default/home.fr.amp.html",
|
||||
"layouts/_default/list.fr.amp.html",
|
||||
"layouts/_default/index.amp.html",
|
||||
"layouts/_default/home.amp.html",
|
||||
"layouts/_default/list.amp.html",
|
||||
"layouts/_default/index.fr.html",
|
||||
"layouts/_default/home.fr.html",
|
||||
"layouts/_default/list.fr.html",
|
||||
"layouts/_default/index.html",
|
||||
"layouts/_default/home.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "JSON home",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "JSON",
|
||||
"Suffix": "json",
|
||||
"Template Lookup Order": [
|
||||
"layouts/page/index.json.json",
|
||||
"layouts/page/home.json.json",
|
||||
"layouts/page/list.json.json",
|
||||
"layouts/page/index.json",
|
||||
"layouts/page/home.json",
|
||||
"layouts/page/list.json",
|
||||
"layouts/index.json.json",
|
||||
"layouts/home.json.json",
|
||||
"layouts/list.json.json",
|
||||
"layouts/index.json",
|
||||
"layouts/home.json",
|
||||
"layouts/list.json",
|
||||
"layouts/_default/index.json.json",
|
||||
"layouts/_default/home.json.json",
|
||||
"layouts/_default/list.json.json",
|
||||
"layouts/_default/index.json",
|
||||
"layouts/_default/home.json",
|
||||
"layouts/_default/list.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "RSS home",
|
||||
"Kind": "home",
|
||||
"OutputFormat": "RSS",
|
||||
"Suffix": "xml",
|
||||
"Template Lookup Order": [
|
||||
"layouts/page/index.rss.xml",
|
||||
"layouts/page/home.rss.xml",
|
||||
"layouts/page/rss.xml",
|
||||
"layouts/page/list.rss.xml",
|
||||
"layouts/page/index.xml",
|
||||
"layouts/page/home.xml",
|
||||
"layouts/page/list.xml",
|
||||
"layouts/index.rss.xml",
|
||||
"layouts/home.rss.xml",
|
||||
"layouts/rss.xml",
|
||||
"layouts/list.rss.xml",
|
||||
"layouts/index.xml",
|
||||
"layouts/home.xml",
|
||||
"layouts/list.xml",
|
||||
"layouts/_default/index.rss.xml",
|
||||
"layouts/_default/home.rss.xml",
|
||||
"layouts/_default/rss.xml",
|
||||
"layouts/_default/list.rss.xml",
|
||||
"layouts/_default/index.xml",
|
||||
"layouts/_default/home.xml",
|
||||
"layouts/_default/list.xml",
|
||||
"layouts/_internal/_default/rss.xml"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Section list for \"posts\" section",
|
||||
"Kind": "section",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/posts/posts.html.html",
|
||||
"layouts/posts/section.html.html",
|
||||
"layouts/posts/list.html.html",
|
||||
"layouts/posts/posts.html",
|
||||
"layouts/posts/section.html",
|
||||
"layouts/posts/list.html",
|
||||
"layouts/posts/posts.html.html",
|
||||
"layouts/posts/section.html.html",
|
||||
"layouts/posts/list.html.html",
|
||||
"layouts/posts/posts.html",
|
||||
"layouts/posts/section.html",
|
||||
"layouts/posts/list.html",
|
||||
"layouts/section/posts.html.html",
|
||||
"layouts/section/section.html.html",
|
||||
"layouts/section/list.html.html",
|
||||
"layouts/section/posts.html",
|
||||
"layouts/section/section.html",
|
||||
"layouts/section/list.html",
|
||||
"layouts/_default/posts.html.html",
|
||||
"layouts/_default/section.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/posts.html",
|
||||
"layouts/_default/section.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Section list for \"posts\" section with type set to \"blog\"",
|
||||
"Kind": "section",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/blog/posts.html.html",
|
||||
"layouts/blog/section.html.html",
|
||||
"layouts/blog/list.html.html",
|
||||
"layouts/blog/posts.html",
|
||||
"layouts/blog/section.html",
|
||||
"layouts/blog/list.html",
|
||||
"layouts/posts/posts.html.html",
|
||||
"layouts/posts/section.html.html",
|
||||
"layouts/posts/list.html.html",
|
||||
"layouts/posts/posts.html",
|
||||
"layouts/posts/section.html",
|
||||
"layouts/posts/list.html",
|
||||
"layouts/section/posts.html.html",
|
||||
"layouts/section/section.html.html",
|
||||
"layouts/section/list.html.html",
|
||||
"layouts/section/posts.html",
|
||||
"layouts/section/section.html",
|
||||
"layouts/section/list.html",
|
||||
"layouts/_default/posts.html.html",
|
||||
"layouts/_default/section.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/posts.html",
|
||||
"layouts/_default/section.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Section list for \"posts\" section with layout set to \"demoLayout\"",
|
||||
"Kind": "section",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/posts/demolayout.html.html",
|
||||
"layouts/posts/posts.html.html",
|
||||
"layouts/posts/section.html.html",
|
||||
"layouts/posts/list.html.html",
|
||||
"layouts/posts/demolayout.html",
|
||||
"layouts/posts/posts.html",
|
||||
"layouts/posts/section.html",
|
||||
"layouts/posts/list.html",
|
||||
"layouts/section/demolayout.html.html",
|
||||
"layouts/section/posts.html.html",
|
||||
"layouts/section/section.html.html",
|
||||
"layouts/section/list.html.html",
|
||||
"layouts/section/demolayout.html",
|
||||
"layouts/section/posts.html",
|
||||
"layouts/section/section.html",
|
||||
"layouts/section/list.html",
|
||||
"layouts/_default/demolayout.html.html",
|
||||
"layouts/_default/posts.html.html",
|
||||
"layouts/_default/section.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/demolayout.html",
|
||||
"layouts/_default/posts.html",
|
||||
"layouts/_default/section.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Taxonomy list in categories",
|
||||
"Kind": "taxonomy",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/categories/category.html.html",
|
||||
"layouts/categories/taxonomy.html.html",
|
||||
"layouts/categories/list.html.html",
|
||||
"layouts/categories/category.html",
|
||||
"layouts/categories/taxonomy.html",
|
||||
"layouts/categories/list.html",
|
||||
"layouts/taxonomy/category.html.html",
|
||||
"layouts/taxonomy/taxonomy.html.html",
|
||||
"layouts/taxonomy/list.html.html",
|
||||
"layouts/taxonomy/category.html",
|
||||
"layouts/taxonomy/taxonomy.html",
|
||||
"layouts/taxonomy/list.html",
|
||||
"layouts/category/category.html.html",
|
||||
"layouts/category/taxonomy.html.html",
|
||||
"layouts/category/list.html.html",
|
||||
"layouts/category/category.html",
|
||||
"layouts/category/taxonomy.html",
|
||||
"layouts/category/list.html",
|
||||
"layouts/_default/category.html.html",
|
||||
"layouts/_default/taxonomy.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/category.html",
|
||||
"layouts/_default/taxonomy.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Example": "Taxonomy term in categories",
|
||||
"Kind": "taxonomyTerm",
|
||||
"OutputFormat": "HTML",
|
||||
"Suffix": "html",
|
||||
"Template Lookup Order": [
|
||||
"layouts/categories/category.terms.html.html",
|
||||
"layouts/categories/terms.html.html",
|
||||
"layouts/categories/list.html.html",
|
||||
"layouts/categories/category.terms.html",
|
||||
"layouts/categories/terms.html",
|
||||
"layouts/categories/list.html",
|
||||
"layouts/taxonomy/category.terms.html.html",
|
||||
"layouts/taxonomy/terms.html.html",
|
||||
"layouts/taxonomy/list.html.html",
|
||||
"layouts/taxonomy/category.terms.html",
|
||||
"layouts/taxonomy/terms.html",
|
||||
"layouts/taxonomy/list.html",
|
||||
"layouts/category/category.terms.html.html",
|
||||
"layouts/category/terms.html.html",
|
||||
"layouts/category/list.html.html",
|
||||
"layouts/category/category.terms.html",
|
||||
"layouts/category/terms.html",
|
||||
"layouts/category/list.html",
|
||||
"layouts/_default/category.terms.html.html",
|
||||
"layouts/_default/terms.html.html",
|
||||
"layouts/_default/list.html.html",
|
||||
"layouts/_default/category.terms.html",
|
||||
"layouts/_default/terms.html",
|
||||
"layouts/_default/list.html"
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -1427,7 +1759,7 @@
|
||||
],
|
||||
"Examples": [
|
||||
[
|
||||
"{{chomp \"\u003cp\u003eBlockhead\u003c/p\u003e\\n\" }}",
|
||||
"{{chomp \"\u003cp\u003eBlockhead\u003c/p\u003e\\n\" | safeHTML }}",
|
||||
"\u003cp\u003eBlockhead\u003c/p\u003e"
|
||||
]
|
||||
]
|
||||
|
@ -1,3 +1,17 @@
|
||||
[[tweet]]
|
||||
name = "Jens Munch"
|
||||
twitter_handle = "@jensamunch"
|
||||
quote = "Hugo is really, really incredible... Now does resizing/resampling of images as well! Crazy that something so fast can be a static site generator... Amazing open-source project."
|
||||
link = "https://twitter.com/jensamunch/status/948533063537086464"
|
||||
date = 2018-01-03T04:00:00Z
|
||||
|
||||
[[tweet]]
|
||||
name = "carriecoxwell"
|
||||
twitter_handle = "@carriecoxwell"
|
||||
quote = "Having a lot of fun with <a href='https://twitter.com/gohugoio' target='_blank'>@GoHugoIO</a>! It's exactly what I didn't even know I wanted."
|
||||
link = "https://twitter.com/carriecoxwell/status/948402470144872448"
|
||||
date = 2018-01-03T03:00:00Z
|
||||
|
||||
[[tweet]]
|
||||
name = "STOQE"
|
||||
twitter_handle = "@STOQE"
|
||||
|
28
layouts/shortcodes/datatable-filtered.html
Normal file
@ -0,0 +1,28 @@
|
||||
{{ $package := (index .Params 0) }}
|
||||
{{ $listname := (index .Params 1) }}
|
||||
{{ $filter := split (index .Params 2) " " }}
|
||||
{{ $filter1 := index $filter 0 }}
|
||||
{{ $filter2 := index $filter 1 }}
|
||||
{{ $filter3 := index $filter 2 }}
|
||||
|
||||
{{ $list := (index (index .Site.Data.docs $package) $listname) }}
|
||||
{{ $fields := after 3 .Params }}
|
||||
{{ $list := where $list $filter1 $filter2 $filter3 }}
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
{{ range $fields }}
|
||||
<th>{{ . }}</th>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ range $list }}
|
||||
<tr>
|
||||
{{ range $k, $v := . }}
|
||||
{{ $.Scratch.Set $k $v }}
|
||||
{{ end }}
|
||||
{{ range $fields }}
|
||||
<td>{{ $.Scratch.Get . }}</td>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
19
layouts/shortcodes/imgproc.html
Normal file
@ -0,0 +1,19 @@
|
||||
{{ $original := .Page.Resources.GetByPrefix (.Get 0) }}
|
||||
{{ $command := .Get 1 }}
|
||||
{{ $options := .Get 2 }}
|
||||
{{ if eq $command "Fit"}}
|
||||
{{ .Scratch.Set "image" ($original.Fit $options) }}
|
||||
{{ else if eq $command "Resize"}}
|
||||
{{ .Scratch.Set "image" ($original.Resize $options) }}
|
||||
{{ else if eq $command "Fill"}}
|
||||
{{ .Scratch.Set "image" ($original.Fill $options) }}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}}
|
||||
{{ end }}
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
<figure style="width: {{ add $image.Width 3 }}px; padding: 3px; background-color: #cccc">
|
||||
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
|
||||
<figcaption>
|
||||
<small>.{{ $command }} "{{ $options }}"</small>
|
||||
</figcaption>
|
||||
</figure>
|
@ -3,15 +3,15 @@
|
||||
command = "hugo"
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.31.1"
|
||||
HUGO_VERSION = "0.33"
|
||||
HUGO_ENV = "production"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.31.1"
|
||||
HUGO_VERSION = "0.33"
|
||||
|
||||
[context.branch-deploy.environment]
|
||||
HUGO_VERSION = "0.31.1"
|
||||
HUGO_VERSION = "0.33"
|
||||
|
||||
[context.next.environment]
|
||||
HUGO_BASEURL = "https://next--gohugoio.netlify.com/"
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
BIN
static/images/blog/hugo-32-poster.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
static/images/blog/hugo-33-poster.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
static/images/blog/sunset.jpg
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
static/images/hugo-content-bundles.png
Normal file
After Width: | Height: | Size: 62 KiB |