--- /dev/null
- 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.
+---
+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 print all images paths in a [Page Bundle]({{< relref "/content-management/organization#page-bundles" >}}):
+
+```go-html-template
+{{ with .Resources.ByType "image" }}
+{{ range . }}
+{{ .RelPermalink }}
+{{ end }}
+{{ end }}
+
+```
+
+## The Image Resource
+
+The `image` resource can also be retrieved from a [global resource]({{< relref "/hugo-pipes/introduction#from-file-to-resource" >}})
+
+{{- $image := resources.Get "images/logo.jpg" -}}
+
+## Image Processing Methods
+
+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 "600x" }}
+
+// Resize to a height of 400px and preserve ratio
+{{ $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.Fit "600x400" }}
+```
+
+### Fill
+
+Resize and crop the image to match the given dimensions. Both height and width are required.
+
+```go
+{{ $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) }}
+```
+
+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 supported 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 }}
+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.
+
+## 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" }}
+```
+
+### 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 values are `Smart`, `Center`, `TopLeft`, `Top`, `TopRight`, `Left`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`.
+
+Default value is `Smart`, which uses [Smartcrop](https://github.com/muesli/smartcrop) to determine the best crop.
+
+```go
+{{ $image.Fill "300x200 BottomLeft" }}
+```
+
+### Resample Filter
+
+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:
+
+{{< 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" /*/>}}
+```
+
+{{% 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 [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" />}}
+
+## 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
- - Leaf Bundle (leaf means it has no children)
- - Branch Bundle (home page, section, taxonomy terms, taxonomy list)
+---
+title : "Page Bundles"
+description : "Content organization using Page Bundles"
+date : 2018-01-24T13:09:00-05:00
+lastmod : 2018-01-28T22:26:40-05:00
+linktitle : "Page Bundles"
+keywords : ["page", "bundle", "leaf", "branch"]
+categories : ["content management"]
+toc : true
+menu :
+ docs:
+ identifier : "page-bundles"
+ parent : "content-management"
+ weight : 11
+---
+
+Page Bundles are a way to group [Page Resources](/content-management/page-resources/).
+
+A Page Bundle can be one of:
+
++- Leaf Bundle (leaf means it has no children)
++- Branch Bundle (home page, section, taxonomy terms, taxonomy list)
+
+| | Leaf Bundle | Branch Bundle |
+|-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
+| Index file name | `index.md` [^fn:1] | `_index.md` [^fn:1] |
+| Allowed Resources | Page and non-page (like images, pdf, etc.) types | Only non-page (like images, pdf, etc.) types |
+| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
+| Layout type | `single` | `list` |
+| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
+| Example | `content/posts/my-post/index.md` | `content/posts/_index.md` |
+| Content from non-index page files... | Accessed only as page resources | Accessed only as regular pages |
+
+
+## Leaf Bundles {#leaf-bundles}
+
+A _Leaf Bundle_ is a directory at any hierarchy within the `content/`
+directory, that contains an **`index.md`** file.
+
+### Examples of Leaf Bundle organization {#examples-of-leaf-bundle-organization}
+
+```text
+content/
+├── about
+│ ├── index.md
+├── posts
+│ ├── my-post
+│ │ ├── content1.md
+│ │ ├── content2.md
+│ │ ├── image1.jpg
+│ │ ├── image2.png
+│ │ └── index.md
+│ └── my-other-post
+│ └── index.md
+│
+└── another-section
+ ├── ..
+ └── not-a-leaf-bundle
+ ├── ..
+ └── another-leaf-bundle
+ └── index.md
+```
+
+In the above example `content/` directory, there are four leaf
+bundles:
+
+about
+: This leaf bundle is at the root level (directly under
+ `content` directory) and has only the `index.md`.
+
+my-post
+: This leaf bundle has the `index.md`, two other content
+ Markdown files and two image files.
+
+image1
+: This image is a page resource of `my-post`
+ and only available in `my-post/index.md` resources.
+
+image2
+: This image is a page resource of `my-post`
+ and only available in `my-post/index.md` resources.
+
+my-other-post
+: This leaf bundle has only the `index.md`.
+
+another-leaf-bundle
+: This leaf bundle is nested under couple of
+ directories. This bundle also has only the `index.md`.
+
+{{% note %}}
+The hierarchy depth at which a leaf bundle is created does not matter,
+as long as it is not inside another **leaf** bundle.
+{{% /note %}}
+
+
+### Headless Bundle {#headless-bundle}
+
+A headless bundle is a bundle that is configured to not get published
+anywhere:
+
+- It will have no `Permalink` and no rendered HTML in `public/`.
+- It will not be part of `.Site.RegularPages`, etc.
+
+But you can get it by `.Site.GetPage`. Here is an example:
+
+```go-html-template
+{{ $headless := .Site.GetPage "/some-headless-bundle" }}
+{{ $reusablePages := $headless.Resources.Match "author*" }}
+<h2>Authors</h2>
+{{ range $reusablePages }}
+ <h3>{{ .Title }}</h3>
+ {{ .Content }}
+{{ end }}
+```
+
+_In this example, we are assuming the `some-headless-bundle` to be a headless
+ bundle containing one or more **page** resources whose `.Name` matches
+ `"author*"`._
+
+Explanation of the above example:
+
+1. Get the `some-headless-bundle` Page "object".
+2. Collect a *slice* of resources in this *Page Bundle* that matches
+ `"author*"` using `.Resources.Match`.
+3. Loop through that *slice* of nested pages, and output their `.Title` and
+ `.Content`.
+
+---
+
+A leaf bundle can be made headless by adding below in the Front Matter
+(in the `index.md`):
+
+```toml
+headless = true
+```
+
+{{% note %}}
+Only leaf bundles can be made headless.
+{{% /note %}}
+
+There are many use cases of such headless page bundles:
+
+- Shared media galleries
+- Reusable page content "snippets"
+
+
+## Branch Bundles {#branch-bundles}
+
+A _Branch Bundle_ is any directory at any hierarchy within the
+`content/` directory, that contains at least an **`_index.md`** file.
+
+This `_index.md` can also be directly under the `content/` directory.
+
+{{% note %}}
+Here `md` (markdown) is used just as an example. You can use any file
+type as a content resource as long as it is a content type recognized by Hugo.
+{{% /note %}}
+
+
+### Examples of Branch Bundle organization {#examples-of-branch-bundle-organization}
+
+```text
+content/
+├── branch-bundle-1
+│ ├── branch-content1.md
+│ ├── branch-content2.md
+│ ├── image1.jpg
+│ ├── image2.png
+│ └── _index.md
+└── branch-bundle-2
+ ├── _index.md
+ └── a-leaf-bundle
+ └── index.md
+```
+
+In the above example `content/` directory, there are two branch
+bundles (and a leaf bundle):
+
+`branch-bundle-1`
+: This branch bundle has the `_index.md`, two
+ other content Markdown files and two image files.
+
+`branch-bundle-2`
+: This branch bundle has the `_index.md` and a
+ nested leaf bundle.
+
+{{% note %}}
+The hierarchy depth at which a branch bundle is created does not
+matter.
+{{% /note %}}
+
+[^fn:1]: The `.md` extension is just an example. The extension can be `.html`, `.json` or any of any valid MIME type.
--- /dev/null
- ```yaml
+---
+title: Related Content
+description: List related content in "See Also" sections.
+date: 2017-09-05
+categories: [content management]
+keywords: [content]
+menu:
+ docs:
+ parent: "content-management"
+ weight: 40
+weight: 30
+draft: false
+aliases: [/content/related/,/related/]
+toc: true
+---
+
+
+Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).
+
+## List Related Content
+
+
+To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template:
+
+{{< code file="layouts/partials/related.html" >}}
+{{ $related := .Site.RegularPages.Related . | first 5 }}
+{{ with $related }}
+<h3>See Also</h3>
+<ul>
+ {{ range . }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+### Methods
+
+Here is the list of "Related" methods available on a page collection such `.RegularPages`.
+
+#### .Related PAGE
+Returns a collection of pages related the given one.
+
+```
+{{ $related := .Site.RegularPages.Related . }}
+```
+
+#### .RelatedIndices PAGE INDICE1 [INDICE2 ...]
+Returns a collection of pages related to a given one restricted to a list of indices.
+
+```
+{{ $related := .Site.RegularPages.RelatedIndices . "tags" "date" }}
+```
+
+#### .RelatedTo KEYVALS [KEYVALS2 ...]
+Returns a collection of pages related together by a set of indices and their match.
+
+In order to build those set and pass them as argument, one must use the `keyVals` function where the first argument would be the `indice` and the consecutive ones its potential `matches`.
+
+```
+{{ $related := .Site.RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
+```
+
+{{% note %}}
+Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature.
+{{% /note %}}
+
+## Configure Related Content
+Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed.
+
+### Default configuration
+
+Without any `related` configuration set on the project, Hugo's Related Content methods will use the following.
+
- ```
++{{< code-toggle file="config" >}}
+related:
+ threshold: 80
+ includeNewer: false
+ toLower: false
+ indices:
+ - name: keywords
+ weight: 100
+ - name: date
+ weight: 10
++{{< /code-toggle >}}
+
+Custom configuration should be set using the same syntax.
+
+{{% note %}}
+If you add a `related` config section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults.
+{{% /note %}}
+
+### Top Level Config Options
+
+threshold
+: A value between 0-100. Lower value will give more, but maybe not so relevant, matches.
+
+includeNewer
+: Set to true to include **pages newer than the current page** in the related content listing. This will mean that the output for older posts may change as new related content gets added.
+
+toLower
+: Set to true to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.
+
+### Config Options per Index
+
+name
+: The index name. This value maps directly to a page param. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
+
+weight
+: An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be 0, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best.
+
+pattern
+: This is currently only relevant for dates. When listing related content, we may want to list content that is also close in time. Setting "2006" (default value for date indexes) as the pattern for a date index will add weight to pages published in the same year. For busier blogs, "200601" (year and month) may be a better default.
+
+toLower
+: See above.
+
+## Performance Considerations
+
+**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
+
+This feature has been in the back log and requested by many for a long time. The development got this recent kick start from this Twitter thread:
+
+{{< tweet 898398437527363585 >}}
+
+Scott S. Lowe removed the "Related Content" section built using the `intersect` template function on tags, and the build time dropped from 30 seconds to less than 2 seconds on his 1700 content page sized blog.
+
+He should now be able to add an improved version of that "Related Content" section without giving up the fast live-reloads. But it's worth noting that:
+
+* If you don't use any of the `Related` methods, you will not use the Relate Content feature, and performance will be the same as before.
+* Calling `.RegularPages.Related` etc. will create one inverted index, also sometimes named posting list, that will be reused for any lookups in that same page collection. Doing that in addition to, as an example, calling `.Pages.Related` will work as expected, but will create one additional inverted index. This should still be very fast, but worth having in mind, especially for bigger sites.
+
+{{% note %}}
+We currently do not index **Page content**. We thought we would release something that will make most people happy before we start solving [Sherlock's last case](https://github.com/joearms/sherlock).
+{{% /note %}}
--- /dev/null
-
+---
+title: Syntax Highlighting
+description: Hugo comes with really fast syntax highlighting from Chroma.
+date: 2017-02-01
+publishdate: 2017-02-01
+keywords: [highlighting,chroma,code blocks,syntax]
+categories: [content management]
+menu:
+ docs:
+ parent: "content-management"
+ weight: 300
+weight: 20
+sections_weight: 20
+draft: false
+aliases: [/extras/highlighting/,/extras/highlight/,/tools/syntax-highlighting/]
+toc: true
+---
+
-
+Hugo uses [Chroma](https://github.com/alecthomas/chroma) as its code highlighter; it is built in Go and is really, really fast -- and for the most important parts compatible with Pygments we used before.
+
+## Configure Syntax Highlighter
+
+See [Configure Highlight](/getting-started/configuration-markup#highlight).
+
-
+## Generate Syntax Highlighter CSS
+
+If you run with `pygmentsUseClasses=true` in your site config, you need a style sheet.
+
+You can generate one with Hugo:
+
+```bash
+hugo gen chromastyles --style=monokai > syntax.css
+```
+
+Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/splash/docs/ for a gallery of available styles.
+
-
-
+## Highlight Shortcode
+
+Highlighting is carried out via the [built-in shortcode](/content-management/shortcodes/) `highlight`. `highlight` takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode. Note that `highlight` is *not* used for client-side javascript highlighting.
+
+Options:
+
+* `linenos`: configure line numbers. Valid values are `true`, `false`, `table`, or `inline`. `false` will turn off line numbers if it's configured to be on in site config. {{< new-in "0.60.0" >}} `table` will give copy-and-paste friendly code blocks.
+* `hl_lines`: lists a set of line numbers or line number ranges to be highlighted.
+* `linenostart=199`: starts the line number count from 199.
+
+### Example: Highlight Shortcode
+
+```
+{{</* highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" */>}}
+// ... code
+{{</* / highlight */>}}
+```
+
+Gives this:
+
+{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
+// GetTitleFunc returns a func that can be used to transform a string to
+// title case.
+//
+// The supported styles are
+//
+// - "Go" (strings.Title)
+// - "AP" (see https://www.apstylebook.com/)
+// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
+//
+// If an unknown or empty style is provided, AP style is what you get.
+func GetTitleFunc(style string) func(s string) string {
+ switch strings.ToLower(style) {
+ case "go":
+ return strings.Title
+ case "chicago":
+ return transform.NewTitleConverter(transform.ChicagoStyle)
+ default:
+ return transform.NewTitleConverter(transform.APStyle)
+ }
+}
+{{< / highlight >}}
+
+## Highlight Template Func
+
+See [Highlight](/functions/highlight/).
+
+## Highlighting in Code Fences
+
+Highlighting in code fences is enabled by default.{{< new-in "0.60.0" >}}
+
+````
+```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
+// ... code
+```
+````
+
+
+Gives this:
+
+```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
+// GetTitleFunc returns a func that can be used to transform a string to
+// title case.
+//
+// The supported styles are
+//
+// - "Go" (strings.Title)
+// - "AP" (see https://www.apstylebook.com/)
+// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
+//
+// If an unknown or empty style is provided, AP style is what you get.
+func GetTitleFunc(style string) func(s string) string {
+ switch strings.ToLower(style) {
+ case "go":
+ return strings.Title
+ case "chicago":
+ return transform.NewTitleConverter(transform.ChicagoStyle)
+ default:
+ return transform.NewTitleConverter(transform.APStyle)
+ }
+}
+```
+
+{{< new-in "0.60.0" >}}Note that only Goldmark supports passing attributes such as `hl_lines`, and it's important that it does not contain any spaces. See [goldmark-highlighting](https://github.com/yuin/goldmark-highlighting) for more information.
+
+The options are the same as in the [highlighting shortcode](/content-management/syntax-highlighting/#highlight-shortcode),including `linenos=false`, but note the slightly different Markdown attribute syntax.
+
+## List of Chroma Highlighting Languages
+
+The full list of Chroma lexers and their aliases (which is the identifier used in the `highlight` template func or when doing highlighting in code fences):
+
+{{< chroma-lexers >}}
+
+[Prism]: https://prismjs.com
+[prismdownload]: https://prismjs.com/download.html
+[Highlight.js]: https://highlightjs.org/
+[Rainbow]: https://craig.is/making/rainbows
+[Syntax Highlighter]: https://alexgorbatchev.com/SyntaxHighlighter/
+[Google Prettify]: https://github.com/google/code-prettify
+[Yandex]: https://yandex.ru/
--- /dev/null
-
+---
+title: Add Your Hugo Theme to the Showcase
+linktitle: Themes
+description: If you've built a Hugo theme and want to contribute back to the Hugo Community, share it with us.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-27
+categories: [contribute]
+keywords: [contribute,themes,design]
+authors: [digitalcraftsman]
+menu:
+ docs:
+ parent: "contribute"
+ weight: 30
+weight: 30
+sections_weight: 30
+draft: false
+aliases: [/contribute/theme/]
+wip: true
+toc: true
+---
+
+A collection of all themes created by the Hugo community, including screenshots and demos, can be found at [themes.gohugo.io]. Every theme in this list will automatically be added to the theme site.
+
+Another great site for Hugo themes is [jamstackthemes.dev/](https://jamstackthemes.dev/ssg/hugo/).
+
- In order to add your Hugo theme to [themes.gohugo.io] please [open up a new issue in the theme repository](https://github.com/gohugoio/hugoThemes/issues/new?template=theme-submission.md). **Please make sure that you've read the theme submission guidelines in the [README](https://github.com/gohugoio/hugoThemes/blob/master/README.md#adding-a-theme-to-the-list) of the hugoThemes repository.**
+### Add Your Theme to the Repo
+
++In order to add your Hugo theme to [themes.gohugo.io] please [open up a new issue in the theme repository](https://github.com/gohugoio/hugoThemes/issues/new?template=theme-submission.md). **Please make sure that you've read the theme submission guidelines in the [README](https://github.com/gohugoio/hugoThemes/blob/master/README.md#adding-a-theme-to-the-list) of the hugoThemes repository.**
+
+[themes.gohugo.io]: https://themes.gohugo.io/
--- /dev/null
- [lists]: /lists/
+---
+title: after
+description: "`after` slices an array to only the items after the <em>N</em>th item."
+godocref:
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [iteration]
+signature: ["after INDEX COLLECTION"]
+workson: []
+hugoversion:
+relatedfuncs: [last,first,seq]
+deprecated: false
+aliases: []
+---
+
+The following shows `after` being used in conjunction with the [`slice` function][slice]:
+
+```
+{{ $data := slice "one" "two" "three" "four" }}
+{{ range after 2 $data }}
+ {{ . }}
+{{ end }}
+→ ["three", "four"]
+```
+
+## Example of `after` with `first`: 2nd–4th Most Recent Articles
+
+You can use `after` in combination with the [`first` function][] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page][] to show only two rows:
+
+1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
+2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
+
+{{< code file="layouts/section/articles.html" download="articles.html" >}}
+{{ define "main" }}
+<section class="row featured-article">
+ <h2>Featured Article</h2>
+ {{ range first 1 .Pages.ByPublishDate.Reverse }}
+ <header>
+ <h3><a href="{{.Permalink}}">{{.Title}}</a></h3>
+ </header>
+ <p>{{.Description}}</p>
+ {{ end }}
+</section>
+<div class="row recent-articles">
+ <h2>Recent Articles</h2>
+ {{ range first 3 (after 1 .Pages.ByPublishDate.Reverse) }}
+ <section class="recent-article">
+ <header>
+ <h3><a href="{{.Permalink}}">{{.Title}}</a></h3>
+ </header>
+ <p>{{.Description}}</p>
+ </section>
+ {{ end }}
+</div>
+{{ end }}
+{{< /code >}}
+
+[`first` function]: /functions/first/
+[list/section page]: /templates/section-templates/
++[lists]: /templates/lists/#order-content
+[slice]: /functions/slice/
--- /dev/null
- If you want to see an example of how you can deploy to S3 instead of GitHub pages, check [Wercker's documentation][werckerdocs] for guidance on setup.
-
+---
+title: Deployment with Wercker
+linktitle: Deployment with Wercker
+description: You can use a free tool called Wercker to automate deployments between your GitHub-hosted source and final website on GitHub pages.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [hosting and deployment]
+keywords: [wercker,deployment,github,git]
+authors: [Arjen Schwarz, Samuel Debruyn]
+menu:
+ docs:
+ parent: "hosting-and-deployment"
+ weight: 60
+weight: 60
+sections_weight: 60
+draft: false
+aliases: [/tutorials/automated-deployments/]
+toc: true
+wip: false
+notesforauthors:
+---
+
+## Goals
+
+By the end of this guide, you will have completed the following:
+
+* Creating a basic Hugo project and website
+* Version controlling your project with Git
+* Adding your project to GitHub
+* Automating site deployments with a free tool called Wercker
+* Deploying your website to GitHub Pages for free hosting
+
+## Assumptions
+
+1. You have a working familiarity with using Git for version control
+2. You have a GitHub account
+3. You have already created a basic Hugo project
+
+If you do not meet these assumptions, the [GitHub help section][githubhelp] has an explanation of how to install and use git. [Signing up for a GitHub][ghsignup] account is free as well. If you are completely unfamiliar with creating a new Hugo website, visit the [Hugo Quick Start][quickstart].
+
+## Create a Basic Hugo Site
+
+{{% note "This Guide Uses the Hugo CLI" %}}
+All the work for setting up a Hugo project and using this guide is done via the Hugo CLI's most basic commands. See the [command line reference page](/commands/) for a more exhaustive account of the CLI's features.
+{{% /note %}}
+
+First, create your new Hugo website using the [`hugo new site` command][basicusage] and change into the newly created directory for the project. In this guide, we are calling our new project `hugo-wercker-example`:
+
+{{< code file="hugo-new-site.sh" >}}
+hugo new site hugo-wercker-example
+cd hugo-wercker-example
+{{< /code >}}
+
+We will use the [Herring Cove theme][] by first cloning the theme into the `themes` directory.
+
+{{< code file="clone-herring-cove-theme.sh" >}}
+cd themes
+git clone https://github.com/spf13/herring-cove.git
+{{< /code >}}
+
+Cloning the project from the command line will conflict with our own version control. So, we need to remove the external git configuration that came with the clone of Herring Cove:
+
+{{< code file="remove-herring-cove-git.sh" >}}
+rm -rf herring-cove/.git
+{{< /code >}}
+
+We need content for Hugo to build. Let's add a quick `/about` page:
+
+```
+hugo new about.md
+```
+
+{{% note %}}
+The preceding example for the about page leverages archetypes to scaffold a new content file with preconfigured front matter. [Find out more about Hugo's archetypes](/content-management/archetypes/).
+{{% /note %}}
+
+Now you can edit `contents/about.md` in your text editor of choice, but this is not necessary for the purposes of this guide. Running the following command will build your Hugo site into the `public` directory.
+
+Once the website is build, it's a good idea to run the following command to start a local server and ensure you're changes have been implemented:
+
+```
+hugo server --theme=herring-cove
+```
+
+If everything is fine, you should see something similar to the image below when you go to <http://localhost:1313> in your browser.
+
+![][1]
+
+## Set up Version Control in Git
+
+Adding Git to your project is done by running the `git init` command from the root directory of your project.
+
+```
+git init
+```
+
+Running `git status` at this point will show you the following entries: the `config.toml` file, the `themes` directory, the `contents` directory, and the `public` directory. However, we don't want the `public` directory version controlled because Wercker is responsible for generating the finished website later on. Therefore, we'll add a `.gitignore` file to our project that will exclude the `/public` directory from being tracked by Git:
+
+{{< code file="gitignore.sh" >}}
+echo "/public" >> .gitignore
+{{< /code >}}
+
+Wercker might complain when we try to build the site later on because we currently do not have any static files outside of the `themes` directory. We simply have to add *any* file to the static folder to prevent Wercker from complaining. To keep this guide simple, let's add a `robots.txt`. The following command creates the file in `/static`. The contents of the `robots.txt` lets search engines know they have full access to crawl the published website:
+
+{{< code file="addrobotstxt.sh" >}}
+echo "User-agent: *\nDisallow:" > static/robots.txt
+{{< /code >}}
+
+Now we need to add (i.e., [stage [see Git documentation]][gitbasics]) and commit all of our changes in the repository into Git:
+
+```
+git commit -a -m "Initial commit"
+```
+
+## Add the Project to GitHub
+
+Now we need to create a new repository on GitHub. Once you are signed in to GitHub, you can add a new repository by clicking on the **+▼** dropdown at the top right or by going to [https://github.com/new](https://github.com)..
+
+We then choose a name for the project (`hugo-wercker-example`). When clicking on create repository GitHub displays the commands for adding an existing project to the site. The commands shown below are the ones used for this site, if you're following along you will need to use the ones shown by GitHub. Once we've run those commands the project is in GitHub and we can move on to setting up the Wercker configuration. Be sure to replace `YourUserName` with your GitHub account/username:
+
+{{< code file="setup-gh-repo.sh" >}}
+git remote add origin git@github.com:YourUsername/hugo-wercker-example.git
+git push -u origin master
+{{< /code >}}
+
+![][2]
+
+## Set Up Wercker
+
+To sign up for a free Wercker account, go to <https://www.wercker.com> and click the **Sign Up** button on the top right of the home screen.
+
+![][3]
+
+### Register for Wercker with Your GitHub Account
+
+Sign up for Wercker using your GitHub credentials. If you don't have a GitHub account, or don't want to use it for your account, you have the option to register with a username and password as well. However, the second half of this guide---devoted to hosting your website on GitHub pages---will no longer be of interest to you.
+
+![][4]
+
+### Connect GitHub or Bitbucket
+
+After you are registered, you will need to link your GitHub or Bitbucket account to Wercker. You can link your account by navigating to your profile settings and then selecting "Git connections."
+
+![][17]
+
+If you registered for Wercker using GitHub, it will most likely look like the following image. To connect a missing service, click the **Connect** button, which may send you to either GitHub or Bitbucket to sign into your respective account.
+
+![][5]
+
+### Add Your Project
+
+Now that we've got all the preliminaries out of the way, it's time to set up our application. For this we click on the **+ Create** button next to Applications and choose GitHub as our provider.
+
+![][6]
+
+### Select a Repository
+
+When selecting GitHub, Wercker will show all your GitHub repositories. You have the option to filter repositories using the search input at the top of the repositories list. Once you have your repository selected, click the **Use selected repo** button.
+
+![][7]
+
+### Select the Repository Owner
+
+In the next step, Wercker asks you to select the repository owner. Select your GitHub account and continue.
+
+![][8]
+
+### Configure Access
+
+{{% note %}}
+This guide assumes you are using a public GitHub repository and understand that the [published GitHub Pages website will be available to everyone](https://help.github.com/articles/what-is-github-pages/#usage-limits).
+{{%/note %}}
+
+This step can be slightly tricky. Wercker does not have privileges to check out your private projects by default and therefore needs your permission to add a deploy key to your repository. By selecting the first option, you're simply allowing Wercker to check out the code via the same methods available to anyone visiting the project on GitHub.
+
+![][9]
+
+### Wercker.yml
+
+Wercker will now attempt to create an initial `wercker.yml` file for you. More specifically, it will create a code block within the Wercker interface that you can copy to your finished file. Wercker gives us a `debian` box because our project does not have any special requirements.
+
+Now we need to create a *wercker.yml* file in the root of our project. This file will contain our Wercker app's configuration. After we finish setting up our app, we will expand the contents of this file to build and deploy our website.
+
+![][10]
+
+### Public or Private
+
+This is a personal choice. You can make an app public so that everyone can see more details about it. Keeping it private or public does not provide any overt benefits for you as the creator of the app. That said, [the app we are currently creating has been made public][publicappurl] to facilitate easier usage of this hosting and deployment guide.
+
+![][11]
+
+#### App Successfully Created
+
+The application is now added and Wercker will offer you the chance to trigger a build. However, we will decline the offer because we haven't yet pushed our `wercker.yml` file to our GitHub repository.
+
+![][12]
+
+### Add the Hugo-build Step
+
+Now we need to add the Wercker steps to our build process. First, we go to the "Registry" action in the top menu. When in the registry, we can search for "hugo build". Select the "Hugo-Build by **arjen**" step.
+
+![][13]
+
+### Use the Hugo-build Step
+
+A summary of very basic usage is available at the top of the details for the Hugo-Build step. Below the basic usage is the contents of the `README.md` file associated with the step's repository. `README.md`'s on Wercker usually contain more details about the advanced options and examples of usage.
+
+We're not going to use any of the advanced features of Hugo-Build in this guide. Let's return to our project and add the first section of details we need to our `wercker.yml`.
+
+{{% warning "Hugo Version in `wercker.yml`" %}}
+The docs are a work in progress. As such, the `version` represented in this guide may not represent the version you've been using for local development. Be sure to use the appropriate Hugo version for your build step.
+{{% /warning %}}
+
+{{< code file="wercker-build-step.yml" >}}
+box: debian
+build:
+ steps:
+ - arjen/hugo-build:
+ version: "0.17"
+ theme: herring-cove
+ flags: --buildDrafts=true
+{{< /code >}}
+
+We can conclude this first step by pushing our `wercker.yml` to our GitHub repository and then seeing the magic at work within Wercker's interface.
+
+{{< code file="push-wecker-to-gh.sh" >}}
+git commit -a -m "Add wercker.yml"
+git push origin master
+{{< /code >}}
+
+If completed and successful, a green check mark should appear in the commit column of your first build. However, this is only the build step. We still need to deploy the website to our free hosting on GitHub Pages. If you would like more details about the build, you can click the commit hash.
+
+![][14]
+
+### Add a GitHub Pages Deploy Step to `wercker.yml`
+
+In order to deploy to GitHub Pages, we need to add a deploy step to our `wercker.yml`. We are going to add `lukevevier/gh-pages`, the most popular GitHub Pages step in the Wercker Steps repository. Additionally, we need to ensure the box Wercker uses for our deployments has git and ssh installed. We can do this using the `install-packages` command. Here is our *final* `wercker.yml` file:
+
+{{< code file="wercker.yml" >}}
+box: debian
+build:
+ steps:
+ - arjen/hugo-build:
+ version: "0.17"
+ theme: herring-cove
+ flags: --buildDrafts=true
+deploy:
+ steps:
+ - install-packages:
+ packages: git ssh-client
+ - lukevivier/gh-pages@0.2.1:
+ token: $GIT_TOKEN
+ domain: hugo-wercker.ig.nore.me
+ basedir: public
+{{< /code >}}
+
+### How does the GitHub Pages Configuration Work?
+
+We've provided a some important information in our `wercker.yml`. First, we've added the domain we want to use for our published website. Configuring the domain here will ensure that GitHub Pages is aware of the domain we want to use.
+
+Secondly, we've configured the `basedir` to `public`. This is the directory that will be used as the website on GitHub Pages. `public` is also the default publishing directory in Hugo. (For more information, see [hugo's configuration docs][hugoconfig]).
+
+Lastly, you'll notice a `$GIT_TOKEN` variable. This is used for pushing our changes to GitHub. We will need to configure this token before Wercker can build our website.
+
+### Set the App's Deploy Target
+
+We can set our deploy target by going to our app's settings and clicking on **Deploy targets**. Now select **Add deploy target** and then **Custom deploy**.
+
+![][15]
+
+### Configure the Deploy Step in Wercker
+
+The next screen requires you fill in the deploy target name.
+
+1. Make sure you enable **auto deploy** from the **master** branch.
+2. Add a variable for the **GIT_TOKEN**. You'll need to create an access token in GitHub. Follow the directions in [GitHub help][accesstokenghhelp].
+3. With the deploy step configured in Wercker, we can push the updated wercker.yml file to GitHub and it will create the GitHub pages site for us.
+
+The website described in this guide is available at <http://hugo-wercker.ig.nore.me>.
+
+![][16]
+
+## Conclusion
+
+Once this workflow is established, you can update your website automatically by pushing any content changes to your GitHub repository.
+
+### Code for the Wercker Deployment Guide
+
+[The source code for the site used in this guide is available on GitHub][guidesource], as is the [Wercker Hugo Build step][guidestep].
+
- [werckerdocs]: http://devcenter.wercker.com/docs/deploy/s3.html
+[1]: /images/hosting-and-deployment/deployment-with-wercker/creating-a-basic-hugo-site.png
+[2]: /images/hosting-and-deployment/deployment-with-wercker/adding-the-project-to-github.png
+[3]: /images/hosting-and-deployment/deployment-with-wercker/wercker-sign-up.png
+[4]: /images/hosting-and-deployment/deployment-with-wercker/wercker-sign-up-page.png
+[5]: /images/hosting-and-deployment/deployment-with-wercker/wercker-git-connections.png
+[6]: /images/hosting-and-deployment/deployment-with-wercker/wercker-add-app.png
+[7]: /images/hosting-and-deployment/deployment-with-wercker/wercker-select-repository.png
+[8]: /images/hosting-and-deployment/deployment-with-wercker/wercker-select-owner.png
+[9]: /images/hosting-and-deployment/deployment-with-wercker/wercker-access.png
+[10]: /images/hosting-and-deployment/deployment-with-wercker/werckeryml.png
+[11]: /images/hosting-and-deployment/deployment-with-wercker/public-or-not.png
+[12]: /images/hosting-and-deployment/deployment-with-wercker/and-we-ve-got-an-app.png
+[13]: /images/hosting-and-deployment/deployment-with-wercker/wercker-search.png
+[14]: /images/hosting-and-deployment/deployment-with-wercker/using-hugo-build.png
+[15]: /images/hosting-and-deployment/deployment-with-wercker/adding-a-github-pages-step.png
+[16]: /images/hosting-and-deployment/deployment-with-wercker/configure-the-deploy-step.png
+[17]: /images/hosting-and-deployment/deployment-with-wercker/wercker-account-settings.png
+
+
+[accesstokenghhelp]: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
+[basicusage]: /getting-started/usage/
+[ghsignup]: https://github.com/join
+[gitbasics]: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
+[githubhelp]: https://help.github.com/articles/set-up-git/
+[guidesource]: https://github.com/ArjenSchwarz/hugo-wercker-example
+[guidestep]: https://github.com/ArjenSchwarz/wercker-step-hugo-build
+[Herring Cove theme]: https://github.com/spf13/herring-cove
+[hugoconfig]: /getting-started/configuration/
+[publicappurl]: https://app.wercker.com/#applications/5586dcbdaf7de9c51b02b0d5
+[quickstart]: /getting-started/quick-start/
--- /dev/null
- ![][1]
+---
+title: Host on Bitbucket
+linktitle: Host on Bitbucket
+description: You can use Bitbucket in conjunction with Aerobatic to build, deploy, and host a Hugo website.
+date: 2017-02-04
+publishdate: 2017-02-04
+lastmod: 2017-02-04
+categories: [hosting and deployment]
+keywords: [hosting,bitbucket,deployment,aerobatic]
+authors: [Jason Gowans]
+menu:
+ docs:
+ parent: "hosting-and-deployment"
+ weight: 50
+weight: 50
+sections_weight: 50
+draft: false
+toc: true
+aliases: [/tutorials/hosting-on-bitbucket/]
+---
+
+You can use [Bitbucket](https://bitbucket.org/) and [Aerobatic](https://www.aerobatic.com) to build, deploy, and host a Hugo website. Aerobatic is a static hosting service that integrates with Bitbucket and provides a free hosting tier.
+
+## Assumptions
+
+* Working familiarity with Git for version control
+* A [Bitbucket account](https://bitbucket.org/account/signup/)
+
+## Install Aerobatic CLI
+
+If you haven't previously used Aerobatic, you'll first need to install the Command Line Interface (CLI) and create an account. For a list of all commands available, see the [Aerobatic CLI](https://www.aerobatic.com/docs/cli/) docs.
+
+```
+npm install aerobatic-cli -g
+aero register
+```
+
+## Create and Deploy Site
+
+```
+hugo new site my-new-hugo-site
+cd my-new-hugo-site
+cd themes; git clone https://github.com/eliasson/liquorice
+hugo -t liquorice
+aero create # create the Aerobatic site
+hugo --baseURL https://my-new-hugo-site.aerobatic.io # build the site overriding baseURL
+aero deploy -d public # deploy output to Aerobatic
+
+Version v1 deployment complete.
+View now at https://hugo-docs-test.aerobatic.io
+```
+
+In the rendered page response, the `https://__baseurl__` will be replaced with your actual site url (in this example, `https://my-new-hugo-site.aerobatic.io`). You can always rename your Aerobatic website with the `aero rename` command.
+
+## Push Hugo site to Bitbucket
+
+We will now create a git repository and then push our code to Bitbucket. In Bitbucket, create a repository.
+
-
++![Bitbucket Screenshot][1]
+
+[1]: /images/hosting-and-deployment/hosting-on-bitbucket/bitbucket-create-repo.png
+
- ![][2]
+```
+# initialize new git repository
+git init
+
+# set up our .gitignore file
+echo -e "/public \n/themes \naero-deploy.tar.gz" >> .gitignore
+
+# commit and push code to master branch
+git add --all
+git commit -m "Initial commit"
+git remote add origin git@bitbucket.org:YourUsername/my-new-hugo-site.git
+git push -u origin master
+```
+
+## Continuous Deployment With Bitbucket Pipelines
+
+In the example above, we pushed the compiled assets in the `/public` folder to Aerobatic. In the following example, we use Bitbucket Pipelines to continuously create and deploy the compiled assets to Aerobatic.
+
+### Step 1: Configure Bitbucket Pipelines
+
+In your Hugo website's Bitbucket repo;
+
+1. Click the Pipelines link in the left nav menu of your Bitbucket repository.
+2. Click the Enable Pipelines button.
+3. On the next screen, leave the default template and click Next.
+4. In the editor, paste in the yaml contents below and click Commit.
+
+```
+image: beevelop/nodejs-python
+pipelines:
+ branches:
+ master:
+ - step:
+ script:
+ - apt-get update -y && apt-get install wget
+ - apt-get -y install git
+ - wget https://github.com/gohugoio/hugo/releases/download/v0.18/hugo_0.18-64bit.deb
+ - dpkg -i hugo*.deb
+ - git clone https://github.com/eliasson/liquorice themes/liquorice
+ - hugo --theme=liquorice --baseURL https://__baseurl__ --buildDrafts
+ - npm install -g aerobatic-cli
+ - aero deploy
+```
+
+### Step 2: Create `AEROBATIC_API_KEY` environment variable.
+
+This step only needs to be done once per account. From the command line;
+
+```
+aero apikey
+```
+
+1. Navigate to the Bitbucket account settings for the account that the website repo belongs to.
+2. Scroll down to the bottom of the left nav and click the Environment variables link in the PIPELINES section.
+3. Create a new environment variable called AEROBATIC_API_KEY with the value you got by running the `aero apikey` command. Be sure to click the Secured checkbox.
+
+### Step 3: Edit and Commit Code
+
+```
+hugo new posts/good-to-great.md
+hugo server --buildDrafts -t liquorice #Check that all looks good
+
+# commit and push code to master branch
+git add --all
+git commit -m "New blog post"
+git push -u origin master
+```
+
+Your code will be committed to Bitbucket, Bitbucket Pipelines will run your build, and a new version of your site will be deployed to Aerobatic.
+
+At this point, you can now create and edit blog posts directly in the Bitbucket UI.
+
-
++![Bitbucket blog Screenshot][2]
+
+[2]: /images/hosting-and-deployment/hosting-on-bitbucket/bitbucket-blog-post.png
+
+## Suggested next steps
+
+The code for this example can be found in this Bitbucket [repository](https://bitbucket.org/dundonian/hugo-docs-test). Aerobatic also provides a number of additional [plugins](https://www.aerobatic.com/docs) such as auth and redirects that you can use for your Hugo site.
--- /dev/null
+---
+title: Host on GitLab
+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: 2017-11-16
+categories: [hosting and deployment]
+keywords: [hosting,deployment,git,gitlab]
+authors: [Riku-Pekka Silvola]
+menu:
+ docs:
+ parent: "hosting-and-deployment"
+ weight: 40
+weight: 40
+sections_weight: 40
+draft: false
+toc: true
+wip: false
+aliases: [/tutorials/hosting-on-gitlab/]
+---
+
+[GitLab](https://gitlab.com/) makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides [native support for Hugo, as well as numerous other static site generators](https://gitlab.com/pages/hugo).
+
+## Assumptions
+
+* Working familiarity with Git for version control
+* Completion of the Hugo [Quick Start][]
+* A [GitLab account](https://gitlab.com/users/sign_in)
+* A Hugo website on your local machine that you are ready to publish
+
+## Create .gitlab-ci.yml
+
+```
+cd your-hugo-site
+```
+
+In the root directory of your Hugo site, create a `.gitlab-ci.yml` file. The `.gitlab-ci.yml` configures the GitLab CI on how to build your page. Simply add the content below.
+
+{{< code file=".gitlab-ci.yml" >}}
+image: monachus/hugo
+
+variables:
+ GIT_SUBMODULE_STRATEGY: recursive
+
+pages:
+ script:
+ - hugo
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
+{{< /code >}}
+
+## Push Your Hugo Website to GitLab
+
+Next, create a new repository on GitLab. It is *not* necessary to make the repository public. In addition, you might want to add `/public` to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.
+
+```
+# initialize new git repository
+git init
+
+# add /public directory to our .gitignore file
+echo "/public" >> .gitignore
+
+# commit and push code to master branch
+git add .
+git commit -m "Initial commit"
+git remote add origin https://gitlab.com/YourUsername/your-hugo-site.git
+git push -u origin master
+```
+
+## Wait for Your Page to Build
+
+That's it! You can now follow the CI agent building your page at `https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines`.
+
+After the build has passed, your new website is available at `https://<YourUsername>.gitlab.io/<your-hugo-site>/`.
+
++{{% note %}}
++Make sure your `baseURL` key-value in your [site configuration](/getting-started/configuration/) reflects the full URL of your GitLab pages repository if you're using the default GitLab Pages URL (e.g., `https://<YourUsername>.gitlab.io/<your-hugo-site>/`) and not a custom domain.
++{{% /note %}}
++
+## Next Steps
+
+GitLab supports using custom CNAME's and TLS certificates. For more details on GitLab Pages, see the [GitLab Pages setup documentation](https://about.gitlab.com/2016/04/07/gitlab-pages-setup/).
+
+[Quick Start]: /getting-started/quick-start/
--- /dev/null
- Using this integration method, you will have to specify the Zone ID and your [KeyCDN API](https://www.keycdn.com/api) key as secret variables. To do this, navigate to the top-left menu bar in GitLab and select Projects. Then, select your project and click on the Settings page. Finally, select Pipelines from the sub-menu and scroll down to the Secret Variable section.
+---
+title: "Hosting on KeyCDN"
+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
+draft: false
+---
+
+[KeyCDN](https://www.keycdn.com/) provides a multitude of features to help accelerate and secure your Hugo site globally including Brotli compression, Let's Encrypt support, Origin Shield, and more.
+
+## Assumptions
+
+- You already have a Hugo page configured
+- You have a GitLab account
+- You have a KeyCDN account
+
+## Create a KeyCDN Pull Zone
+
+The first step will be to login to your KeyCDN account and create a new zone. Name this whatever you like and select the [Pull Zone](https://www.keycdn.com/support/create-a-pull-zone/) option. As for the origin URL, your site will be running on [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html) with a URL of `https://youruser.gitlab.io/reponame/`. Use this as the Origin URL.
+
+
+
+While the origin location doesn’t exist yet, you will need to use your new Zone URL address (or [Zone Alias](https://www.keycdn.com/support/create-a-zone-alias/)) in the `.gitlab-ci.yml` file that will be uploaded to your GitLab project.
+
+Ensure that you use your Zone URL or Zone alias as the `BASEURL` variable in the example below. This will be the user-visible website address.
+
+## Configure Your .gitlab-ci.yml File
+
+Your `.gitlab-ci.yml` file should look similar to the example below. Be sure to modify any variables that are specific to your setup.
+
+```
+image: alpine:latest
+
+variables:
+ BASEURL: "https://cipull-7bb7.kxcdn.com/"
+ HUGO_VERSION: "0.26"
+ HUGO_CHECKSUM: "67e4ba5ec2a02c8164b6846e30a17cc765b0165a5b183d5e480149baf54e1a50"
+ KEYCDN_ZONE_ID: "75544"
+
+before_script:
+ - apk update
+ - apk add curl
+
+pages:
+ stage: deploy
+ script:
+ - apk add git
+ - git submodule update --init
+ - curl -sSL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz -o /tmp/hugo.tar.gz
+ - echo "${HUGO_CHECKSUM} /tmp/hugo.tar.gz" | sha256sum -c
+ - tar xf /tmp/hugo.tar.gz hugo -C /tmp/ && cp /tmp/hugo /usr/bin
+ - hugo --baseURL ${BASEURL}
+ - curl "https://api.keycdn.com/zones/purge/${KEYCDN_ZONE_ID}.json" -u "${KEYCDN_API_KEY}:"
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
+
+```
- After verifying your CI job ran without issues, first check that your GitLab page shows up under `https://youruser.gitlab.io/reponame/` (it might look broken depending on your browser settings as all links point to your KeyCDN zone – don’t worry about that) and then by heading to whatever Zonealias / Zone URL you defined.
++Using this integration method, you will have to specify the Zone ID and your [KeyCDN API](https://www.keycdn.com/api) key as secret variables. To do this, navigate to the top-left menu bar in GitLab and select Projects. Then, select your project and click on the Settings page. Finally, select Pipelines from the sub-menu and scroll down to the Secret Variable section.
+
+The Secret Variable for your Zone ID should look similar to:
+
+
+
+While the Secret Variable for your API Key will look similar to:
+
+
+
+The Zone ID and API key are used to purge your zone – it’s not strictly needed but otherwise, the CDN might deliver older versions of your assets for quite a while.
+
+## Push Your Changes to GitLab
+
+Now it’s time to push the newly created repository to GitLab:
+
+```
+git remote add origin git@gitlab.com:youruser/ciexample.git
+git push -u origin master
+```
+
+You can watch the progress and CI job output in your Gitlab project under “Pipelines”.
+
++After verifying your CI job ran without issues, first check that your GitLab page shows up under `https://youruser.gitlab.io/reponame/` (it might look broken depending on your browser settings as all links point to your KeyCDN zone – don’t worry about that) and then by heading to whatever Zone alias / Zone URL you defined.
+
+To learn more about Hugo hosting options with KeyCDN, check out the complete [Hugo hosting with KeyCDN integration guide](https://www.keycdn.com/support/hugo-hosting/).
--- /dev/null
+---
+title: Hugo Pipes Introduction
+description: Hugo Pipes is Hugo's asset processing set of functions.
+date: 2018-07-14
+publishdate: 2018-07-14
+lastmod: 2018-07-14
+categories: [asset management]
+keywords: []
+menu:
+ docs:
+ parent: "pipes"
+ weight: 20
+weight: 01
+sections_weight: 01
+draft: false
+aliases: [/assets/]
+---
+
+### Asset directory
+
+Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file's `assetDir` key.
+
+### From file to resource
+
+In order to process an asset with Hugo Pipes, it must be retrieved as a resource using `resources.Get`, which takes one argument: the filepath of the file relative to the asset directory.
+
+```go-html-template
+{{ $style := resources.Get "sass/main.scss" }}
+```
+
+### Asset publishing
+
+Assets will only be published (to `/public`) if `.Permalink` or `.RelPermalink` is used.
+
+### Go Pipes
+
+For improved readability, the Hugo Pipes examples of this documentation will be written using [Go Pipes](/templates/introduction/#pipes):
+```go-html-template
+{{ $style := resources.Get "sass/main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
+<link rel="stylesheet" href="{{ $style.Permalink }}">
+```
+
+### Method aliases
+
+Each Hugo Pipes `resources` transformation method uses a __camelCased__ alias (`toCSS` for `resources.ToCSS`).
+Non-transformation methods deprived of such aliases are `resources.Get`, `resources.FromString`, `resources.ExecuteAsTemplate` and `resources.Concat`.
+
+The example above can therefore also be written as follows:
+```go-html-template
+{{ $style := resources.Get "sass/main.scss" | toCSS | minify | fingerprint }}
+<link rel="stylesheet" href="{{ $style.Permalink }}">
+```
++
++### Caching
++
++Hugo Pipes invocations are cached based on the entire _pipe chain_.
++
++An example of a pipe chain is:
++
++```go-html-template
++{{ $mainJs := resources.Get "js/main.js" | js.Build "main.js" | minify | fingerprint }}
++```
++
++The pipe chain is only invoked the first time it is encountered in a site build, and results are otherwise loaded from cache. As such, Hugo Pipes can be used in templates which are executed thousands or millions of times without negatively impacting the build performance.
--- /dev/null
- format [string] {{< new-in "0.75.0" >}}
+---
+title: JavaScript Building
+description: Hugo Pipes can process JavaScript files with [ESBuild](https://github.com/evanw/esbuild).
+date: 2020-07-20
+publishdate: 2020-07-20
+lastmod: 2020-07-20
+categories: [asset management]
+keywords: []
+menu:
+ docs:
+ parent: "pipes"
+ weight: 45
+weight: 45
+sections_weight: 45
+draft: false
+---
+
+Any JavaScript resource file can be transpiled and "tree shaken" using `js.Build` which takes for argument either a string for the filepath or a dict of options listed below.
+
+### Options
+
+targetPath [string]
+: If not set, the source path will be used as the base target path.
+Note that the target path's extension may change if the target MIME type is different, e.g. when the source is TypeScript.
+
+minify [bool]
+: Let `js.Build` handle the minification.
+
+target [string]
+: The language target.
+ One of: `es5`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020` or `esnext`.
+ Default is `esnext`.
+
+externals [slice]
+: External dependencies. If a dependency should not be included in the bundle (Ex. library loaded from a CDN.), it should be listed here.
+
+```go-html-template
+{{ $externals := slice "react" "react-dom" }}
+```
+
+defines [map]
+: Allow to define a set of string replacement to be performed when building. Should be a map where each key is to be replaced by its value.
+
+```go-html-template
+{{ $defines := dict "process.env.NODE_ENV" `"development"` }}
+```
+
++format [string] {{< new-in "0.74.3" >}}
+: The output format.
+ One of: `iife`, `cjs`, `esm`.
+ Default is `iife`, a self-executing function, suitable for inclusion as a <script> tag.
+
+### Examples
+
+```go-html-template
+{{ $built := resources.Get "js/index.js" | js.Build "main.js" }}
+```
+
+Or with options:
+
+```go-html-template
+{{ $externals := slice "react" "react-dom" }}
+{{ $defines := dict "process.env.NODE_ENV" `"development"` }}
+
+{{ $opts := dict "targetPath" "main.js" "externals" $externals "defines" $defines }}
+{{ $built := resources.Get "scripts/main.js" | js.Build $opts }}
+<script type="text/javascript" src="{{ $built.RelPermalink }}" defer></script>
+```
--- /dev/null
- If using YouTube this will produce a og:video tag like `<meta property="og:video" content="url">`. If using a YouTube link make sure this is in **https://www.youtube.com/v/NlXVWtgLNjY** not __https://www.youtube.com/watch?v=NlXVWtgLNjY__
+---
+title: Internal Templates
+linktitle: Internal Templates
+description: Hugo ships with a group of boilerplate templates that cover the most common use cases for static websites.
+date: 2017-03-06
+publishdate: 2017-03-06
+lastmod: 2017-03-06
+categories: [templates]
+keywords: [internal, analytics,]
+menu:
+ docs:
+ parent: "templates"
+ weight: 168
+weight: 168
+sections_weight: 168
+draft: false
+aliases: []
+toc: true
+wip: true
+---
+<!-- reference: https://discourse.gohugo.io/t/lookup-order-for-partials/5705/6
+code: https://github.com/gohugoio/hugo/blob/e445c35d6a0c7f5fc2f90f31226cd1d46e048bbc/tpl/template_embedded.go#L147 -->
+
+{{% warning %}}
+While the following internal templates are called similar to partials, they do *not* observe the partial template lookup order.
+{{% /warning %}}
+
+## Google Analytics
+
+Hugo ships with internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes.
+
+### Configure Google Analytics
+
+Provide your tracking id in your configuration file:
+
+{{< code-toggle file="config" >}}
+googleAnalytics = "UA-123-45"
+{{</ code-toggle >}}
+
+### Use the Google Analytics Template
+
+You can then include the Google Analytics internal template:
+
+```
+{{ template "_internal/google_analytics.html" . }}
+```
+
+
+```
+{{ template "_internal/google_analytics_async.html" . }}
+```
+
+A `.Site.GoogleAnalytics` variable is also exposed from the config.
+
+## Disqus
+
+Hugo also ships with an internal template for [Disqus comments][disqus], a popular commenting system for both static and dynamic websites. In order to effectively use Disqus, you will need to secure a Disqus "shortname" by [signing up for the free service][disqussignup].
+
+### Configure Disqus
+
+To use Hugo's Disqus template, you first need to set a single value in your site's `config.toml` or `config.yml`:
+
+{{< code-toggle file="config" >}}
+disqusShortname = "yourdiscussshortname"
+{{</ code-toggle >}}
+
+You also have the option to set the following in the front matter for a given piece of content:
+
+* `disqus_identifier`
+* `disqus_title`
+* `disqus_url`
+
+### Use the Disqus Template
+
+To add Disqus, include the following line in templates where you want your comments to appear:
+
+```
+{{ template "_internal/disqus.html" . }}
+```
+
+A `.Site.DisqusShortname` variable is also exposed from the config.
+
+### Conditional Loading of Disqus Comments
+
+Users have noticed that enabling Disqus comments when running the Hugo web server on `localhost` (i.e. via `hugo server`) causes the creation of unwanted discussions on the associated Disqus account.
+
+You can create the following `layouts/partials/disqus.html`:
+
+{{< code file="layouts/partials/disqus.html" download="disqus.html" >}}
+<div id="disqus_thread"></div>
+<script type="text/javascript">
+
+(function() {
+ // Don't ever inject Disqus on localhost--it creates unwanted
+ // discussions from 'localhost:1313' on your Disqus account...
+ if (window.location.hostname == "localhost")
+ return;
+
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ var disqus_shortname = '{{ .Site.DisqusShortname }}';
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+})();
+</script>
+<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
+{{< /code >}}
+
+The `if` statement skips the initialization of the Disqus comment injection when you are running on `localhost`.
+
+You can then render your custom Disqus partial template as follows:
+
+```
+{{ partial "disqus.html" . }}
+```
+
+## Open Graph
+An internal template for the [Open Graph protocol](https://ogp.me/), metadata that enables a page to become a rich object in a social graph.
+This format is used for Facebook and some other sites.
+
+### Configure Open Graph
+
+Hugo's Open Graph template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
+
+{{< code-toggle file="config" >}}
+[params]
+ title = "My cool site"
+ images = ["site-feature-image.jpg"]
+ description = "Text about my cool site"
+[taxonomies]
+ series = "series"
+{{</ code-toggle >}}
+
+{{< code-toggle file="content/blog/my-post" >}}
+title = "Post title"
+description = "Text about this post"
+date = "2006-01-02"
+images = ["post-cover.png"]
+audio = []
+videos = []
+series = []
+tags = []
+{{</ code-toggle >}}
+
+Hugo uses the page title and description for the title and description metadata.
+The first 6 URLs from the `images` array are used for image metadata.
+
+Various optional metadata can also be set:
+
+- Date, published date, and last modified data are used to set the published time metadata if specified.
+- `audio` and `videos` are URL arrays like `images` for the audio and video metadata tags, respectively.
+- The first 6 `tags` on the page are used for the tags metadata.
+- The `series` taxonomy is used to specify related "see also" pages by placing them in the same series.
+
++If using YouTube this will produce a og:video tag like `<meta property="og:video" content="url">`. Use the `https://youtu.be/<id>` format with YouTube videos (example: `https://youtu.be/qtIqKaDlqXo`).
+
+### Use the Open Graph Template
+
+To add Open Graph metadata, include the following line between the `<head>` tags in your templates:
+
+```
+{{ template "_internal/opengraph.html" . }}
+```
+
+## Twitter Cards
+
+An internal template for [Twitter Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards),
+metadata used to attach rich media to Tweets linking to your site.
+
+### Configure Twitter Cards
+
+Hugo's Twitter Card template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
+
+{{< code-toggle file="config" >}}
+[params]
+ images = ["site-feature-image.jpg"]
+ description = "Text about my cool site"
+{{</ code-toggle >}}
+
+{{< code-toggle file="content/blog/my-post" >}}
+title = "Post title"
+description = "Text about this post"
+images = ["post-cover.png"]
+{{</ code-toggle >}}
+
+If `images` aren't specified in the page front-matter, then hugo searches for [image page resources](/content-management/image-processing/) with `feature`, `cover`, or `thumbnail` in their name.
+If no image resources with those names are found, the images defined in the [site config](/getting-started/configuration/) are used instead.
+If no images are found at all, then an image-less Twitter `summary` card is used instead of `summary_large_image`.
+
+Hugo uses the page title and description for the card's title and description fields. The page summary is used if no description is given.
+
+### Use the Twitter Cards Template
+
+To add Twitter card metadata, include the following line between the `<head>` tags in your templates:
+
+```
+{{ template "_internal/twitter_cards.html" . }}
+```
+
+## The Internal Templates
+
+* `_internal/disqus.html`
+* `_internal/google_news.html`
+* `_internal/google_analytics.html`
+* `_internal/google_analytics_async.html`
+* `_internal/opengraph.html`
+* `_internal/pagination.html`
+* `_internal/schema.html`
+* `_internal/twitter_cards.html`
+
+[disqus]: https://disqus.com
+[disqussignup]: https://disqus.com/profile/signup/
--- /dev/null
- All the methods below, e.g. `.Site.RegularPages` can also be reached via the global `site` function, e.g. `site.RegularPages`, which can be handy in partials where the `Page` object isn't easily available. {{< new-in "0.53.0" >}}.
+---
+title: Site Variables
+linktitle: Site Variables
+description: Many, but not all, site-wide variables are defined in your site's configuration. However, Hugo provides a number of built-in variables for convenient access to global values in your templates.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [variables and params]
+keywords: [global,site]
+draft: false
+menu:
+ docs:
+ parent: "variables"
+ weight: 10
+weight: 10
+sections_weight: 10
+aliases: [/variables/site-variables/]
+toc: true
+---
+
+The following is a list of site-level (aka "global") variables. Many of these variables are defined in your site's [configuration file][config], whereas others are built into Hugo's core for convenient usage in your templates.
+
+## Get the Site object from a partial
+
++All the methods below, e.g. `.Site.RegularPages` can also be reached via the global `site` function, e.g. `site.RegularPages`, which can be handy in partials where the `Page` object isn't easily available. {{< new-in "0.53" >}}.
+
+## Site Variables List
+
+.Site.AllPages
+: array of all pages, regardless of their translation.
+
+.Site.Author
+: a map of the authors as defined in the site configuration.
+
+.Site.BaseURL
+: the base URL for the site as defined in the site configuration.
+
+.Site.BuildDrafts
+: a boolean (default: `false`) to indicate whether to build drafts as defined in the site configuration.
+
+.Site.Copyright
+: a string representing the copyright of your website as defined in the site configuration.
+
+.Site.Data
+: custom data, see [Data Templates](/templates/data-templates/).
+
+.Site.DisqusShortname
+: a string representing the shortname of the Disqus shortcode as defined in the site configuration.
+
+.Site.GoogleAnalytics
+: a string representing your tracking code for Google Analytics as defined in the site configuration.
+
+.Site.Home
+: reference to the homepage's [page object](https://gohugo.io/variables/page/)
+
+.Site.IsMultiLingual
+: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
+
+.Site.IsServer
+: a boolean to indicate if the site is being served with Hugo's built-in server. See [`hugo server`](/commands/hugo_server/) for more information.
+
+.Site.Language.Lang
+: the language code of the current locale (e.g., `en`).
+
+.Site.Language.LanguageName
+: the full language name (e.g. `English`).
+
+.Site.Language.Weight
+: the weight that defines the order in the `.Site.Languages` list.
+
+.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
+: 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
+: 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
+: an ordered list (ordered by defined weight) of languages.
+
+.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
+: all of the menus in the site.
+
+.Site.Pages
+: array of all content ordered by Date with the newest first. This array contains only the pages in the current language. See [`.Site.Pages`](#site-pages).
+
+.Site.RegularPages
+: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalent to `where .Site.Pages "Kind" "page"`. See [`.Site.Pages`](#site-pages).
+
+.Site.Sections
+: top-level directories of the site.
+
+.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
+: a string representing the title of the site.
+
+## The `.Site.Params` Variable
+
+`.Site.Params` is a container holding the values from the `params` section of your site configuration.
+
+### Example: `.Site.Params`
+
+The following `config.[yaml|toml|json]` defines a site-wide param for `description`:
+
+{{< code-toggle file="config" >}}
+baseURL = "https://yoursite.example.com/"
+
+[params]
+ description = "Tesla's Awesome Hugo Site"
+ author = "Nikola Tesla"
+{{</ code-toggle >}}
+
+You can use `.Site.Params` in a [partial template](/templates/partials/) to call the default site description:
+
+{{< code file="layouts/partials/head.html" >}}
+<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
+{{< /code >}}
+
+## The `.Site.Pages` Variable {#site-pages}
+
+### `.Site.Pages` compared to `.Pages`
+
+{{< readfile file="/content/en/readfiles/pages-vs-site-pages.md" markdown="true" >}}
+
+
+
+
+[config]: /getting-started/configuration/
--- /dev/null
- HUGO_VERSION = "0.74.2"
+[build]
+publish = "public"
+command = "hugo --gc --minify"
+
+[context.production.environment]
- HUGO_VERSION = "0.74.2"
++HUGO_VERSION = "0.74.3"
+HUGO_ENV = "production"
+HUGO_ENABLEGITINFO = "true"
+
+[context.split1]
+command = "hugo --gc --minify --enableGitInfo"
+
+[context.split1.environment]
- HUGO_VERSION = "0.74.2"
++HUGO_VERSION = "0.74.3"
+HUGO_ENV = "production"
+
+[context.deploy-preview]
+command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
+
+[context.deploy-preview.environment]
- HUGO_VERSION = "0.74.2"
++HUGO_VERSION = "0.74.3"
+
+[context.branch-deploy]
+command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
+
+[context.branch-deploy.environment]
++HUGO_VERSION = "0.74.3"
+
+[context.next.environment]
+HUGO_ENABLEGITINFO = "true"
+