aboutsummaryrefslogtreecommitdiffhomepage
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/about/new-in-032.md178
-rw-r--r--content/about/roadmap.md51
-rw-r--r--content/commands/hugo.md5
-rw-r--r--content/commands/hugo_benchmark.md5
-rw-r--r--content/commands/hugo_check.md4
-rw-r--r--content/commands/hugo_check_ulimit.md4
-rw-r--r--content/commands/hugo_config.md4
-rw-r--r--content/commands/hugo_convert.md4
-rw-r--r--content/commands/hugo_convert_toJSON.md4
-rw-r--r--content/commands/hugo_convert_toTOML.md4
-rw-r--r--content/commands/hugo_convert_toYAML.md4
-rw-r--r--content/commands/hugo_env.md4
-rw-r--r--content/commands/hugo_gen.md4
-rw-r--r--content/commands/hugo_gen_autocomplete.md4
-rw-r--r--content/commands/hugo_gen_chromastyles.md4
-rw-r--r--content/commands/hugo_gen_doc.md4
-rw-r--r--content/commands/hugo_gen_man.md4
-rw-r--r--content/commands/hugo_import.md4
-rw-r--r--content/commands/hugo_import_jekyll.md4
-rw-r--r--content/commands/hugo_list.md4
-rw-r--r--content/commands/hugo_list_drafts.md4
-rw-r--r--content/commands/hugo_list_expired.md4
-rw-r--r--content/commands/hugo_list_future.md4
-rw-r--r--content/commands/hugo_new.md4
-rw-r--r--content/commands/hugo_new_site.md4
-rw-r--r--content/commands/hugo_new_theme.md4
-rw-r--r--content/commands/hugo_server.md5
-rw-r--r--content/commands/hugo_undraft.md4
-rw-r--r--content/commands/hugo_version.md4
-rw-r--r--content/content-management/multilingual.md15
-rw-r--r--content/content-management/organization.md42
-rw-r--r--content/content-management/sections.md82
-rw-r--r--content/content-management/static-files.md3
-rw-r--r--content/content-management/taxonomies.md2
-rw-r--r--content/content-management/urls.md2
-rw-r--r--content/functions/ref.md10
-rw-r--r--content/functions/relref.md12
-rw-r--r--content/getting-started/configuration.md3
-rw-r--r--content/getting-started/installing.md8
-rw-r--r--content/hosting-and-deployment/hosting-on-gitlab.md7
-rw-r--r--content/hosting-and-deployment/hosting-on-keycdn.md4
-rw-r--r--content/news/0.31-relnotes-ready.md80
-rw-r--r--content/news/0.31.1-relnotes-ready.md20
-rw-r--r--content/readfiles/bfconfig.md2
-rw-r--r--content/readfiles/sectionvars.md20
-rw-r--r--content/templates/introduction.md2
-rw-r--r--content/templates/output-formats.md19
-rw-r--r--content/templates/taxonomy-templates.md14
-rw-r--r--content/variables/files.md14
-rw-r--r--content/variables/git.md12
-rw-r--r--content/variables/hugo.md8
-rw-r--r--content/variables/menus.md18
-rw-r--r--content/variables/page.md111
-rw-r--r--content/variables/shortcodes.md6
-rw-r--r--content/variables/site.md52
-rw-r--r--content/variables/sitemap.md6
-rw-r--r--content/variables/taxonomy.md12
57 files changed, 611 insertions, 315 deletions
diff --git a/content/about/new-in-032.md b/content/about/new-in-032.md
new file mode 100644
index 000000000..3076b3d37
--- /dev/null
+++ b/content/about/new-in-032.md
@@ -0,0 +1,178 @@
+---
+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
+---
+
+
+{{% 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 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
+```
+
+
+
+
+
diff --git a/content/about/roadmap.md b/content/about/roadmap.md
deleted file mode 100644
index d4117fc21..000000000
--- a/content/about/roadmap.md
+++ /dev/null
@@ -1,51 +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
----
-
-To track Hugo's progress, see our [GitHub Milestones][milestones].
-
-In no particular order, here are some other features currently being worked on:
-
-* Even easier deployment to S3, SSH, GitHub, rsync. Give the [hosting and deployment][] section a shot.
-* Import from other website systems. There are already [existing migration tools][migrate], but they don’t cover all major platforms.
-* An interactive web-based editor (See the [related forum thread][])
-* Additional [themes][], which are always ongoing and [contributions are welcome][themescontrib]!
-* Dynamic image resizing via shortcodes ({{< gh 1014 >}})
-* Native support for additional content formats (AsciiDoc {{< gh 1435>}}, reST {{< gh 1436 >}})
-* And, last but not least, [***your*** best ideas!][]
-
-## 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/
diff --git a/content/commands/hugo.md b/content/commands/hugo.md
index 836298378..847c873fd 100644
--- a/content/commands/hugo.md
+++ b/content/commands/hugo.md
@@ -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
diff --git a/content/commands/hugo_benchmark.md b/content/commands/hugo_benchmark.md
index ef3c2423b..3d958b2fa 100644
--- a/content/commands/hugo_benchmark.md
+++ b/content/commands/hugo_benchmark.md
@@ -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
diff --git a/content/commands/hugo_check.md b/content/commands/hugo_check.md
index fa8cc9a02..06f00c10a 100644
--- a/content/commands/hugo_check.md
+++ b/content/commands/hugo_check.md
@@ -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
diff --git a/content/commands/hugo_check_ulimit.md b/content/commands/hugo_check_ulimit.md
index 6b2554b43..ee0d7ecc3 100644
--- a/content/commands/hugo_check_ulimit.md
+++ b/content/commands/hugo_check_ulimit.md
@@ -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
diff --git a/content/commands/hugo_config.md b/content/commands/hugo_config.md
index e45926f1c..dc82b0bb2 100644
--- a/content/commands/hugo_config.md
+++ b/content/commands/hugo_config.md
@@ -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
diff --git a/content/commands/hugo_convert.md b/content/commands/hugo_convert.md
index 825350ce1..d648ac342 100644
--- a/content/commands/hugo_convert.md
+++ b/content/commands/hugo_convert.md
@@ -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
diff --git a/content/commands/hugo_convert_toJSON.md b/content/commands/hugo_convert_toJSON.md
index 42000aa45..1d2ccb27d 100644
--- a/content/commands/hugo_convert_toJSON.md
+++ b/content/commands/hugo_convert_toJSON.md
@@ -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
diff --git a/content/commands/hugo_convert_toTOML.md b/content/commands/hugo_convert_toTOML.md
index 9d1e30bcf..098f6132d 100644
--- a/content/commands/hugo_convert_toTOML.md
+++ b/content/commands/hugo_convert_toTOML.md
@@ -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
diff --git a/content/commands/hugo_convert_toYAML.md b/content/commands/hugo_convert_toYAML.md
index cb6dac3e9..f9e0e6863 100644
--- a/content/commands/hugo_convert_toYAML.md
+++ b/content/commands/hugo_convert_toYAML.md
@@ -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
diff --git a/content/commands/hugo_env.md b/content/commands/hugo_env.md
index 38d726865..90ecf1dc4 100644
--- a/content/commands/hugo_env.md
+++ b/content/commands/hugo_env.md
@@ -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
diff --git a/content/commands/hugo_gen.md b/content/commands/hugo_gen.md
index 3aafee1e3..fc12e368f 100644
--- a/content/commands/hugo_gen.md
+++ b/content/commands/hugo_gen.md
@@ -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
diff --git a/content/commands/hugo_gen_autocomplete.md b/content/commands/hugo_gen_autocomplete.md
index 024d63427..800c24804 100644
--- a/content/commands/hugo_gen_autocomplete.md
+++ b/content/commands/hugo_gen_autocomplete.md
@@ -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
diff --git a/content/commands/hugo_gen_chromastyles.md b/content/commands/hugo_gen_chromastyles.md
index d042910eb..dd81610c4 100644
--- a/content/commands/hugo_gen_chromastyles.md
+++ b/content/commands/hugo_gen_chromastyles.md
@@ -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
diff --git a/content/commands/hugo_gen_doc.md b/content/commands/hugo_gen_doc.md
index 7513b5150..908e98ecf 100644
--- a/content/commands/hugo_gen_doc.md
+++ b/content/commands/hugo_gen_doc.md
@@ -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
diff --git a/content/commands/hugo_gen_man.md b/content/commands/hugo_gen_man.md
index e420fec75..c7b0cf22c 100644
--- a/content/commands/hugo_gen_man.md
+++ b/content/commands/hugo_gen_man.md
@@ -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
diff --git a/content/commands/hugo_import.md b/content/commands/hugo_import.md
index 04c0cb9b7..80e227646 100644
--- a/content/commands/hugo_import.md
+++ b/content/commands/hugo_import.md
@@ -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
diff --git a/content/commands/hugo_import_jekyll.md b/content/commands/hugo_import_jekyll.md
index f46698433..d1583ec7a 100644
--- a/content/commands/hugo_import_jekyll.md
+++ b/content/commands/hugo_import_jekyll.md
@@ -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
diff --git a/content/commands/hugo_list.md b/content/commands/hugo_list.md
index df8e8cb84..7a2665a45 100644
--- a/content/commands/hugo_list.md
+++ b/content/commands/hugo_list.md
@@ -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
diff --git a/content/commands/hugo_list_drafts.md b/content/commands/hugo_list_drafts.md
index 893d7105b..f842cb22b 100644
--- a/content/commands/hugo_list_drafts.md
+++ b/content/commands/hugo_list_drafts.md
@@ -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
diff --git a/content/commands/hugo_list_expired.md b/content/commands/hugo_list_expired.md
index 846990057..bbf083593 100644
--- a/content/commands/hugo_list_expired.md
+++ b/content/commands/hugo_list_expired.md
@@ -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
diff --git a/content/commands/hugo_list_future.md b/content/commands/hugo_list_future.md
index 387558926..d0c96d0c1 100644
--- a/content/commands/hugo_list_future.md
+++ b/content/commands/hugo_list_future.md
@@ -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
diff --git a/content/commands/hugo_new.md b/content/commands/hugo_new.md
index eaa9c3fdf..19eca79c0 100644
--- a/content/commands/hugo_new.md
+++ b/content/commands/hugo_new.md
@@ -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
diff --git a/content/commands/hugo_new_site.md b/content/commands/hugo_new_site.md
index f4b5c2a9a..7ac1146e2 100644
--- a/content/commands/hugo_new_site.md
+++ b/content/commands/hugo_new_site.md
@@ -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
diff --git a/content/commands/hugo_new_theme.md b/content/commands/hugo_new_theme.md
index 3f3989cd5..8aac5651c 100644
--- a/content/commands/hugo_new_theme.md
+++ b/content/commands/hugo_new_theme.md
@@ -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
diff --git a/content/commands/hugo_server.md b/content/commands/hugo_server.md
index 1581ef54b..1157e646f 100644
--- a/content/commands/hugo_server.md
+++ b/content/commands/hugo_server.md
@@ -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
diff --git a/content/commands/hugo_undraft.md b/content/commands/hugo_undraft.md
index e8b670719..102ec4541 100644
--- a/content/commands/hugo_undraft.md
+++ b/content/commands/hugo_undraft.md
@@ -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
diff --git a/content/commands/hugo_version.md b/content/commands/hugo_version.md
index 850be51a0..c4b07d25b 100644
--- a/content/commands/hugo_version.md
+++ b/content/commands/hugo_version.md
@@ -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
diff --git a/content/content-management/multilingual.md b/content/content-management/multilingual.md
index 4a646741d..189207ca6 100644
--- a/content/content-management/multilingual.md
+++ b/content/content-management/multilingual.md
@@ -63,7 +63,7 @@ Only the obvious non-global options can be overridden per language. Examples of
From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
-This means that you can now confugre a `baseURL` per `language`:
+This means that you can now configure a `baseURL` per `language`:
> If a `baseURL` is set on the `language` level, then all languages must have one and they must all be different.
@@ -192,6 +192,19 @@ The above can be put in a `partial` (i.e., inside `layouts/partials/`) and inclu
The above also uses the [`i18n` function][i18func] described in the next section.
+## List All Available Languages
+
+`.AllTranslations` on a `Page` can be used to list all translations, including itself. Called on the home page it can be used to build a language navigator:
+
+
+{{< code file="layouts/partials/allLanguages.html" >}}
+<ul>
+{{ range $.Site.Home.AllTranslations }}
+<li><a href="{{ .}}">{{ .Language.LanguageName }}</a></li>
+{{ end }}
+</ul>
+{{< /code >}}
+
## Translation of Strings
Hugo uses [go-i18n][] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.
diff --git a/content/content-management/organization.md b/content/content-management/organization.md
index eb884ee4e..a239c5624 100644
--- a/content/content-management/organization.md
+++ b/content/content-management/organization.md
@@ -17,20 +17,15 @@ aliases: [/content/sections/]
toc: true
---
-{{% note %}}
-This section is not updated with the new nested sections support in Hugo 0.24, see https://github.com/gohugoio/hugoDocs/issues/36
-{{% /note %}}
-{{% todo %}}
-See above
-{{% /todo %}}
-
{{< youtube 0GZxidrlaRM >}}
## Organization of Content Source
In Hugo, your content should be organized in a manner that reflects the rendered website.
-While Hugo supports content nested at any level, the top levels (i.e. `content/<DIRECTORIES>`) are special in Hugo and are considered the content [sections][]. Without any additional configuration, the following will just work:
+While Hugo supports content nested at any level, the top levels (i.e. `content/<DIRECTORIES>`) are special in Hugo and are considered the content type used to determine layouts etc. To read more about sections, including how to nest them, see [sections][].
+
+Without any additional configuration, the following will just work:
```
.
@@ -49,11 +44,16 @@ While Hugo supports content nested at any level, the top levels (i.e. `content/<
## Path Breakdown in Hugo
+
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseurl = "https://example.com"` in your [site's configuration file][config].
### Index Pages: `_index.md`
-`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists] as of v0.18. These templates include those for [section templates][], [taxonomy templates][], [taxonomy terms templates][], and your [homepage template][]. In your templates, you can grab information from `_index.md` using the [`.Site.GetPage` function][getpage].
+`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists]. These templates include those for [section templates][], [taxonomy templates][], [taxonomy terms templates][], and your [homepage template][].
+
+{{% note %}}
+**Tip:** You can get a reference to the content and metadata in `_index.md` using the [`.Site.GetPage` function](/functions/getpage/).
+{{% /note %}}
You can keep one `_index.md` for your homepage and one in each of your content sections, taxonomies, and taxonomy terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website:
@@ -81,6 +81,9 @@ At build, this will output to the following destination with the associated valu
https://example.com/posts/index.html
```
+The [sections][] can be nested as deeply as you need. The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (i.e. `_index.md`).
+
+
### Single Pages in Sections
Single content files in each of your sections are going to be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
@@ -107,27 +110,6 @@ At the time Hugo builds your site, the content will be output to the following d
https://example.com/posts/my-first-hugo-post/index.html
```
-### Section with Nested Directories
-
-To continue the example, the following demonstrates destination paths for a file located at `content/events/chicago/lollapalooza.md` in the same site:
-
-
-```
- section
- ⊢--^--⊣
- url
- ⊢-------------^------------⊣
-
- baseURL path slug
-⊢--------^--------⊣ ⊢------^-----⊣⊢----^------⊣
- permalink
-⊢----------------------^-----------------------⊣
-https://example.com/events/chicago/lollapalooza/
-```
-
-{{% note %}}
-As of v0.20, Hugo does not recognize nested sections. While you can nest as many content *directories* as you'd like, any child directory of a section will still be considered the same section as that of its parents. Therefore, in the above example, `{{.Section}}` for `lollapalooza.md` is `events` and *not* `chicago`. See the [related issue on GitHub](https://github.com/gohugoio/hugo/issues/465).
-{{% /note %}}
## Paths Explained
diff --git a/content/content-management/sections.md b/content/content-management/sections.md
index 411379224..def5cac87 100644
--- a/content/content-management/sections.md
+++ b/content/content-management/sections.md
@@ -1,7 +1,7 @@
---
title: Content Sections
linktitle: Sections
-description: Hugo supports content sections, which according to Hugo's default behavior, will reflect the structure of the rendered website.
+description: "Hugo generates a **section tree** that matches your content."
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
@@ -17,53 +17,65 @@ aliases: [/content/sections/]
toc: true
---
+
+## Nested Sections
+
+The sections can be nested as deeply as you need.
+
+```bash
+blog
+├── funny-cats
+│   └── kittens
+│   └── _index.md
+└── tech
+ └── _index.md
+```
+
+
+**The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (e.g. `_index.md`).**
+
+
{{% note %}}
-This section is not updated with the new nested sections support in Hugo 0.24, see https://github.com/gohugoio/hugoDocs/issues/36
+When we talk about a **section** in correlation with template selection, it is currently always the root section only (`/blog/funny/mypost/ => blog`).
+
+It is currently not possible to add a specific layout for one of the sub-sections.
{{% /note %}}
-{{% todo %}}
-See above
-{{% /todo %}}
-Hugo believes that you organize your content with a purpose. The same structure that works to organize your source content is used to organize the rendered site (see [directory structure][]).
-Following this pattern, Hugo uses the top level of your content organization as the content **section**.
+## Example: Breadcrumb Navigation
-The following example shows a content directory structure for a website that has three sections: "authors," "events," and "posts":
+With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
-```
-.
-└── content
- ├── authors
- | ├── _index.md // <- example.com/authors/
- | ├── john-doe.md // <- example.com/authors/john-doe/
- | └── jane-doe.md // <- example.com/authors/jane-doe/
- └── events
- | ├── _index.md // <- example.com/events/
- | ├── event-1.md // <- example.com/events/event-1/
- | ├── event-2.md // <- example.com/events/event-2/
- | └── event-3.md // <- example.com/events/event-3/
- └── posts
- | ├── _index.md // <- example.com/posts/
- | ├── post-1.md // <- example.com/posts/post-1/
- | ├── post-2.md // <- example.com/posts/post-2/
- | ├── post-3.md // <- example.com/posts/post-3/
- | ├── post-4.md // <- example.com/posts/post-4/
- | └── post-5.md // <- example.com/posts/post-5/
-```
-## Content Section Lists
+{{< code file="layouts/partials/breadcrumb.html" download="breadcrumb.html" >}}
+<ol class="nav navbar-nav">
+ {{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
+</ol>
+{{ define "breadcrumbnav" }}
+{{ if .p1.Parent }}
+{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
+{{ else if not .p1.IsHome }}
+{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
+{{ end }}
+<li{{ if eq .p1 .p2 }} class="active"{{ end }}>
+ <a href="{{ .p1.Permalink }}">{{ .p1.Title }}</a>
+</li>
+{{ end }}
+{{< /code >}}
-Hugo will automatically create pages for each section root that list all of the content in that section. See the documentation on [section templates][] for details on customizing the way these pages are rendered.
+## Section Page Variables and Methods
-As of Hugo v0.18, section pages can also have a content file and front matter. These section content files must be placed in their corresponding section folder and named `_index.md` in order for Hugo to correctly render the front matter and content.
+Also see [Page Variables](/variables/page/).
-{{% warning "`index.md` vs `_index.md`" %}}
-Hugo themes developed before v0.18 often used an `index.md`(i.e., without the leading underscore [`_`]) in a content section as a hack to emulate the behavior of `_index.md`. The hack may work...*sometimes*; however, the order of page rendering can be unpredictable in Hugo. What works now may fail to render appropriately as your site grows. It is **strongly advised** to use `_index.md` as content for your section index pages. **Note:** `_index.md`'s layout, as representative of a section, is a [list page template](/templates/section-templates/) and *not* a [single page template](/templates/single-page-templates/). If you want to alter the new default behavior for `_index.md`, configure `disableKinds` accordingly in your [site's configuration](/getting-started/configuration/).
-{{% /warning %}}
+{{< readfile file="/content/readfiles/sectionvars.md" markdown="true" >}}
+
+## Content Section Lists
+
+Hugo will automatically create pages for each section root that list all of the content in that section. See the documentation on [section templates][] for details on customizing the way these pages are rendered.
## Content *Section* vs Content *Type*
-By default, everything created within a section will use the [content type][] that matches the section name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content type. If you are using an [archetype][] for your posts section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
+By default, everything created within a section will use the [content type][] that matches the root section name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content type. If you are using an [archetype][] for your posts section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
[archetype]: /content-management/archetypes/
[content type]: /content-management/types/
diff --git a/content/content-management/static-files.md b/content/content-management/static-files.md
index c8ad75de3..12d27ccf2 100644
--- a/content/content-management/static-files.md
+++ b/content/content-management/static-files.md
@@ -42,4 +42,7 @@ In the above, with no theme used:
* The English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win.
* The Norwegian site will get its static files as a union of "staticDir_override" and "static_no".
+**Note:** The `2` `static2` (can be a number between 0 and 10) is added to tell Hugo that you want to **add** this directory to the global set of static directories. Using `staticDir` on the language level would replace the global value.
+
+
**Note:** The example above is a [multihost setup](/content-management/multilingual/#configure-multilingual-multihost). In a regular setup, all the static directories will be available to all sites.
diff --git a/content/content-management/taxonomies.md b/content/content-management/taxonomies.md
index 90efa43e3..0d0a26327 100644
--- a/content/content-management/taxonomies.md
+++ b/content/content-management/taxonomies.md
@@ -132,7 +132,7 @@ Note that if you use `preserveTaxonomyNames` and intend to manually construct UR
{{% note %}}
You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
-Note also that taxonomy [permalinks](/content-management/urls/) are *not* configurable.
+Much like regular pages, taxonomy list [permalinks](/content-management/urls/) are configurable, but taxonomy term page permalinks are not.
{{% /note %}}
## Add Taxonomies to Content
diff --git a/content/content-management/urls.md b/content/content-management/urls.md
index 0ef48163c..f0d9dca41 100644
--- a/content/content-management/urls.md
+++ b/content/content-management/urls.md
@@ -45,6 +45,8 @@ permalinks:
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2017/02/sample-entry/`.
+You can also configure permalinks of taxonomies with the same syntax, by using the plural form of the taxonomy instead of the section. You will probably only want to use the configuration values `:slug` or `:title`.
+
### Permalink Configuration Values
The following is a list of values that can be used in a `permalink` definition in your site `config` file. All references to time are dependent on the content's date.
diff --git a/content/functions/ref.md b/content/functions/ref.md
index ac35cc8b7..d63c0a89d 100644
--- a/content/functions/ref.md
+++ b/content/functions/ref.md
@@ -11,7 +11,7 @@ menu:
docs:
parent: "functions"
keywords: [cross references, anchors]
-signature: ["ref CONTENT"]
+signature: ["ref . CONTENT"]
workson: []
hugoversion:
relatedfuncs: [relref]
@@ -19,12 +19,16 @@ deprecated: false
aliases: []
---
-`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink:
+`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink:
```
-{{ ref "about.md" }}
+{{ ref . "about.md" }}
```
+{{% note "Usage Note" %}}
+`ref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
+{{% /note %}}
+
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).
diff --git a/content/functions/relref.md b/content/functions/relref.md
index 32d7075c8..ea992af2f 100644
--- a/content/functions/relref.md
+++ b/content/functions/relref.md
@@ -11,20 +11,24 @@ menu:
docs:
parent: "functions"
keywords: [cross references, anchors]
-signature: ["relref CONTENT"]
+signature: ["relref . CONTENT"]
workson: []
hugoversion:
-relatedfuncs: [relref]
+relatedfuncs: [ref]
deprecated: false
aliases: []
---
-`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink:
+`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink:
```
-{{ relref "about.md" }}
+{{ relref . "about.md" }}
```
+{{% note "Usage Note" %}}
+`relref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
+{{% /note %}}
+
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).
diff --git a/content/getting-started/configuration.md b/content/getting-started/configuration.md
index 27d959e82..d4fb5a17e 100644
--- a/content/getting-started/configuration.md
+++ b/content/getting-started/configuration.md
@@ -288,8 +288,7 @@ pygmentsUseClasses = false
SectionPagesMenu =
# default sitemap configuration map
sitemap =
-# filesystem path to read files relative from
-source = ""
+# filesystem path to read static files relative from
staticDir = "static"
# display memory and timing of different steps of the program
stepAnalysis = false
diff --git a/content/getting-started/installing.md b/content/getting-started/installing.md
index 9745cbee9..0375ceead 100644
--- a/content/getting-started/installing.md
+++ b/content/getting-started/installing.md
@@ -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.
diff --git a/content/hosting-and-deployment/hosting-on-gitlab.md b/content/hosting-and-deployment/hosting-on-gitlab.md
index 05a9a2d56..c38908cae 100644
--- a/content/hosting-and-deployment/hosting-on-gitlab.md
+++ b/content/hosting-and-deployment/hosting-on-gitlab.md
@@ -4,7 +4,7 @@ linktitle: Host on GitLab
description: GitLab makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides native support for Hugo.
date: 2016-06-23
publishdate: 2016-06-23
-lastmod: 2016-06-23
+lastmod: 2017-11-16
categories: [hosting and deployment]
keywords: [hosting,deployment,git,gitlab]
authors: [Riku-Pekka Silvola]
@@ -40,9 +40,8 @@ In the root directory of your Hugo site, create a `.gitlab-ci.yml` file. The `.g
{{< code file="gitlab-ci.yml" >}}
image: monachus/hugo
-before_script:
- - git submodule init
- - git submodule update --force
+variables:
+ GIT_SUBMODULE_STRATEGY: recursive
pages:
script:
diff --git a/content/hosting-and-deployment/hosting-on-keycdn.md b/content/hosting-and-deployment/hosting-on-keycdn.md
index 748796a3f..78337c138 100644
--- a/content/hosting-and-deployment/hosting-on-keycdn.md
+++ b/content/hosting-and-deployment/hosting-on-keycdn.md
@@ -4,6 +4,10 @@ date: 2017-09-12
description: "Accelerate your Hugo site globally with a KeyCDN integration. This tutorial shows you how to setup your static site as a GitLab page behind a KeyCDN pull zone."
categories: [hosting and deployment]
keywords: [keycdn,hosting,deployment,cdn]
+menu:
+ docs:
+ parent: "hosting-and-deployment"
+ weight: 40
slug: ""
aliases: []
toc: false
diff --git a/content/news/0.31-relnotes-ready.md b/content/news/0.31-relnotes-ready.md
new file mode 100644
index 000000000..138ecc08c
--- /dev/null
+++ b/content/news/0.31-relnotes-ready.md
@@ -0,0 +1,80 @@
+
+---
+date: 2017-11-20
+title: "Hugo 0.31: Language Multihost Edition!"
+description: "Hugo 0.31: Multihost, smart union static dirs, and more ..."
+slug: "0.31-relnotes"
+categories: ["Releases"]
+images:
+- images/blog/hugo-31-poster.png
+---
+
+ Hugo `0.31` is the **Language Multihost Edition!**
+
+> <img src="https://esolia.com/img/eSolia-Logo-Flat-2015.svg" alt="eSolia" width="100px" align="top" style="width:100px" />The Multihost feature is sponsored by [eSolia](https://esolia.com/), [@rickcogley](https://github.com/rickcogley)'s company.
+
+[Multihost](https://gohugo.io/content-management/multilingual/#configure-multilingual-multihost) means that you can have a **`baseURL` per language**, for example, `https://no.example.com` and `https://en.example.com`. This is seamlessly integrated, and the built-in web server with live reload and `navigateToChanged` etc. just works. A related enhancement in this release is the support for **as many static dirs as you need**, with intelligent language overrides, forming a big union file system. Add to that several other language related fixes and enhancements, it is safe to say that this is the version you want for multilingual Hugo sites!
+
+This release represents **44 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 [@kaushalmodi](https://github.com/kaushalmodi), [@natefinch](https://github.com/natefinch), and [@betaveros](https://github.com/betaveros) for their ongoing contributions.
+And as always a 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 **13 contributions by 9 contributors**. A special thanks to [@oncletom](https://github.com/oncletom), [@kaushalmodi](https://github.com/kaushalmodi), [@XhmikosR](https://github.com/XhmikosR), and [@digitalcraftsman](https://github.com/digitalcraftsman) for their work on the documentation site.
+
+
+Hugo now has:
+
+* 21105+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 455+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 184+ [themes](http://themes.gohugo.io/)
+
+## Notes
+
+* For mapping of translated content, Hugo now considers the full path of the content file, which makes it possible with translation of duplicate content filenames such as `index.md`. A specific translation key can be specified with the new `translationKey` front matter variable. See [#2699](https://github.com/gohugoio/hugo/issues/2699).
+
+
+## Enhancements
+
+### Language related
+
+* Support unknown language codes [23ba779f](https://github.com/gohugoio/hugo/commit/23ba779fab90ce45cddd68b4f49a2515ce6d4878) [@bep](https://github.com/bep) [#3564](https://github.com/gohugoio/hugo/issues/3564)
+* Fix `.IsTranslated` with identical filenames [b3daa1f4](https://github.com/gohugoio/hugo/commit/b3daa1f4bf1b84bcc5da028257ba609be74e3ecc) [@bep](https://github.com/bep) [#2699](https://github.com/gohugoio/hugo/issues/2699)
+* Fall back to unstranslated base template [0a81a6b4](https://github.com/gohugoio/hugo/commit/0a81a6b4bae3de53aa9c179b855c671a2d30eec7) [@bep](https://github.com/bep) [#3893](https://github.com/gohugoio/hugo/issues/3893)
+* Add support for multiple static dirs [60dfb9a6](https://github.com/gohugoio/hugo/commit/60dfb9a6e076200ab3ca3fd30e34bb3c14e0a893) [@bep](https://github.com/bep) [#36](https://github.com/gohugoio/hugo/issues/36)[#4027](https://github.com/gohugoio/hugo/issues/4027)
+* Add multilingual multihost support [2e046576](https://github.com/gohugoio/hugo/commit/2e0465764b5dacc511b977b1c9aa07324ad0ee9c) [@bep](https://github.com/bep) [#4027](https://github.com/gohugoio/hugo/issues/4027)
+
+### Templates
+
+* Refactor `Mod` with `cast` [76dc811c](https://github.com/gohugoio/hugo/commit/76dc811c6539b2ed8b4d3b22693e5088b9f6ecfe) [@artem-sidorenko](https://github.com/artem-sidorenko)
+* Add support for height argument to figure shortcode [488631fe](https://github.com/gohugoio/hugo/commit/488631fe0abc3667355345c7eb98ba7a2204deb5) [@kaushalmodi](https://github.com/kaushalmodi) [#4014](https://github.com/gohugoio/hugo/issues/4014)
+
+### Core
+
+* Use ms precision for static change logging [bb048d81](https://github.com/gohugoio/hugo/commit/bb048d811d3977adb10656335cd339cd8c945a25) [@bep](https://github.com/bep)
+* Update Chroma to get the latest SASS lexer [b32ffed6](https://github.com/gohugoio/hugo/commit/b32ffed6abc67646cad89e163846f3ffef29cec8) [@bep](https://github.com/bep) [#4069](https://github.com/gohugoio/hugo/issues/4069)
+* Bump to Go 1.9.2 [9299a16c](https://github.com/gohugoio/hugo/commit/9299a16c9952a284d3ac3f31d2662f1812f77768) [@bep](https://github.com/bep) [#4064](https://github.com/gohugoio/hugo/issues/4064)
+* Update Travis and snapcraft to Go 1.9.2 [77cbd001](https://github.com/gohugoio/hugo/commit/77cbd001ff6b2e0aaa48566ef2af49ca68e19af9) [@bep](https://github.com/bep) [#4064](https://github.com/gohugoio/hugo/issues/4064)
+* Handle Taxonomy permalinks [d9a78b61](https://github.com/gohugoio/hugo/commit/d9a78b61adefe8e1803529f4774185874af85148) [@betaveros](https://github.com/betaveros) [#1208](https://github.com/gohugoio/hugo/issues/1208)
+
+
+### Other
+
+* Support Fast Render mode with sub-path in baseURL [31641033](https://github.com/gohugoio/hugo/commit/3164103310fbca1211cfa9ce4a5eb7437854b6ad) [@bep](https://github.com/bep) [#3981](https://github.com/gohugoio/hugo/issues/3981)
+* Simplify Site benchmarks [c3c10f2c](https://github.com/gohugoio/hugo/commit/c3c10f2c7ce4ee11186f51161943efc8b37a28c9) [@bep](https://github.com/bep)
+* Replace `make` with `mage` to build Hugo [#3969](https://github.com/gohugoio/hugo/issues/3969)
+* Convert to `dep` as dependency/vendor manager for Hugo [#3988](https://github.com/gohugoio/hugo/issues/3988)
+* Pre-allocate some slices [a9be687b](https://github.com/gohugoio/hugo/commit/a9be687b81df01c7343f78f0d3760042f467baa4) [@bep](https://github.com/bep)
+
+## Fixes
+
+### Templates
+
+* Make sure only one instance of a cached partial is rendered [#4086](https://github.com/gohugoio/hugo/issues/4086)
+
+### Other
+
+* Fix broken shortcodes for `Ace` and `Amber` [503ca6de](https://github.com/gohugoio/hugo/commit/503ca6de6ceb0b4af533f9efeff917d6f3871278) [@bep](https://github.com/bep) [#4051](https://github.com/gohugoio/hugo/issues/4051)
+* Fix error handling in `mage` build [c9c19d79](https://github.com/gohugoio/hugo/commit/c9c19d794537cf76ff281788c3d6cf5f2beac54d) [@natefinch](https://github.com/natefinch)
+* Fix `hugo -w` [fa53b13c](https://github.com/gohugoio/hugo/commit/fa53b13ca0ffb1db6ed20f5353661d3f8a5fd455) [@bep](https://github.com/bep) [#3980](https://github.com/gohugoio/hugo/issues/3980)
+
diff --git a/content/news/0.31.1-relnotes-ready.md b/content/news/0.31.1-relnotes-ready.md
new file mode 100644
index 000000000..9c6be6281
--- /dev/null
+++ b/content/news/0.31.1-relnotes-ready.md
@@ -0,0 +1,20 @@
+
+---
+date: 2017-11-27
+title: "Hugo 0.31.1: One Bugfix!"
+description: "Fixes broken `--appendPort=false`."
+slug: "0.31.1"
+categories: ["Releases"]
+images:
+- images/blog/hugo-bug-poster.png
+
+---
+
+This is a bug-fix release with one important bug fix:
+
+* Fix broken `--appendPort=false` [8afd7d9c](https://github.com/gohugoio/hugo/commit/8afd7d9ceb0d168300e3399c6e87a355a88c9a28) [@bep](https://github.com/bep) [#4111](https://github.com/gohugoio/hugo/issues/4111)
+
+
+
+
+
diff --git a/content/readfiles/bfconfig.md b/content/readfiles/bfconfig.md
index 97176095d..5388694dc 100644
--- a/content/readfiles/bfconfig.md
+++ b/content/readfiles/bfconfig.md
@@ -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`
diff --git a/content/readfiles/sectionvars.md b/content/readfiles/sectionvars.md
new file mode 100644
index 000000000..c0756e7d1
--- /dev/null
+++ b/content/readfiles/sectionvars.md
@@ -0,0 +1,20 @@
+.CurrentSection
+: the page's current section. The value can be the page itself if it is a section or the homepage.
+
+.InSection $anotherPage
+: whether the given page is in the current section. Note that this will always return false for pages that are not either regular, home or section pages.
+
+.IsAncestor $anotherPage
+: whether the current page is an ancestor of the given page. Note that this method is not relevant for taxonomy lists and taxonomy terms pages.
+
+.IsDescendant $anotherPage
+: whether the current page is a descendant of the given page. Note that this method is not relevant for taxonomy lists and taxonomy terms pages.
+
+.Parent
+: a section's parent section or a page's section.
+
+.Section
+: the [section](/content-management/sections/) this content belongs to. **Note:** For nested sections, this is the first path element in the directory, for example, `/blog/funny/mypost/ => blog`.
+
+.Sections
+: the [sections](/content-management/sections/) below this content.
diff --git a/content/templates/introduction.md b/content/templates/introduction.md
index 26802a7f7..0f4e8e3d3 100644
--- a/content/templates/introduction.md
+++ b/content/templates/introduction.md
@@ -101,7 +101,7 @@ Go templates only ship with a few basic functions but also provide a mechanism f
=> true (i.e., since 1 is less than 2)
```
-Note that both examples make us of Go template's [math functions][].
+Note that both examples make use of Go template's [math functions][].
{{% note "Additional Boolean Operators" %}}
There are more boolean operators than those listed in the Hugo docs in the [Golang template documentation](http://golang.org/pkg/text/template/#hdr-Functions).
diff --git a/content/templates/output-formats.md b/content/templates/output-formats.md
index e044ce21a..9af68f5e0 100644
--- a/content/templates/output-formats.md
+++ b/content/templates/output-formats.md
@@ -37,8 +37,6 @@ This is the full set of built-in media types in Hugo:
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
-Example in `config.toml`:
-
```
[mediaTypes]
[mediaTypes."text/enriched"]
@@ -49,6 +47,21 @@ Example in `config.toml`:
The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type.
+**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the output format. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
+
+```toml
+[mediaTypes]
+[mediaTypes."text/html"]
+suffix = "htm"
+
+# Redefine HTML to update its media type.
+[outputFormats]
+[outputFormats.HTML]
+mediaType = "text/html"
+```
+
+**Note** that for the above to work, you also need to add an`outputs` definition in your site config.
+
## Output Formats
Given a media type and some additional configuration, you get an `Output Format`:
@@ -61,7 +74,7 @@ This is the full set of Hugo's built-in output formats:
* The `MediaType` must match the `Type` of an already defined media type.
* You can define new output formats or redefine built-in output formats; e.g., if you want to put `AMP` pages in a different path.
-To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/templates/configuration/), either for all sites or for a given language.
+To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
```
[outputFormats.MyEnrichedFormat]
diff --git a/content/templates/taxonomy-templates.md b/content/templates/taxonomy-templates.md
index 1b65663f3..9e1f4626f 100644
--- a/content/templates/taxonomy-templates.md
+++ b/content/templates/taxonomy-templates.md
@@ -78,6 +78,9 @@ A Taxonomy is a `map[string]WeightedPages`.
.ByCount
: Returns an OrderedTaxonomy (slice) ordered by number of entries.
+.Reverse
+: Returns an OrderedTaxonomy (slice) in reverse order. Must be used with an OrderedTaxonomy.
+
### OrderedTaxonomy
Since Maps are unordered, an OrderedTaxonomy is a special structure that has a defined order.
@@ -160,6 +163,17 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
</ul>
```
+### Order by Least Popular Example
+
+```
+<ul>
+ {{ $data := .Data }}
+ {{ range $key, $value := .Data.Terms.ByCount.Reverse }}
+ <li><a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
+ {{ end }}
+</ul>
+```
+
<!-- [See Also Taxonomy Lists](/templates/list/) -->
## Order Content within Taxonomies
diff --git a/content/variables/files.md b/content/variables/files.md
index 45bc03b6d..ac5376dbd 100644
--- a/content/variables/files.md
+++ b/content/variables/files.md
@@ -24,25 +24,25 @@ For information on creating shortcodes and templates that tap into Hugo's file-r
The `.File` object contains the following fields:
-`.File.Path`
+.File.Path
: the original relative path of the page (e.g., `content/posts/foo.en.md`)
-`.File.LogicalName`
+.File.LogicalName
: the name of the content file that represents a page (e.g., `foo.en.md`)
-`.File.TranslationBaseName`
+.File.TranslationBaseName
: the filename without extension or optional language identifier (e.g., `foo`)
-`.File.BaseFileName`
+.File.BaseFileName
: the filename without extension (e.g., `foo.en`)
-`.File.Ext`
+.File.Ext
: the file extension of the content file (e.g., `md`); this can also be called using `.File.Extension` as well. Note that it is *only* the extension without `.`.
-`.File.Lang`
+.File.Lang
: the language associated with the given file if Hugo's [Multilingual features][multilingual] are enabled (e.g., `en`)
-`.File.Dir`
+.File.Dir
: given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned (e.g., `posts/dir1/dir2/`)
[Multilingual]: /content-management/multilingual/ \ No newline at end of file
diff --git a/content/variables/git.md b/content/variables/git.md
index a06ee104c..f9c154764 100644
--- a/content/variables/git.md
+++ b/content/variables/git.md
@@ -33,22 +33,22 @@ Hugo's Git integrations should be fairly performant but *can* increase your buil
The `GitInfo` object contains the following fields:
-`.AbbreviatedHash`
+.AbbreviatedHash
: the abbreviated commit hash (e.g., `866cbcc`)
-`.AuthorName`
+.AuthorName
: the author's name, respecting `.mailmap`
-`.AuthorEmail`
+.AuthorEmail
: the author's email address, respecting `.mailmap`
-`.AuthorDate`
+.AuthorDate
: the author date
-`.Hash`
+.Hash
: the commit hash (e.g., `866cbccdab588b9908887ffd3b4f2667e94090c3`)
-`.Subject`
+.Subject
: commit message subject (e.g., `tpl: Add custom index function`)
## `.Lastmod`
diff --git a/content/variables/hugo.md b/content/variables/hugo.md
index 55b80f8c2..c0c5c9601 100644
--- a/content/variables/hugo.md
+++ b/content/variables/hugo.md
@@ -21,16 +21,16 @@ wip: false
It contains the following fields:
-`.Hugo.Generator`
+.Hugo.Generator
: `<meta>` tag for the version of Hugo that generated the site. `.Hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.18" />`
-`.Hugo.Version`
+.Hugo.Version
: the current version of the Hugo binary you are using e.g. `0.13-DEV`<br>
-`.Hugo.CommitHash`
+.Hugo.CommitHash
: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
-`.Hugo.BuildDate`
+.Hugo.BuildDate
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`<br>
{{% note "Use the Hugo Generator Tag" %}}
diff --git a/content/variables/menus.md b/content/variables/menus.md
index f510d6a98..3c71079ae 100644
--- a/content/variables/menus.md
+++ b/content/variables/menus.md
@@ -20,31 +20,31 @@ toc: false
The [menu template][] has the following properties:
-`.URL`
+.URL
: string
-`.Name`
+.Name
: string
-`.Menu`
+.Menu
: string
-`.Identifier`
+.Identifier
: string
-`.Pre`
+.Pre
: template.HTML
-`.Post`
+.Post
: template.HTML
-`.Weight`
+.Weight
: int
-`.Parent`
+.Parent
: string
-`.Children`
+.Children
: Menu
[menu template]: /templates/menu-templates/ \ No newline at end of file
diff --git a/content/variables/page.md b/content/variables/page.md
index 41d3e4462..76cf0e83b 100644
--- a/content/variables/page.md
+++ b/content/variables/page.md
@@ -26,68 +26,65 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
## Page Variables
-`.AlternativeOutputFormats`
+.AlternativeOutputFormats
: contains all alternative formats for a given page; this variable is especially useful `link rel` list in your site's `<head>`. (See [Output Formats](/templates/output-formats/).)
-`.Content`
+.Content
: the content itself, defined below the front matter.
-`.CurrentSection`
-: the page's current section. The value can be the page itself if it is a section or the homepage.
-
-`.Data`
+.Data
: the data specific to this type of page.
-`.Date`
+.Date
: the date associated with the page; `.Date` pulls from the `date` field in a content's front matter. See also `.ExpiryDate`, `.PublishDate`, and `.Lastmod`.
-`.Description`
+.Description
: the description for the page.
-`.Dir`
+.Dir
: the path of the folder containing this content file. The path is relative to the `content` folder.
-`.Draft`
+.Draft
: a boolean, `true` if the content is marked as a draft in the front matter.
-`.ExpiryDate`
+.ExpiryDate
: the date on which the content is scheduled to expire; `.ExpiryDate` pulls from the `expirydate` field in a content's front matter. See also `.PublishDate`, `.Date`, and `.Lastmod`.
-`.File`
+.File
: filesystem-related data for this content file. See also [File Variables][].
-`.FuzzyWordCount`
+.FuzzyWordCount
: the approximate number of words in the content.
-`.Hugo`
+.Hugo
: see [Hugo Variables](/variables/hugo/).
-`.IsHome`
+.IsHome
: `true` in the context of the [homepage](/templates/homepage/).
-`.IsNode`
+.IsNode
: always `false` for regular content pages.
-`.IsPage`
+.IsPage
: always `true` for regular content pages.
-`.IsTranslated`
+.IsTranslated
: `true` if there are translations to display.
-`.Keywords`
+.Keywords
: the meta keywords for the content.
-`.Kind`
+.Kind
: the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections.
-`.Lang`
+.Lang
: language taken from the language extension notation.
-`.Language`
+.Language
: a language object that points to the language's definition in the site
`config`.
-`.Lastmod`
+.Lastmod
: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter.
- If `lastmod` is not set, and `.GitInfo` feature is disabled, the front matter `date` field will be used.
@@ -95,98 +92,98 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo].
-`.LinkTitle`
+.LinkTitle
: access when creating links to the content. If set, Hugo will use the `linktitle` from the front matter before `title`.
-`.Next`
+.Next
: pointer to the following content (based on the `publishdate` field in front matter).
-`.NextInSection`
+.NextInSection
: pointer to the following content within the same section (based on `publishdate` field in front matter).
-`.OutputFormats`
+.OutputFormats
: contains all formats, including the current format, for a given page. Can be combined the with [`.Get` function](/functions/get/) to grab a specific format. (See [Output Formats](/templates/output-formats/).)
-`.Pages`
+.Pages
: a collection of associated pages. This value will be `nil` for regular content pages. `.Pages` is an alias for `.Data.Pages`.
-`.Permalink`
+.Permalink
: the Permanent link for this page; see [Permalinks](/content-management/urls/)
-`.Plain`
+.Plain
: the Page content stripped of HTML tags and presented as a string.
-`.PlainWords`
+.PlainWords
: the Page content stripped of HTML as a `[]string` using Go's [`strings.Fields`](https://golang.org/pkg/strings/#Fields) to split `.Plain` into a slice.
-`.Prev`
+.Prev
: Pointer to the previous content (based on `publishdate` in front matter).
-`.PrevInSection`
+.PrevInSection
: Pointer to the previous content within the same section (based on `publishdate` in front matter). For example, `{{if .PrevInSection}}{{.PrevInSection.Permalink}}{{end}}`.
-`.PublishDate`
+.PublishDate
: the date on which the content was or will be published; `.Publishdate` pulls from the `publishdate` field in a content's front matter. See also `.ExpiryDate`, `.Date`, and `.Lastmod`.
-`.RSSLink`
+.RSSLink
: link to the taxonomies' RSS link.
-`.RawContent`
+.RawContent
: raw markdown content without the front matter. Useful with [remarkjs.com](
http://remarkjs.com)
-`.ReadingTime`
+.ReadingTime
: the estimated time, in minutes, it takes to read the content.
-`.Ref`
+.Ref
: returns the permalink for a given reference (e.g., `.Ref "sample.md"`). `.Ref` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
-`.RelPermalink`
+.RelPermalink
: the relative permanent link for this page.
-`.RelRef`
+.RelRef
: returns the relative permalink for a given reference (e.g., `RelRef
"sample.md"`). `.RelRef` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
-`.Section`
-: the [section](/content-management/sections/) this content belongs to.
-
-`.Sections`
-: the [sections](/content-management/sections/) below this content.
-
-`.Site`
+.Site
: see [Site Variables](/variables/site/).
-`.Summary`
+.Summary
: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <code>&lt;!&#x2d;&#x2d;more&#x2d;&#x2d;&gt;</code> at the appropriate place in the content page. See [Content Summaries](/content-management/summaries/) for more details.
-`.TableOfContents`
+.TableOfContents
: the rendered [table of contents](/content-management/toc/) for the page.
-`.Title`
+.Title
: the title for this page.
-`.Translations`
+.Translations
: a list of translated versions of the current page. See [Multilingual Mode](/content-management/multilingual/) for more information.
-`.Truncated`
+.Truncated
: a boolean, `true` if the `.Summary` is truncated. Useful for showing a "Read more..." link only when necessary. See [Summaries](/content-management/summaries/) for more information.
-`.Type`
+.Type
: the [content type](/content-management/types/) of the content (e.g., `post`).
-`.URL`
+.URL
: the URL for the page relative to the web root. Note that a `url` set directly in front matter overrides the default relative URL for the rendered page.
-`.UniqueID`
+.UniqueID
: the MD5-checksum of the content file's path.
-`.Weight`
+.Weight
: assigned weight (in the front matter) to this content, used in sorting.
-`.WordCount`
+.WordCount
: the number of words in the content.
+## Section Variables and Methods
+
+Also see [Sections](/content-management/sections/).
+
+{{< readfile file="/content/readfiles/sectionvars.md" markdown="true" >}}
+
## Page-level Params
Any other value defined in the front matter in a content file, including taxonomies, will be made available as part of the `.Params` variable.
diff --git a/content/variables/shortcodes.md b/content/variables/shortcodes.md
index cd9d01463..b194eb7db 100644
--- a/content/variables/shortcodes.md
+++ b/content/variables/shortcodes.md
@@ -20,13 +20,13 @@ toc: false
[Shortcodes][shortcodes] have access to parameters delimited in the shortcode declaration via [`.Get`][getfunction], page- and site-level variables, and also the following shortcode-specific fields:
-`.Parent`
+.Parent
: provides access to the parent shortcode context in nested shortcodes. This can be very useful for inheritance of common shortcode parameters from the root.
-`.IsNamedParams`
+.IsNamedParams
: boolean that returns `true` when the shortcode in question uses [named rather than positional parameters][shortcodes]
-`.Inner`
+.Inner
: represents the content between the opening and closing shortcode tags when a [closing shortcode][markdownshortcode] is used
[getfunction]: /functions/get/
diff --git a/content/variables/site.md b/content/variables/site.md
index 7e958b217..00b1d20e7 100644
--- a/content/variables/site.md
+++ b/content/variables/site.md
@@ -22,82 +22,82 @@ The following is a list of site-level (aka "global") variables. Many of these va
## Site Variables List
-`.Site.AllPages`
+.Site.AllPages
: array of all pages, regardless of their translation.
-`.Site.Author`
+.Site.Author
: a map of the authors as defined in the site configuration.
-`.Site.BaseURL`
+.Site.BaseURL
: the base URL for the site as defined in the site configuration.
-`.Site.BuildDrafts`
+.Site.BuildDrafts
: a boolean (default: `false`) to indicate whether to build drafts as defined in the site configuration.
-`.Site.Copyright`
+.Site.Copyright
: a string representing the copyright of your website as defined in the site configuration.
-`.Site.Data`
+.Site.Data
: custom data, see [Data Templates](/templates/data-templates/).
-`.Site.DisqusShortname`
+.Site.DisqusShortname
: a string representing the shortname of the Disqus shortcode as defined in the site configuration.
-`.Site.Files`
+.Site.Files
: all source files for the Hugo website.
-`.Site.GoogleAnalytics`
+.Site.GoogleAnalytics
: a string representing your tracking code for Google Analytics as defined in the site configuration.
-`.Site.IsMultiLingual`
+.Site.IsMultiLingual
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
-`.Site.Language.Lang`
+.Site.Language.Lang
: the language code of the current locale (e.g., `en`).
-`.Site.Language.LanguageName`
+.Site.Language.LanguageName
: the full language name (e.g. `English`).
-`.Site.Language.Weight`
+.Site.Language.Weight
: the weight that defines the order in the `.Site.Languages` list.
-`.Site.Language`
+.Site.Language
: indicates the language currently being used to render the website. This object's attributes are set in site configurations' language definition.
-`.Site.LanguageCode`
+.Site.LanguageCode
: a string representing the language as defined in the site configuration. This is mostly used to populate the RSS feeds with the right language code.
-`.Site.LanguagePrefix`
+.Site.LanguagePrefix
: this can be used to prefix URLs to point to the correct language. It will even work when only one defined language. See also the functions [absLangURL](/functions/abslangurl/) and [relLangURL](/functions/rellangurl).
-`.Site.Languages`
+.Site.Languages
: an ordered list (ordered by defined weight) of languages.
-`.Site.LastChange`
+.Site.LastChange
: a string representing the date/time of the most recent change to your site. This string is based on the [`date` variable in the front matter](/content-management/front-matter) of your content pages.
-`.Site.Menus`
+.Site.Menus
: all of the menus in the site.
-`.Site.Pages`
+.Site.Pages
: array of all content ordered by Date with the newest first. This array contains only the pages in the current language.
-`.Site.Permalinks`
+.Site.Permalinks
: a string to override the default [permalink](/content-management/urls/) format as defined in the site configuration.
-`.Site.RegularPages`
+.Site.RegularPages
: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalent to `where .Site.Pages "Kind" "page"`.
-`.Site.RSSLink`
+.Site.RSSLink
: the URL for the site RSS.
-`.Site.Sections`
+.Site.Sections
: top-level directories of the site.
-`.Site.Taxonomies`
+.Site.Taxonomies
: the [taxonomies](/taxonomies/usage/) for the entire site. Replaces the now-obsolete `.Site.Indexes` since v0.11. Also see section [Taxonomies elsewhere](#taxonomies-elsewhere).
-`.Site.Title`
+.Site.Title
: a string representing the title of the site.
## The `.Site.Params` Variable
diff --git a/content/variables/sitemap.md b/content/variables/sitemap.md
index 5eda0e280..dd926f2b3 100644
--- a/content/variables/sitemap.md
+++ b/content/variables/sitemap.md
@@ -20,13 +20,13 @@ toc: false
A sitemap is a `Page` and therefore has all the [page variables][pagevars] available to use sitemap templates. They also have the following sitemap-specific variables available to them:
-`.Sitemap.ChangeFreq`
+.Sitemap.ChangeFreq
: the page change frequency
-`.Sitemap.Priority`
+.Sitemap.Priority
: the priority of the page
-`.Sitemap.Filename`
+.Sitemap.Filename
: the sitemap filename
[pagevars]: /variables/page/ \ No newline at end of file
diff --git a/content/variables/taxonomy.md b/content/variables/taxonomy.md
index 18a978e8d..1cfa56c51 100644
--- a/content/variables/taxonomy.md
+++ b/content/variables/taxonomy.md
@@ -24,22 +24,22 @@ toc: true
For example, the following fields would be available in `layouts/_defaults/terms.html`, depending on how you organize your [taxonomy templates][taxonomytemplates]:
-`.Data.Singular`
+.Data.Singular
: The singular name of the taxonomy (e.g., `tags => `tag`)
-`.Data.Plural`
+.Data.Plural
: The plural name of the taxonomy (e.g., `tags => tags`)
-`.Data.Pages`
+.Data.Pages
: The list of pages in the taxonomy
-`.Data.Terms`
+.Data.Terms
: The taxonomy itself
-`.Data.Terms.Alphabetical`
+.Data.Terms.Alphabetical
: The taxonomy terms alphabetized
-`.Data.Terms.ByCount`
+.Data.Terms.ByCount
: The Terms ordered by popularity
Note that `.Data.Terms.Alphabetical` and `.Data.Terms.ByCount` can also be reversed: