--- /dev/null
- <head>
- <meta charset="utf-8">
- {{/* https://www.zachleat.com/web/preload/ */}}
- <link rel="preload" href="{{ "fonts/muli-latin-200.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
- <link rel="preload" href="{{ "fonts/muli-latin-400.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
- <link rel="preload" href="{{ "fonts/muli-latin-800.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
-
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- {{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
- <title>{{ block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
-
- <meta name="viewport" content="width=device-width,minimum-scale=1">
- {{ hugo.Generator }}
-
- {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
- <meta name="robots" content="index, follow">
- {{ else }}
- <meta name="robots" content="noindex, nofollow">
- {{ end }}
-
- {{ range .AlternativeOutputFormats -}}
- <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
- {{ end -}}
-
- {{ $isDev := eq hugo.Environment "development" }}
- {{ $stylesheet := resources.Get "output/css/app.css" }}
- {{ if not $isDev }}
- {{ $stylesheet = $stylesheet | minify | fingerprint }}
- {{ end }}
- {{ with $stylesheet }}
- {{ if $isDev }}
- <link rel="stylesheet" href="{{ .RelPermalink }}" crossorigin="anonymous">
- {{ else }}
- <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
- {{ end }}
- {{ $.Scratch.Set "stylesheet" . }}
- {{end}}
-
-
- {{ block "scripts" . }}
- {{- partial "site-scripts.html" . -}}
- {{ end }}
- {{ partial "site-manifest.html" . }}
- {{- partial "head-additions.html" . -}}
- {{- template "_internal/opengraph.html" . -}}
- {{- template "_internal/schema.html" . -}}
- {{- template "_internal/twitter_cards.html" . -}}
-
- {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
- {{ partial "gtag" . }}
- {{ end }}
-
-
-
-
- </head>
- <body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">
- {{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
- {{ block "header" . }}{{ end }}
- <main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
- {{ block "main" . }}{{ end }}
- </main>
-
- {{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
-
-
- </body>
- </html>
+<!DOCTYPE html>
+<html class="no-js" lang="{{ with $.Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
++
++<head>
++ <meta charset="utf-8">
++ {{/* https://www.zachleat.com/web/preload/ */}}
++ <link rel="preload" href="{{ "fonts/muli-latin-200.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
++ <link rel="preload" href="{{ "fonts/muli-latin-400.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
++ <link rel="preload" href="{{ "fonts/muli-latin-800.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
++
++ <meta http-equiv="X-UA-Compatible" content="IE=edge">
++ {{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
++ <title>{{ block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
++
++ <meta name="viewport" content="width=device-width,minimum-scale=1">
++ {{ hugo.Generator }}
++
++ {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
++ <meta name="robots" content="index, follow">
++ {{ else }}
++ <meta name="robots" content="noindex, nofollow">
++ {{ end }}
++
++ {{ range .AlternativeOutputFormats -}}
++ <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
++ {{ end -}}
++
++ {{ $isDev := eq hugo.Environment "development" }}
++ {{ $stylesheet := resources.Get "output/css/app.css" }}
++ {{ if not $isDev }}
++ {{ $stylesheet = $stylesheet | minify | fingerprint }}
++ {{ end }}
++ {{ with $stylesheet }}
++ {{ if $isDev }}
++ <link rel="stylesheet" href="{{ .RelPermalink }}" crossorigin="anonymous">
++ {{ else }}
++ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
++ {{ end }}
++ {{ $.Scratch.Set "stylesheet" . }}
++ {{end}}
++
++
++ {{ block "scripts" . }}
++ {{- partial "site-scripts.html" . -}}
++ {{ end }}
++ {{ partial "site-manifest.html" . }}
++ {{- partial "head-additions.html" . -}}
++ {{- template "_internal/opengraph.html" . -}}
++ {{- template "_internal/schema.html" . -}}
++ {{- template "_internal/twitter_cards.html" . -}}
++
++ {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
++ {{ partial "gtag" . }}
++ {{ end }}
++
++
++
++
++</head>
++
++<body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">
++ {{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
++ {{ block "header" . }}{{ end }}
++ <main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
++ {{ block "main" . }}{{ end }}
++ </main>
++
++ {{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
++
++
++</body>
++
++</html>
--- /dev/null
- </section>
+---
+title: Build Options
+linktitle: Build Options
+description: Build options help define how Hugo must treat a given page when building the site.
+date: 2020-03-02
+publishdate: 2020-03-02
+keywords: [build,content,front matter, page resources]
+categories: ["content management"]
+menu:
+ docs:
+ parent: "content-management"
+ weight: 31
+weight: 31 #rem
+draft: false
+aliases: [/content/build-options/]
+toc: true
+---
+
+They are stored in a reserved Front Matter object named `_build` with the following defaults:
+
+```yaml
+_build:
+ render: true
+ list: always
+ publishResources: true
+```
+
+#### render
+If true, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink.
+
+#### list
+
+Note that we extended this property from a boolean to an enum in Hugo 0.58.0.
+
+Valid values are:
+
+never
+: The page will not be incldued in any page collection.
+
+always (default)
+: The page will be included in all page collections, e.g. `site.RegularPages`, `$page.Pages`.
+
+local
+: The page will be included in any _local_ page collection, e.g. `$page.RegularPages`, `$page.Pages`. One use case for this would be to create fully navigable, but headless content sections. {{< new-in "0.58.0" >}}
+
+If true, the page will be treated as part of the project's collections and, when appropriate, returned by Hugo's listing methods (`.Pages`, `.RegularPages` etc...).
+
+#### publishResources
+
+If set to true the [Bundle's Resources]({{< relref "content-management/page-bundles" >}}) will be published.
+Setting this to false will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
+
+{{% note %}}
+Any page, regardless of their build options, will always be available using the [`.GetPage`]({{< relref "functions/GetPage" >}}) methods.
+{{% /note %}}
+
+------
+
+### Illustrative use cases
+
+#### Not publishing a page
+Project needs a "Who We Are" content file for Front Matter and body to be used by the homepage but nowhere else.
+
+```yaml
+# content/who-we-are.md`
+title: Who we are
+_build:
+ list: false
+ render: false
+```
+
+```go-html-template
+{{/* layouts/index.html */}}
+<section id="who-we-are">
+{{ with site.GetPage "who-we-are" }}
+ {{ .Content }}
+{{ end }}
+</section>
+```
+
+#### Listing pages without publishing them
+
+Website needs to showcase a few of the hundred "testimonials" available as content files without publishing any of them.
+
+To avoid setting the build options on every testimonials, one can use [`cascade`]({{< relref "/content-management/front-matter#front-matter-cascade" >}}) on the testimonial section's content file.
+
+```yaml
+#content/testimonials/_index.md
+title: Testimonials
+# section build options:
+_build:
+ render: true
+# children build options with cascade
+cascade:
+ _build:
+ render: false
+ list: true # default
+```
+
+```go-html-template
+{{/* layouts/_defaults/testimonials.html */}}
+<section id="testimonials">
+{{ range first 5 .Pages }}
+ <blockquote cite="{{ .Params.cite }}">
+ {{ .Content }}
+ </blockquote>
+{{ end }}
++</section>
--- /dev/null
- * [Static Man](https://staticman.net/)
+---
+title: Comments
+linktitle: Comments
+description: Hugo ships with an internal Disqus template, but this isn't the only commenting system that will work with your new Hugo website.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-03-09
+keywords: [sections,content,organization]
+categories: [project organization, fundamentals]
+menu:
+ docs:
+ parent: "content-management"
+ weight: 140
+weight: 140 #rem
+draft: false
+aliases: [/extras/comments/]
+toc: true
+---
+
+Hugo ships with support for [Disqus](https://disqus.com/), a third-party service that provides comment and community capabilities to websites via JavaScript.
+
+Your theme may already support Disqus, but if not, it is easy to add to your templates via [Hugo's built-in Disqus partial][disquspartial].
+
+## Add Disqus
+
+Hugo comes with all the code you need to load Disqus into your templates. Before adding Disqus to your site, you'll need to [set up an account][disqussetup].
+
+### Configure Disqus
+
+Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
+
+{{< code-toggle copy="false" >}}
+disqusShortname = "yourdiscussshortname"
+{{</ code-toggle >}}
+
+For many websites, this is enough configuration. However, you also have the option to set the following in the [front matter][] of a single content file:
+
+* `disqus_identifier`
+* `disqus_title`
+* `disqus_url`
+
+### Render Hugo's Built-in Disqus Partial Template
+
+Disqus has its own [internal template](https://gohugo.io/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
+
+```
+{{ template "_internal/disqus.html" . }}
+```
+
+## Comments Alternatives
+
+There are a few alternatives to commenting on static sites for those who do not want to use Disqus:
+
- * [Utterances](https://utteranc.es/) (Open source, Github comments widget built on Github issues)
++* [Staticman](https://staticman.net/)
+* [Talkyard](https://www.talkyard.io/blog-comments) (Open source, & serverless hosting)
+* [IntenseDebate](https://intensedebate.com/)
+* [Graph Comment][]
+* [Muut](https://muut.com/)
+* [isso](https://posativ.org/isso/) (Self-hosted, Python)
+ * [Tutorial on Implementing Isso with Hugo][issotutorial]
++* [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues)
+* [Remark](https://github.com/umputun/remark) (Open source, Golang, Easy to run docker)
+* [Commento](https://commento.io/) (Open Source, available as a service, local install, or docker image)
+* [JustComments](https://just-comments.com) (Open Source, available as a service, can be self-hosted)
+
+
+[configuration]: /getting-started/configuration/
+[disquspartial]: /templates/partials/#disqus
+[disqussetup]: https://disqus.com/profile/signup/
+[forum]: https://discourse.gohugo.io
+[front matter]: /content-management/front-matter/
+[Graph Comment]: https://graphcomment.com/
+[kaijuissue]: https://github.com/spf13/kaiju/issues/new
+[issotutorial]: https://stiobhart.net/2017-02-24-isso-comments/
+[partials]: /templates/partials/
+[MongoDB]: https://www.mongodb.com/
+[tweet]: https://twitter.com/spf13
--- /dev/null
- keywords: [resources,images]
+---
+title: "Image Processing"
+description: "Image Page resources can be resized and cropped."
+date: 2018-01-24T13:10:00-05:00
+linktitle: "Image Processing"
+categories: ["content management"]
-
++keywords: [resources, images]
+weight: 4004
+draft: false
+toc: true
+menu:
+ docs:
+ parent: "content-management"
+ weight: 32
+---
+
+## The Image Page Resource
+
+The `image` is a [Page Resource]({{< relref "/content-management/page-resources" >}}), and the processing methods listed below do not work on images inside your `/static` folder.
+
+To get all images in a [Page Bundle]({{< relref "/content-management/organization#page-bundles" >}}):
+
+```go-html-template
+{{ with .Resources.ByType "image" }}
+{{ end }}
+
+```
+
+## Image Processing Methods
+
- {{ $image := $resource.Resize "600x" }}
+The `image` resource implements the methods `Resize`, `Fit` and `Fill`, each returning the transformed image using the specified dimensions and processing options. The `image` resource also, since Hugo 0.58, implements the method `Exif` and `Filter`.
+
+### Resize
+
+Resizes the image to the specified width and height.
+
+```go
+// Resize to a width of 600px and preserve ratio
- {{ $image := $resource.Resize "x400" }}
++{{ $image := $resource.Resize "600x" }}
+
+// Resize to a height of 400px and preserve ratio
- {{ $image := $resource.Fit "600x400" }}
++{{ $image := $resource.Resize "x400" }}
+
+// Resize to a width 600px and a height of 400px
+{{ $image := $resource.Resize "600x400" }}
+```
+
+### Fit
++
+Scale down the image to fit the given dimensions while maintaining aspect ratio. Both height and width are required.
+
+```go
- {{ $image := $resource.Fill "600x400" }}
++{{ $image := $resource.Fit "600x400" }}
+```
+
+### Fill
++
+Resize and crop the image to match the given dimensions. Both height and width are required.
+
+```go
- The filters will be applied in the given order.
++{{ $image := $resource.Fill "600x400" }}
+```
+
+### Filter
+
+Apply one or more filters to your image. See [Image Filters](/functions/images/#image-filters) for a full list.
+
+```go-html-template
+{{ $img = $img.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
+```
+
+The above can also be written in a more functional style using pipes:
+
+```go-html-template
+{{ $img = $img | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
+```
+
- Tags:
++The filters will be applied in the given order.
+
+Sometimes it can be useful to create the filter chain once and then reuse it:
+
+```go-html-template
+{{ $filters := slice (images.GaussianBlur 6) (images.Pixelate 8) }}
+{{ $img1 = $img1.Filter $filters }}
+{{ $img2 = $img2.Filter $filters }}
+```
+
+### Exif
+
+Provides an [Exif](https://en.wikipedia.org/wiki/Exif) object with metadata about the image.
+
+Note that this is only suported for JPEG and TIFF images, so it's recommended to wrap the access with a `with`, e.g.:
+
+```go-html-template
+{{ with $img.Exif }}
+Date: {{ .Date }}
+Lat/Long: {{ .Lat}}/{{ .Long }}
- {{ with $img.Exif }}
- Date: {{ .Date }}
- Lat/Long: {{ .Lat }}/{{ .Long }}
- Aperture: {{ .Tags.ApertureValue }}
- Focal Length: {{ .Tags.FocalLength }}
++Tags:
+{{ range $k, $v := .Tags }}
+TAG: {{ $k }}: {{ $v }}
+{{ end }}
+{{ end }}
+```
+
+Or individually access EXIF data with dot access, e.g.:
+
+```go-html-template
-
-
-
-
++{{ with $src.Exif }}
++ <ul>
++ {{ with .Date }}<li>Date: {{ .Format "January 02, 2006" }}</li>{{ end }}
++ {{ with .Tags.ApertureValue }}<li>Aperture: {{ lang.NumFmt 2 . }}</li>{{ end }}
++ {{ with .Tags.BrightnessValue }}<li>Brightness: {{ lang.NumFmt 2 . }}</li>{{ end }}
++ {{ with .Tags.ExposureTime }}<li>Exposure Time: {{ . }}</li>{{ end }}
++ {{ with .Tags.FNumber }}<li>F Number: {{ . }}</li>{{ end }}
++ {{ with .Tags.FocalLength }}<li>Focal Length: {{ . }}</li>{{ end }}
++ {{ with .Tags.ISOSpeedRatings }}<li>ISO Speed Ratings: {{ . }}</li>{{ end }}
++ {{ with .Tags.LensModel }}<li>Lens Model: {{ . }}</li>{{ end }}
++ </ul>
+{{ end }}
+```
+
++Some fields may need to be formatted with [`lang.NumFmt`]({{< relref "functions/numfmt" >}}) function to prevent display like `Aperture: 2.278934289` instead of `Aperture: 2.28`.
++
+#### Exif fields
+
+Date
+: "photo taken" date/time
+
+Lat
+: "photo taken where", GPS latitude
+
+Long
+: "photo taken where", GPS longitude
+
+See [Image Processing Config](#image-processing-config) for how to configure what gets included in Exif.
+
- ### Anchor
- Only relevant for the `Fill` method. This is useful for thumbnail generation where the main motive is located in, say, the left corner.
+## Image Processing Options
+
+In addition to the dimensions (e.g. `600x400`), Hugo supports a set of additional image options.
+
+### Background Color
+
+The background color to fill into the transparency layer. This is mostly useful when converting to a format that does not support transparency, e.g. `JPEG`.
+
+You can set the background color to use with a 3 or 6 digit hex code starting with `#`.
+
+```go
+{{ $image.Resize "600x jpg #b31280" }}
+```
+
+For color codes, see https://www.google.com/search?q=color+picker
+
+**Note** that you also set a default background color to use, see [Image Processing Config](#image-processing-config).
+
+### JPEG Quality
++
+Only relevant for JPEG images, values 1 to 100 inclusive, higher is better. Default is 75.
+
+```go
+{{ $image.Resize "600x q50" }}
+```
+
+### Rotate
++
+Rotates an image by the given angle counter-clockwise. The rotation will be performed first to get the dimensions correct. 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.
+
+```go
+{{ $image.Resize "600x r90" }}
+```
+
- Filter used in resizing. Default is `Box`, a simple and fast resampling filter appropriate for downscaling.
++### Anchor
++
++Only relevant for the `Fill` method. 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`.
+
+```go
+{{ $image.Fill "300x200 BottomLeft" }}
+```
+
+### Resample Filter
- See https://github.com/disintegration/imaging for more. If you want to trade quality for faster processing, this may be a option to test.
++
++Filter used in resizing. Default is `Box`, a simple and fast resampling filter appropriate for downscaling.
+
+Examples are: `Box`, `NearestNeighbor`, `Linear`, `Gaussian`.
+
-
++See https://github.com/disintegration/imaging for more. If you want to trade quality for faster processing, this may be a option to test.
+
+```go
+{{ $image.Resize "600x400 Gaussian" }}
+```
+
+### Target Format
+
+By default the images is encoded in the source format, but you can set the target format as an option.
+
+Valid values are `jpg`, `png`, `tif`, `bmp`, and `gif`.
+
+```go
+{{ $image.Resize "600x jpg" }}
+```
+
+## 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:
+
- {{< readfile file="layouts/shortcodes/imgproc.html" >}}
+{{< code file="layouts/shortcodes/imgproc.html" >}}
-
++{{< readfile file="layouts/shortcodes/imgproc.html" >}}
+{{< /code >}}
+
+And it is used like this:
+
+```go-html-template
+{{</* imgproc sunset Resize "300x" /*/>}}
+```
+
- # Default background color.
+{{% note %}}
+**Tip:** Note the self-closing shortcode syntax above. The `imgproc` shortcode can be called both with and without **inner content**.
+{{% /note %}}
+
+## 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"
+
+# Default JPEG quality setting. Default is 75.
+quality = 75
+
+# Anchor used when cropping pictures.
+# Default is "smart" which does Smart Cropping, using https://github.com/muesli/smartcrop
+# Smart Cropping is content aware and tries to find the best crop for each image.
+# Valid values are Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+anchor = "smart"
+
-
++# Default background color.
+# Hugo will preserve transparency for target formats that supports it,
+# but will fall back to this color for JPEG.
+# Expects a standard HEX color string with 3 or 6 digits.
+# See https://www.google.com/search?q=color+picker
+bgColor = "#ffffff"
+
+[imaging.exif]
+ # Regexp matching the fields you want to Exclude from the (massive) set of Exif info
+# available. As we cache this info to disk, this is for performance and
+# disk space reasons more than anything.
+# If you want it all, put ".*" in this config setting.
+# Note that if neither this or ExcludeFields is set, Hugo will return a small
+# default set.
+includeFields = ""
+
+# Regexp matching the Exif fields you want to exclude. This may be easier to use
+# than IncludeFields above, depending on what you want.
+excludeFields = ""
+
+# Hugo extracts the "photo taken" date/time into .Date by default.
+# Set this to true to turn it off.
+disableDate = false
+
+# Hugo extracts the "photo taken where" (GPS latitude and longitude) into
+# .Long and .Lat. Set this to true to turn it off.
+disableLatLong = false
+
+
+```
+
+## Smart Cropping of Images
+
+By default, Hugo will use the [Smartcrop](https://github.com/muesli/smartcrop), a library created by [muesli](https://github.com/muesli), when cropping images with `.Fill`. You can set the anchor point manually, but in most cases the smart option will make a good choice. And we will work with the library author to improve this in the future.
+
+An example using the sunset image from above:
+
-
+{{< imgproc sunset Fill "200x200 smart" />}}
+
- 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.
+## Image Processing Performance Consideration
+
+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 %}}
--- /dev/null
- Using `first` and [`where`][wherefunction] together can be very
+---
+title: where
+# linktitle: where
+description: Filters an array to only the elements containing a matching value for a given field.
+godocref:
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [filtering]
+signature: ["where COLLECTION KEY [OPERATOR] MATCH"]
+workson: [lists,taxonomies,terms,groups]
+hugoversion:
+relatedfuncs: [intersect,first,after,last]
+deprecated: false
+toc: true
+needsexample: true
+---
+
+`where` filters an array to only the elements containing a matching
+value for a given field.
+
+It works in a similar manner to the [`where` keyword in
+SQL][wherekeyword].
+
+```go-html-template
+{{ range where .Pages "Section" "foo" }}
+ {{ .Content }}
+{{ end }}
+```
+
+It can be used by dot-chaining the second argument to refer to a nested element of a value.
+
+```
++++
+series: golang
++++
+```
+
+```go-html-template
+{{ range where .Site.Pages "Params.series" "golang" }}
+ {{ .Content }}
+{{ end }}
+```
+
+It can also be used with the logical operators `!=`, `>=`, `in`, etc. Without an operator, `where` compares a given field with a matching value equivalent to `=`.
+
+```go-html-template
+{{ range where .Pages "Section" "!=" "foo" }}
+ {{ .Content }}
+{{ end }}
+```
+
+The following logical operators are available with `where`:
+
+`=`, `==`, `eq`
+: `true` if a given field value equals a matching value
+
+`!=`, `<>`, `ne`
+: `true` if a given field value doesn't equal a matching value
+
+`>=`, `ge`
+: `true` if a given field value is greater than or equal to a matching value
+
+`>`, `gt`
+: `true` if a given field value is greater than a matching value
+
+`<=`, `le`
+: `true` if a given field value is lesser than or equal to a matching value
+
+`<`, `lt`
+: `true` if a given field value is lesser than a matching value
+
+`in`
+: `true` if a given field value is included in a matching value; a matching value must be an array or a slice
+
+`not in`
+: `true` if a given field value isn't included in a matching value; a matching value must be an array or a slice
+
+`intersect`
+: `true` if a given field value that is a slice/array of strings or integers contains elements in common with the matching value; it follows the same rules as the [`intersect` function][intersect].
+
+## Use `where` with `Booleans`
+When using booleans you should not put quotation marks.
+```go-html-template
+{{range where .Pages ".Draft" true}}
+ <p>{{.Title}}</p>
+{{end}}
+```
+
+
+## Use `where` with `intersect`
+
+```go-html-template
+{{ range where .Site.Pages ".Params.tags" "intersect" .Params.tags }}
+ {{ if ne .Permalink $.Permalink }}
+ {{ .Render "summary" }}
+ {{ end }}
+{{ end }}
+```
+
+You can also put the returned value of the `where` clauses into a variable:
+
+{{< code file="where-intersect-variables.html" >}}
+{{ $v1 := where .Site.Pages "Params.a" "v1" }}
+{{ $v2 := where .Site.Pages "Params.b" "v2" }}
+{{ $filtered := $v1 | intersect $v2 }}
+{{ range $filtered }}
+{{ end }}
+{{< /code >}}
+
+## Use `where` with `first`
+
++Using `first` and `where` together can be very
+powerful. Below snippet gets a list of posts only from [**main
+sections**](#mainsections), sorts it using the [default
+ordering](/templates/lists/) for lists (i.e., `weight => date`), and
+then ranges through only the first 5 posts in that list:
+
+{{< code file="first-and-where-together.html" >}}
+{{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections) }}
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
+## Nest `where` Clauses
+
+You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
+
+```go-html-template
+{{ range where (where .Pages "Section" "blog" ) ".Params.featured" "!=" true }}
+```
+
+## Unset Fields
+
+Filtering only works for set fields. To check whether a field is set or exists, you can use the operand `nil`.
+
+This can be useful to filter a small amount of pages from a large pool. Instead of set field on all pages, you can set field on required pages only.
+
+Only the following operators are available for `nil`
+
+* `=`, `==`, `eq`: True if the given field is not set.
+* `!=`, `<>`, `ne`: True if the given field is set.
+
+```go-html-template
+{{ range where .Pages ".Params.specialpost" "!=" nil }}
+ {{ .Content }}
+{{ end }}
+```
+
+## Portable `where` filters -- `site.Params.mainSections` {#mainsections}
+
+**This is especially important for themes.**
+
+To list the most relevant pages on the front page or similar, you
+should use the `site.Params.mainSections` list instead of comparing
+section names to hard-coded values like `"posts"` or `"post"`.
+
+```go-html-template
+{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+```
+
+If the user has not set this config parameter in their site config, it
+will default to the _section with the most pages_.
+
+The user can override the default in `config.toml`:
+
+```toml
+[params]
+ mainSections = ["blog", "docs"]
+```
+
+[intersect]: /functions/intersect/
+[wherekeyword]: https://www.techonthenet.com/sql/where.php
--- /dev/null
- You can override any of these cache setting in your own `config.toml`.
+---
+title: Configure Hugo
+linktitle: Configuration
+description: How to configure your Hugo site.
+date: 2013-07-01
+publishdate: 2017-01-02
+lastmod: 2017-03-05
+categories: [getting started,fundamentals]
+keywords: [configuration,toml,yaml,json]
+menu:
+ docs:
+ parent: "getting-started"
+ weight: 60
+weight: 60
+sections_weight: 60
+draft: false
+aliases: [/overview/source-directory/,/overview/configuration/]
+toc: true
+---
+
+
+## Configuration File
+
+Hugo uses the `config.toml`, `config.yaml`, or `config.json` (if found in the
+site root) as the default site config file.
+
+The user can choose to override that default with one or more site config files
+using the command line `--config` switch.
+
+Examples:
+
+```
+hugo --config debugconfig.toml
+hugo --config a.toml,b.toml,c.toml
+```
+
+{{% note %}}
+Multiple site config files can be specified as a comma-separated string to the `--config` switch.
+{{% /note %}}
+
+{{< todo >}}TODO: distinct config.toml and others (the root object files){{< /todo >}}
+
+## Configuration Directory
+
+In addition to using a single site config file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings.
+
+- Each file represents a configuration root object, such as `Params`, `Menus`, `Languages` etc...
+- Each directory holds a group of files containing settings unique to an environment.
+- Files can be localized to become language specific.
+
+
+```
+├── config
+│ ├── _default
+│ │ ├── config.toml
+│ │ ├── languages.toml
+│ │ ├── menus.en.toml
+│ │ ├── menus.zh.toml
+│ │ └── params.toml
+│ ├── production
+│ │ ├── config.toml
+│ │ └── params.toml
+│ └── staging
+│ ├── config.toml
+│ └── params.toml
+```
+
+Considering the structure above, when running `hugo --environment staging`, Hugo will use every settings from `config/_default` and merge `staging`'s on top of those.
+{{% note %}}
+Default environments are __development__ with `hugo serve` and __production__ with `hugo`.
+{{%/ note %}}
+## All Configuration Settings
+
+The following is the full list of Hugo-defined variables with their default
+value in parentheses. Users may choose to override those values in their site
+config file(s).
+
+archetypeDir ("archetypes")
+: The directory where Hugo finds archetype files (content templates). {{% module-mounts-note %}}
+
+assetDir ("assets")
+: The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). {{% module-mounts-note %}}
+
+baseURL
+: Hostname (and path) to the root, e.g. https://bep.is/
+
+blackfriday
+: See [Configure Blackfriday](/getting-started/configuration-markup#blackfriday)
+
+build
+: See [Configure Build](#configure-build)
+
+buildDrafts (false)
+: Include drafts when building.
+
+buildExpired (false)
+: Include content already expired.
+
+buildFuture (false)
+: Include content with publishdate in the future.
+
+caches
+: See [Configure File Caches](#configure-file-caches)
+
+canonifyURLs (false)
+: Enable to turn relative URLs into absolute.
+
+contentDir ("content")
+: The directory from where Hugo reads content files. {{% module-mounts-note %}}
+
+dataDir ("data")
+: The directory from where Hugo reads data files. {{% module-mounts-note %}}
+
+defaultContentLanguage ("en")
+: Content without language indicator will default to this language.
+
+defaultContentLanguageInSubdir (false)
+: Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`.
+
+disableAliases (false)
+: Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htaccess`, a Netlify `_redirects` file or similar using a custom output format.
+
+disableHugoGeneratorInject (false)
+: Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise.
+
+disableKinds ([])
+: Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"taxonomyTerm"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`.
+
+disableLiveReload (false)
+: Disable automatic live reloading of browser window.
+
+disablePathToLower (false)
+: Do not convert the url/path to lowercase.
+
+enableEmoji (false)
+: Enable Emoji emoticons support for page content; see the [Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet/).
+
+enableGitInfo (false)
+: Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file.
+
+enableInlineShortcodes (false)
+: Enable inline shortcode support. See [Inline Shortcodes](/templates/shortcode-templates/#inline-shortcodes).
+
+enableMissingTranslationPlaceholders (false)
+: Show a placeholder instead of the default value or an empty string if a translation is missing.
+
+enableRobotsTXT (false)
+: Enable generation of `robots.txt` file.
+
+frontmatter
+
+: See [Front matter Configuration](#configure-front-matter).
+
+footnoteAnchorPrefix ("")
+: Prefix for footnote anchors.
+
+footnoteReturnLinkContents ("")
+: Text to display for footnote return links.
+
+googleAnalytics ("")
+: Google Analytics tracking ID.
+
+hasCJKLanguage (false)
+: If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages.
+
+imaging
+: See [Image Processing Config](/content-management/image-processing/#image-processing-config).
+
+languages
+: See [Configure Languages](/content-management/multilingual/#configure-languages).
+
+languageCode ("")
+: The site's language code. It is used in the default [RSS template](/templates/rss/#configure-rss) and can be useful for [multi-lingual sites](/content-management/multilingual/#configure-multilingual-multihost).
+
+languageName ("")
+: The site's language name.
+
+disableLanguages
+: See [Disable a Language](/content-management/multilingual/#disable-a-language)
+
+layoutDir ("layouts")
+: The directory from where Hugo reads layouts (templates).
+
+log (false)
+: Enable logging.
+
+logFile ("")
+: Log File path (if set, logging enabled automatically).
+
+markup
+: See [Configure Markup](/getting-started/configuration-markup).{{< new-in "0.60.0" >}}
+
+menu
+: See [Add Non-content Entries to a Menu](/content-management/menus/#add-non-content-entries-to-a-menu).
+
+minify
+: See [Configure Minify](#configure-minify)
+
+module
+: Module config see [Module Config](/hugo-modules/configuration/).{{< new-in "0.56.0" >}}
+
+newContentEditor ("")
+: The editor to use when creating new content.
+
+noChmod (false)
+: Don't sync permission mode of files.
+
+noTimes (false)
+: Don't sync modification time of files.
+
+paginate (10)
+: Default number of elements per page in [pagination](/templates/pagination/).
+
+paginatePath ("page")
+: The path element used during pagination (https://example.com/page/2).
+
+permalinks
+: See [Content Management](/content-management/urls/#permalinks).
+
+pluralizeListTitles (true)
+: Pluralize titles in lists.
+
+publishDir ("public")
+: The directory to where Hugo will write the final static site (the HTML files etc.).
+
+related
+: See [Related Content](/content-management/related/#configure-related-content).{{< new-in "0.27" >}}
+
+relativeURLs (false)
+: Enable this to make all relative URLs relative to content root. Note that this does not affect absolute URLs.
+
+refLinksErrorLevel ("ERROR")
+: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this logg level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
+
+refLinksNotFoundURL
+: URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
+
+rssLimit (unlimited)
+: Maximum number of items in the RSS feed.
+
+sectionPagesMenu ("")
+: See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers).
+
+sitemap
+: Default [sitemap configuration](/templates/sitemap-template/#configure-sitemap-xml).
+
+staticDir ("static")
+: A directory or a list of directories from where Hugo reads [static files][static-files]. {{% module-mounts-note %}}
+
+summaryLength (70)
+: The length of text in words to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting).
+
+taxonomies
+: See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
+
+theme ("")
+: Theme to use (located by default in `/themes/THEMENAME/`).
+
+themesDir ("themes")
+: The directory where Hugo reads the themes from.
+
+timeout (10000)
+: Timeout for generating page contents, in milliseconds (defaults to 10 seconds). *Note:* this is used to bail out of recursive content generation, if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents) you might need to raise this limit.
+
+title ("")
+: Site title.
+
+titleCaseStyle ("AP")
+: See [Configure Title Case](#configure-title-case)
+
+uglyURLs (false)
+: When enabled, creates URL of the form `/filename.html` instead of `/filename/`.
+
+verbose (false)
+: Enable verbose output.
+
+verboseLog (false)
+: Enable verbose logging.
+
+watch (false)
+: Watch filesystem for changes and recreate as needed.
+
+{{% note %}}
+If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line:
+```
+cd ~/sites/yourhugosite
+hugo config | grep emoji
+```
+
+which shows output like
+
+```
+enableemoji: true
+```
+{{% /note %}}
+
+## Configure Build
+
+{{< new-in "0.66.0" >}}
+
+The `build` configuration section contains global build-realated configuration options.
+
+{{< code-toggle file="config">}}
+[build]
+useResourceCacheWhen="fallback"
+{{< /code-toggle >}}
+
+
+useResourceCacheWhen
+: When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
+
+## Configure Server
+
+{{< new-in "0.67.0" >}}
+
+This is only relevant when running `hugo server`, and it allows to set HTTP headers during development, which allows you to test out your Content Security Policy and similar. The configuration format matches [Netlify's](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) with slighly more powerful [Glob matching](https://github.com/gobwas/glob):
+
+
+{{< code-toggle file="config">}}
+[server]
+[[server.headers]]
+for = "/**.html"
+
+[server.headers.values]
+X-Frame-Options = "DENY"
+X-XSS-Protection = "1; mode=block"
+X-Content-Type-Options = "nosniff"
+Referrer-Policy = "strict-origin-when-cross-origin"
+Content-Security-Policy = "script-src localhost:1313"
+{{< /code-toggle >}}
+
+Since this is is "devlopment only", it may make sense to put it below the `development` environment:
+
+
+{{< code-toggle file="config/development/server">}}
+[[headers]]
+for = "/**.html"
+
+[headers.values]
+X-Frame-Options = "DENY"
+X-XSS-Protection = "1; mode=block"
+X-Content-Type-Options = "nosniff"
+Referrer-Policy = "strict-origin-when-cross-origin"
+Content-Security-Policy = "script-src localhost:1313"
+{{< /code-toggle >}}
+
+
+
+
+## Configure Title Case
+
+Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter).
+
+## Configuration Environment Variables
+
+HUGO_NUMWORKERMULTIPLIER
+: Can be set to increase or reduce the number of workers used in parallel processing in Hugo. If not set, the number of logical CPUs will be used.
+
+## Configuration Lookup Order
+
+Similar to the template [lookup order][], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior:
+
+1. `./config.toml`
+2. `./config.yaml`
+3. `./config.json`
+
+In your `config` file, you can direct Hugo as to how you want your website rendered, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
+
+
+## Example Configuration
+
+The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]:
+
+{{< code-toggle file="config">}}
+baseURL: "https://yoursite.example.com/"
+title: "My Hugo Site"
+footnoteReturnLinkContents: "↩"
+permalinks:
+ posts: /:year/:month/:title/
+params:
+ Subtitle: "Hugo is Absurdly Fast!"
+ AuthorName: "Jon Doe"
+ GitHubUser: "spf13"
+ ListOfFoo:
+ - "foo1"
+ - "foo2"
+ SidebarRecentLimit: 5
+{{< /code-toggle >}}
+
+## Configure with Environment Variables
+
+In addition to the 3 config options already mentioned, configuration key-values can be defined through operating system environment variables.
+
+For example, the following command will effectively set a website's title on Unix-like systems:
+
+```
+$ env HUGO_TITLE="Some Title" hugo
+```
+
+This is really useful if you use a service such as Netlify to deploy your site. Look at the Hugo docs [Netlify configuration file](https://github.com/gohugoio/hugoDocs/blob/master/netlify.toml) for an example.
+
+{{% note "Setting Environment Variables" %}}
+Names must be prefixed with `HUGO_` and the configuration key must be set in uppercase when setting operating system environment variables.
+
+To set config params, prefix the name with `HUGO_PARAMS_`
+{{% /note %}}
+
+{{< todo >}}
+Test and document setting params via JSON env var.
+{{< /todo >}}
+
+## Ignore Content Files When Rendering
+
+The following statement inside `./config.toml` will cause Hugo to ignore content files ending with `.foo` and `.boo` when rendering:
+
+```
+ignoreFiles = [ "\\.foo$", "\\.boo$" ]
+```
+
+The above is a list of regular expressions. Note that the backslash (`\`) character is escaped in this example to keep TOML happy.
+
+## Configure Front Matter
+
+### Configure Dates
+
+Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `config.toml`.
+
+
+The default configuration is:
+
+```toml
+[frontmatter]
+date = ["date", "publishDate", "lastmod"]
+lastmod = [":git", "lastmod", "date", "publishDate"]
+publishDate = ["publishDate", "date"]
+expiryDate = ["expiryDate"]
+```
+
+If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
+
+ ```toml
+[frontmatter]
+date = ["myDate", ":default"]
+```
+
+The `:default` is a shortcut to the default settings. The above will set `.Date` to the date value in `myDate` if present, if not we will look in `date`,`publishDate`, `lastmod` and pick the first valid date.
+
+In the list to the right, values starting with ":" are date handlers with a special meaning (see below). The others are just names of date parameters (case insensitive) in your front matter configuration. Also note that Hugo have some built-in aliases to the above: `lastmod` => `modified`, `publishDate` => `pubdate`, `published` and `expiryDate` => `unpublishdate`. With that, as an example, using `pubDate` as a date in front matter, will, by default, be assigned to `.PublishDate`.
+
+The special date handlers are:
+
+
+`:fileModTime`
+: Fetches the date from the content file's last modification timestamp.
+
+An example:
+
+ ```toml
+[frontmatter]
+lastmod = ["lastmod", ":fileModTime", ":default"]
+```
+
+
+The above will try first to extract the value for `.Lastmod` starting with the `lastmod` front matter parameter, then the content file's modification timestamp. The last, `:default` should not be needed here, but Hugo will finally look for a valid date in `:git`, `date` and then `publishDate`.
+
+
+`:filename`
+: Fetches the date from the content file's filename. For example, `2018-02-22-mypage.md` will extract the date `2018-02-22`. Also, if `slug` is not set, `mypage` will be used as the value for `.Slug`.
+
+An example:
+
+```toml
+[frontmatter]
+date = [":filename", ":default"]
+```
+
+The above will try first to extract the value for `.Date` from the filename, then it will look in front matter parameters `date`, `publishDate` and lastly `lastmod`.
+
+
+`:git`
+: This is the Git author date for the last revision of this content file. This will only be set if `--enableGitInfo` is set or `enableGitInfo = true` is set in site config.
+
+## Configure Additional Output Formats
+
+Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats][] for information on how to add these values to your Hugo project's configuration file.
+
+## Configure Minify
+
+{{< new-in "0.68.0" >}}
+
+Default configuration:
+
+{{< code-toggle config="minify" />}}
+
+## Configure File Caches
+
+Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
+
+```toml
+[caches]
+[caches.getjson]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.getcsv]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.images]
+dir = ":resourceDir/_gen"
+maxAge = -1
+[caches.assets]
+dir = ":resourceDir/_gen"
+maxAge = -1
+[caches.modules]
+dir = ":cacheDir/modules"
+maxAge = -1
+```
+
++You can override any of these cache settings in your own `config.toml`.
+
+### The keywords explained
+
+`:cacheDir`
+: This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml).
+
+`:project`
+: The base directory name of the current Hugo project. This means that, in its default setting, every project will have separated file caches, which means that when you do `hugo --gc` you will not touch files related to other Hugo projects running on the same PC.
+
+`:resourceDir`
+: This is the value of the `resourceDir` config option.
+
+maxAge
+: This is the duration before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. Uses Go's `time.Duration`, so valid values are `"10s"` (10 seconds), `"10m"` (10 minutes) and `"10h"` (10 hours).
+
+dir
+: The absolute path to where the files for this cache will be stored. Allowed starting placeholders are `:cacheDir` and `:resourceDir` (see above).
+
+## Configuration Format Specs
+
+* [TOML Spec][toml]
+* [YAML Spec][yaml]
+* [JSON Spec][json]
+
+[`.Site.Params`]: /variables/site/
+[directory structure]: /getting-started/directory-structure
+[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
+[lookup order]: /templates/lookup-order/
+[Output Formats]: /templates/output-formats/
+[templates]: /templates/
+[toml]: https://github.com/toml-lang/toml
+[yaml]: https://yaml.org/spec/
+[static-files]: /content-management/static-files/
--- /dev/null
+---
+title: Directory Structure
+linktitle: Directory Structure
+description: Hugo's CLI scaffolds a project directory structure and then takes that single directory and uses it as the input to create a complete website.
+date: 2017-01-02
+publishdate: 2017-02-01
+lastmod: 2017-03-09
+categories: [getting started,fundamentals]
+keywords: [source, organization, directories]
+menu:
+ docs:
+ parent: "getting-started"
+ weight: 50
+weight: 50
+sections_weight: 50
+draft: false
+aliases: [/overview/source-directory/]
+toc: true
+---
+
+## New Site Scaffolding
+
+{{< youtube sB0HLHjgQ7E >}}
+
+Running the `hugo new site` generator from the command line will create a directory structure with the following elements:
+
+```
+.
+├── archetypes
+├── config.toml
+├── content
+├── data
+├── layouts
+├── static
+└── themes
+```
+
+
+## Directory Structure Explained
+
+The following is a high-level overview of each of the directories with links to each of their respective sections within the Hugo docs.
+
+[`archetypes`](/content-management/archetypes/)
+: You can create new content files in Hugo using the `hugo new` command.
+By default, Hugo will create new content files with at least `date`, `title` (inferred from the file name), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well.
+
+[`assets`][]
+: Stores all the files which need be processed by [Hugo Pipes]({{< ref "/hugo-pipes" >}}). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory. Note: assets directory is not created by default.
+
+[`config`](/getting-started/configuration/)
+: Hugo ships with a large number of [configuration directives](https://gohugo.io/getting-started/configuration/#all-variables-yaml).
+The [config directory](/getting-started/configuration/#configuration-directory) is where those directives are stored as JSON, YAML, or TOML files. Every root setting object can stand as its own file and structured by environments.
+Projects with minimal settings and no need for environment awareness can use a single `config.toml` file at its root.
+
+Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives][] for more granular directions on how you want Hugo to build your website. Note: config directory is not created by default.
+
+[`content`][]
+: All content for your website will live inside this directory. Each top-level folder in Hugo is considered a [content section][]. For example, if your site has three main sections---`blog`, `articles`, and `tutorials`---you will have three directories at `content/blog`, `content/articles`, and `content/tutorials`. Hugo uses sections to assign default [content types][].
+
+[`data`](/templates/data-templates/)
+: This directory is used to store configuration files that can be
+used by Hugo when generating your website. You can write these files in YAML, JSON, or TOML format. In addition to the files you add to this folder, you can also create [data templates][] that pull from dynamic content.
+
+[`layouts`][]
+: Stores templates in the form of `.html` files that specify how views of your content will be rendered into a static website. Templates include [list pages][lists], your [homepage][], [taxonomy templates][], [partials][], [single page templates][singles], and more.
+
+[`static`][]
+: Stores all the static content: images, CSS, JavaScript, etc. When Hugo builds your site, all assets inside your static directory are copied over as-is. A good example of using the `static` folder is for [verifying site ownership on Google Search Console][searchconsole], where you want Hugo to copy over a complete HTML file without modifying its content.
+
+{{% note %}}
+From **Hugo 0.31** you can have multiple static directories.
+{{% /note %}}
+
++resources
++: Caches some files to speed up generation. Can be also used by template authors to distribute built SASS files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default.
++
+
+[archetypes]: /content-management/archetypes/
+[configuration directives]: /getting-started/configuration/#all-variables-yaml
+[`content`]: /content-management/organization/
+[content section]: /content-management/sections/
+[content types]: /content-management/types/
+[data templates]: /templates/data-templates/
+[homepage]: /templates/homepage/
+[`layouts`]: /templates/
+[`static`]: /content-management/static-files/
+[lists]: /templates/list/
+[pagevars]: /variables/page/
+[partials]: /templates/partials/
+[searchconsole]: https://support.google.com/analytics/answer/1142414?hl=en
+[singles]: /templates/single-page-templates/
+[starters]: /tools/starter-kits/
+[taxonomies]: /content-management/taxonomies/
+[taxonomy templates]: /templates/taxonomy-templates/
+[types]: /content-management/types/
+[`assets`]: {{< ref "/hugo-pipes/introduction#asset-directory" >}}
--- /dev/null
- title: "0.68.0"
- description: "0.68.0"
+
+---
+date: 2020-03-21
++title: "Minify config and more!"
++description: "Hugo 0.68.0 brings minify configuration and fully navigable headless sections."
+categories: ["Releases"]
+---
+
+
+This release (finally) brings minify configuration, a big thanks to [@satotake](https://github.com/satotake) for that contribution. See [Configure Minify](https://gohugo.io/getting-started/configuration/#configure-minify) for details.
+
+We have also extended the [Page Build Options](https://gohugo.io/content-management/build-options/) to allow fully navigable headless sections.
+
+This release represents **17 contributions by 6 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 [@evankanderson](https://github.com/evankanderson), [@QuLogic](https://github.com/QuLogic), and [@le0tan](https://github.com/le0tan) for their ongoing contributions.
+
+And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@davidsneighbour](https://github.com/davidsneighbour) and [@kaushalmodi](https://github.com/kaushalmodi) for all the great work on the documentation site.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
+which has received **3 contributions by 3 contributors**.
+
+Hugo now has:
+
+* 42462+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 439+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 300+ [themes](http://themes.gohugo.io/)
+
+## Enhancements
+
+### Other
+
+* Some minify configuration adjustments [7204b354](https://github.com/gohugoio/hugo/commit/7204b354a9f46778f068a4712447d6d4fefbefd8) [@bep](https://github.com/bep)
+* Add minify config [574c2959](https://github.com/gohugoio/hugo/commit/574c2959b8d3338764fa1db102a5e0fd6ed322d9) [@satotake](https://github.com/satotake) [#6750](https://github.com/gohugoio/hugo/issues/6750)[#6892](https://github.com/gohugoio/hugo/issues/6892)
+* Allow headless bundles to list pages via $page.Pages and $page.RegularPages [99958f90](https://github.com/gohugoio/hugo/commit/99958f90fedec11d749a1397300860aa8e8459c2) [@bep](https://github.com/bep) [#7075](https://github.com/gohugoio/hugo/issues/7075)
+* Update to Go 1.14.1 and 1.13.9 [1d91d8e1](https://github.com/gohugoio/hugo/commit/1d91d8e14b13bd135dc4d4a901fc936c9649b219) [@bep](https://github.com/bep) [#7078](https://github.com/gohugoio/hugo/issues/7078)
+* Pass directory name to filters in LstatIfPossible in the same way as Readdir [cc2a5d52](https://github.com/gohugoio/hugo/commit/cc2a5d52a4ad188d93aeb2d51d5c19c7661e098d) [@evankanderson](https://github.com/evankanderson)
+* Update to goldmark 1.1.25. [52c159c4](https://github.com/gohugoio/hugo/commit/52c159c452ab7f48369b5cc9ecc57ecc8dc91654) [@QuLogic](https://github.com/QuLogic)
+* Add workaround for regular CSS imports in SCSS [1a8af7d4](https://github.com/gohugoio/hugo/commit/1a8af7d4f087256710ae0bdf504ed53c0c24a211) [@bep](https://github.com/bep) [#7059](https://github.com/gohugoio/hugo/issues/7059)
+* Add .RegularPagesRecursive [03b93bb9](https://github.com/gohugoio/hugo/commit/03b93bb9884ea479c855c2699e8c7b039dce6224) [@bep](https://github.com/bep) [#6411](https://github.com/gohugoio/hugo/issues/6411)
+* Add data context to the key in ExecuteAsTemplate [18cb21ff](https://github.com/gohugoio/hugo/commit/18cb21ff2e4a60e7094908e4d6113a9d5a086316) [@bep](https://github.com/bep) [#7046](https://github.com/gohugoio/hugo/issues/7046)
+* Improve Tailwind/PostCSS error messages [df298558](https://github.com/gohugoio/hugo/commit/df298558a5a5b747288d9656402af85e0ac75a43) [@bep](https://github.com/bep) [#7041](https://github.com/gohugoio/hugo/issues/7041)[#7042](https://github.com/gohugoio/hugo/issues/7042)
+* Update Blackfriday [b1106f87](https://github.com/gohugoio/hugo/commit/b1106f8715cac3544b8ea662b969336fe56fa047) [@bep](https://github.com/bep) [#7039](https://github.com/gohugoio/hugo/issues/7039)
+* Add languageDirection to language configuration [5914f91b](https://github.com/gohugoio/hugo/commit/5914f91b6c980e42693661d5fd5640e237691df6) [@le0tan](https://github.com/le0tan) [#6550](https://github.com/gohugoio/hugo/issues/6550)
+
+## Fixes
+
+### Other
+
+* Fix Go build version [2ebb9f54](https://github.com/gohugoio/hugo/commit/2ebb9f5484162062c74698237bcdaa31cb8666b9) [@bep](https://github.com/bep)
+* Fix GetTerms nil pointer [95f49211](https://github.com/gohugoio/hugo/commit/95f492114e33fc6e4d9dcfd2b7c1eca5c50d755f) [@carlmjohnson](https://github.com/carlmjohnson) [#7061](https://github.com/gohugoio/hugo/issues/7061)
+* Fix scss vs css import regexp [c7b6d74e](https://github.com/gohugoio/hugo/commit/c7b6d74e898c78da9f5e272e528ff9654206576e) [@bep](https://github.com/bep) [#7063](https://github.com/gohugoio/hugo/issues/7063)
+* Fix --templateMetricsHints [5eadc4c0](https://github.com/gohugoio/hugo/commit/5eadc4c0a8e5c51e72670591c4b7877e79c15e3c) [@bep](https://github.com/bep) [#7048](https://github.com/gohugoio/hugo/issues/7048)
+* Try to fix a Go 1.15 go vet error [c0177fe2](https://github.com/gohugoio/hugo/commit/c0177fe2b28eb09d1534e62370849c3f1d70b40f) [@bep](https://github.com/bep)
+
+
+
+
+
--- /dev/null
- title: "Hugo 0.68.1: A couple of Bug Fixes"
- description: "This version fixes a couple of bugs introduced in 0.68.0."
+
+---
+date: 2020-03-22
++title: "Hugo 0.68.1: 1 bug fix"
++description: "This release reverts a change in resources.ExecuteAsTemplate that broke some theme demos."
+categories: ["Releases"]
+images:
+- images/blog/hugo-bug-poster.png
+
+---
+
+
+
+This is a bug-fix release with one important fix.
+
+* Revert "resources: Add data context to the key in ExecuteAsTemplate" [c9dc316a](https://github.com/gohugoio/hugo/commit/c9dc316ad160e78c9dff4e75313db4cac8ea6414) [@bep](https://github.com/bep) [#7064](https://github.com/gohugoio/hugo/issues/7064)
+
+
+
--- /dev/null
- date: 2020-03-24
+
+---
++date: 2020-03-24T12:00:00-05:00
+title: "Hugo 0.68.2: A couple of Bug Fixes"
+description: "This version fixes a couple of bugs introduced in 0.68.0."
+categories: ["Releases"]
+images:
+- images/blog/hugo-bug-poster.png
+
+---
+
+
+
+This is a bug-fix release with one important fix.
+
+* Fix cache reset for a page's collections on server live reload [cfa73050](https://github.com/gohugoio/hugo/commit/cfa73050a49b2646fe3557cefa0ed31989b0eeeb) [@bep](https://github.com/bep) [#7085](https://github.com/gohugoio/hugo/issues/7085)
+
+
+
--- /dev/null
- date: 2020-03-24
+
+---
++date: 2020-03-24T13:00:00-05:00
+title: "Hugo 0.68.3: A couple of Bug Fixes"
+description: "This version fixes a couple of bugs introduced in 0.68.0."
+categories: ["Releases"]
+images:
+- images/blog/hugo-bug-poster.png
+
+---
+
+
+
+This is a bug-fix release with one important fix.
+
+* Fix _build.list.local logic [523d5194](https://github.com/gohugoio/hugo/commit/523d51948fc20e2afb4721b43203c5ab696ae220) [@bep](https://github.com/bep) [#7089](https://github.com/gohugoio/hugo/issues/7089)
+
+
+
--- /dev/null
- require github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051 // indirect
+module github.com/gohugoio/hugoDocs
+
+go 1.12
+
++require github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee // indirect
--- /dev/null
+github.com/gohugoio/gohugoioTheme v0.0.0-20190808163145-07b3c0f73b02/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191014144142-1f3a01deed7b h1:PWNjl46fvtz54PKO0BdiXOF6/4L/uCP0F3gtcCxGrJs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191014144142-1f3a01deed7b/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d h1:D3DcaYkuJbotdWNNAQpQl37txX4HQ6R5uMHoxVmTw0w=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123151337-9475fd449324 h1:UZwHDYtGY0uOKIvcm2LWd+xfFxD3X5L222LIJdI5RE4=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123151337-9475fd449324/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123204146-589b4c309025 h1:ScYFARz+bHX1rEr1donVknhRdxGY/cwqK1hHvWEfrlc=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123204146-589b4c309025/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123205007-5d6620a0db26 h1:acXfduibbWxji9tW0WkLHbjcXFsnd5uIwXe0WfwOazg=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123205007-5d6620a0db26/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051 h1:cS14MnUGS6xwWYfPNshimm8HdMCZiYBxWkCD0VnvgVw=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
++github.com/gohugoio/gohugoioTheme v0.0.0-20200327225449-368f4cbef8d7 h1:cZ+ahAjSetbFv3aDJ9ipDbKyqaVlmkbSZ5cULgBTh+w=
++github.com/gohugoio/gohugoioTheme v0.0.0-20200327225449-368f4cbef8d7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
++github.com/gohugoio/gohugoioTheme v0.0.0-20200327231942-7f80b3d02bfa h1:kG+O/wT9UXomzp5eQiUuFVZ0l7YylAW6EVPLyjMxi/c=
++github.com/gohugoio/gohugoioTheme v0.0.0-20200327231942-7f80b3d02bfa/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
++github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee h1:PJZhCwnuVLyafDWNPSHk9iJvk6gEIvPRnycy7Pq3peA=
++github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
--- /dev/null
- HUGO_VERSION = "0.67.1"
+[build]
+publish = "public"
+command = "hugo --gc --minify"
+
+[context.production.environment]
- HUGO_VERSION = "0.67.1"
++HUGO_VERSION = "0.68.3"
+HUGO_ENV = "production"
+HUGO_ENABLEGITINFO = "true"
+
+[context.split1]
+command = "hugo --gc --minify --enableGitInfo"
+
+[context.split1.environment]
- HUGO_VERSION = "0.67.1"
++HUGO_VERSION = "0.68.3"
+HUGO_ENV = "production"
+
+[context.deploy-preview]
+command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
+
+[context.deploy-preview.environment]
- HUGO_VERSION = "0.67.1"
++HUGO_VERSION = "0.68.3"
+
+[context.branch-deploy]
+command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
+
+[context.branch-deploy.environment]
++HUGO_VERSION = "0.68.3"
+
+[context.next.environment]
+HUGO_ENABLEGITINFO = "true"
+