diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-07-16 00:50:56 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-07-16 00:50:56 +0300 |
commit | 05d0eddd2bfce4622462428c66c1a9e3abdde614 (patch) | |
tree | d5154990025e77a12f4872db494c00f7287d1ebc /docs/content/en/templates | |
parent | c624a77992c4f7c1bcb5f659e89332d8588986b7 (diff) | |
parent | 35febb2e2a3780c3338a2665fddea7dda28a17f4 (diff) |
Merge commit '35febb2e2a3780c3338a2665fddea7dda28a17f4'
Diffstat (limited to 'docs/content/en/templates')
-rw-r--r-- | docs/content/en/templates/404.md | 1 | ||||
-rw-r--r-- | docs/content/en/templates/internal.md | 8 | ||||
-rw-r--r-- | docs/content/en/templates/introduction.md | 4 | ||||
-rw-r--r-- | docs/content/en/templates/lists.md | 2 | ||||
-rw-r--r-- | docs/content/en/templates/menu-templates.md | 2 | ||||
-rw-r--r-- | docs/content/en/templates/output-formats.md | 2 | ||||
-rw-r--r-- | docs/content/en/templates/rss.md | 8 | ||||
-rw-r--r-- | docs/content/en/templates/sitemap-template.md | 9 |
8 files changed, 15 insertions, 21 deletions
diff --git a/docs/content/en/templates/404.md b/docs/content/en/templates/404.md index bb1d5e424..add040175 100644 --- a/docs/content/en/templates/404.md +++ b/docs/content/en/templates/404.md @@ -53,6 +53,7 @@ Your 404.html file can be set to load automatically when a visitor enters a mist * Amazon CloudFont. You can specify the page in the Error Pages section in the CloudFont Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) * Caddy Server. Using `errors { 404 /404.html }`. [Details here](https://caddyserver.com/docs/errors) * Netlify. Add `/* /404.html 404` to `content/_redirects`. [Details Here](https://www.netlify.com/docs/redirects/#custom-404) +* Azure Static website. You can specify the `Error document path` in the Static website configuration page of the Azure portal. [More details are available in the Static website documentation](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website). {{% note %}} `hugo server` will not automatically load your custom `404.html` file, but you diff --git a/docs/content/en/templates/internal.md b/docs/content/en/templates/internal.md index fdec63c57..19ef4db82 100644 --- a/docs/content/en/templates/internal.md +++ b/docs/content/en/templates/internal.md @@ -137,7 +137,7 @@ description = "Text about this post" date = "2006-01-02" images = ["post-cover.png"] audio = [] -video = [] +videos = [] series = [] tags = [] {{</ code-toggle >}} @@ -146,11 +146,14 @@ 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 `video` are URL arrays like `images` for the audio and video metadata tags, respectively. +- `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">`. If using a YouTube link make sure this is in **https://www.youtube.com/v/NlXVWtgLNjY** not __https://www.youtube.com/watch?v=NlXVWtgLNjY__ + ### Use the Open Graph Template To add Open Graph metadata, include the following line between the `<head>` tags in your templates: @@ -160,6 +163,7 @@ To add Open Graph metadata, include the following line between the `<head>` tags ``` ## 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. diff --git a/docs/content/en/templates/introduction.md b/docs/content/en/templates/introduction.md index 02a580e79..a2b91ba1d 100644 --- a/docs/content/en/templates/introduction.md +++ b/docs/content/en/templates/introduction.md @@ -170,7 +170,7 @@ Example of including a `layouts/partials/header.html` partial: ### Template The `template` function was used to include *partial* templates -in much older Hugo versions. Now it useful only for calling +in much older Hugo versions. Now it's useful only for calling [*internal* templates][internal_templates]. The syntax is `{{ template "_internal/<TEMPLATE>.<EXTENSION>" . }}`. @@ -235,7 +235,7 @@ key. #### Example 5: Conditional on empty _map_, _array_, or _slice_. -If the _map_, _array_, or _slice_ passed into the range is zero-length then the else statment is evaluated. +If the _map_, _array_, or _slice_ passed into the range is zero-length then the else statement is evaluated. ```go-html-template {{ range $array }} diff --git a/docs/content/en/templates/lists.md b/docs/content/en/templates/lists.md index 34c9e6d5a..5d6948a1f 100644 --- a/docs/content/en/templates/lists.md +++ b/docs/content/en/templates/lists.md @@ -35,7 +35,7 @@ For template lookup order, see [Template Lookup](/templates/lookup-order/). The idea of a list page comes from the [hierarchical mental model of the web][mentalmodel] and is best demonstrated visually: -![Image demonstrating a hierarchical website sitemap.](/images/site-hierarchy.svg) +[![Image demonstrating a hierarchical website sitemap.](/images/site-hierarchy.svg)](/images/site-hierarchy.svg) ## List Defaults diff --git a/docs/content/en/templates/menu-templates.md b/docs/content/en/templates/menu-templates.md index 5efb080d8..b39fe42a9 100644 --- a/docs/content/en/templates/menu-templates.md +++ b/docs/content/en/templates/menu-templates.md @@ -65,7 +65,7 @@ The following is an example: {{< /code >}} {{% note "`absLangURL` and `relLangURL`" %}} -Use the [`absLangUrl`](/functions/abslangurl) or [`relLangUrl`](/functions/rellangurl) functions if your theme makes use of the [multilingual feature](/content-management/multilingual/). In contrast to `absURL` and `relURL`, these two functions add the correct language prefix to the url. +Use the [`absLangURL`](/functions/abslangurl) or [`relLangURL`](/functions/rellangurl) functions if your theme makes use of the [multilingual feature](/content-management/multilingual/). In contrast to `absURL` and `relURL`, these two functions add the correct language prefix to the url. {{% /note %}} ## Section Menu for Lazy Bloggers diff --git a/docs/content/en/templates/output-formats.md b/docs/content/en/templates/output-formats.md index 1ab45e4c7..487661f5a 100644 --- a/docs/content/en/templates/output-formats.md +++ b/docs/content/en/templates/output-formats.md @@ -47,7 +47,7 @@ To add or modify a media type, define it in a `mediaTypes` section in your [site The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type. -**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the output format. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`: +**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`: ```toml [mediaTypes] diff --git a/docs/content/en/templates/rss.md b/docs/content/en/templates/rss.md index 715bc2a48..08049bfbd 100644 --- a/docs/content/en/templates/rss.md +++ b/docs/content/en/templates/rss.md @@ -58,6 +58,7 @@ copyright = "This work is licensed under a Creative Commons Attribution-ShareAli This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.0 Specification][RSS 2.0]. ```xml +{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> @@ -86,13 +87,6 @@ This is the default RSS template that ships with Hugo. It adheres to the [RSS 2. </rss> ``` -{{% warning "XML Header" %}} -Hugo will automatically add the following header line to this file on render. Please do *not* include this in the template as it's not valid HTML. -``` -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -``` -{{% /warning %}} - ## Reference your RSS Feed in `<head>` In your `header.html` template, you can specify your RSS feed in your `<head></head>` tag using Hugo's [Output Formats][Output Formats] like this: diff --git a/docs/content/en/templates/sitemap-template.md b/docs/content/en/templates/sitemap-template.md index 7cbc7cefb..9afc0d389 100644 --- a/docs/content/en/templates/sitemap-template.md +++ b/docs/content/en/templates/sitemap-template.md @@ -46,6 +46,7 @@ For multilingual sites, we also create a Sitemap index. You can provide a custom This template respects the version 0.9 of the [Sitemap Protocol](http://www.sitemaps.org/protocol.html). ```xml +{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> {{ range .Data.Pages }} @@ -69,18 +70,12 @@ This template respects the version 0.9 of the [Sitemap Protocol](http://www.site </urlset> ``` -{{% note %}} -Hugo will automatically add the following header line to this file -on render. Please don't include this in the template as it's not valid HTML. - -`<?xml version="1.0" encoding="utf-8" standalone="yes" ?>` -{{% /note %}} - ## Hugo's sitemapindex.xml This is used to create a Sitemap index in multilingual mode: ```xml +{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> {{ range . }} <sitemap> |