mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
Merge commit 'ec920363cdeb687c8bcac9c242767d366fb058cb'
This commit is contained in:
commit
5b5dcb8d5a
20 changed files with 202 additions and 121 deletions
|
@ -6,6 +6,8 @@
|
|||
"aabba",
|
||||
"aabbaa",
|
||||
"aabbaabb",
|
||||
"aabbaabbab",
|
||||
"abbaa",
|
||||
"abourget",
|
||||
"absurl",
|
||||
"adoc",
|
||||
|
@ -18,7 +20,11 @@
|
|||
"attrlink",
|
||||
"azblob",
|
||||
"baseof",
|
||||
"bbaa",
|
||||
"bcde",
|
||||
"bcdef",
|
||||
"beevelop",
|
||||
"Bergevin",
|
||||
"bibtex",
|
||||
"Bjørn",
|
||||
"blackfriday",
|
||||
|
@ -31,6 +37,7 @@
|
|||
"canonify",
|
||||
"Catmull",
|
||||
"Catwoman",
|
||||
"changefreq",
|
||||
"Cheatsheet",
|
||||
"choco",
|
||||
"chromastyles",
|
||||
|
@ -42,12 +49,15 @@
|
|||
"Coen",
|
||||
"Commento",
|
||||
"Cond",
|
||||
"contentdir",
|
||||
"Contentful",
|
||||
"Copr",
|
||||
"copyrighthtml",
|
||||
"corejs",
|
||||
"countrunes",
|
||||
"countwords",
|
||||
"crossreferences",
|
||||
"daftaupe",
|
||||
"datatable",
|
||||
"DATOCMS",
|
||||
"debugconfig",
|
||||
|
@ -60,6 +70,8 @@
|
|||
"dokuwiki",
|
||||
"dpkg",
|
||||
"DRING",
|
||||
"Eiqc",
|
||||
"Eliott",
|
||||
"Emojify",
|
||||
"Enwrite",
|
||||
"eopkg",
|
||||
|
@ -68,6 +80,7 @@
|
|||
"erroridf",
|
||||
"Evernote",
|
||||
"exitwp",
|
||||
"expirydate",
|
||||
"Feminella",
|
||||
"firstpost",
|
||||
"Formspree",
|
||||
|
@ -95,7 +108,9 @@
|
|||
"Grayscale",
|
||||
"Gruber",
|
||||
"gtag",
|
||||
"gvfs",
|
||||
"hidecaption",
|
||||
"hmac",
|
||||
"Hokus",
|
||||
"hola",
|
||||
"hügó",
|
||||
|
@ -121,6 +136,7 @@
|
|||
"Isset",
|
||||
"Isso",
|
||||
"Jaco",
|
||||
"JIRN",
|
||||
"johnpatitucci",
|
||||
"Joomla",
|
||||
"JRBR",
|
||||
|
@ -142,10 +158,13 @@
|
|||
"mathjax",
|
||||
"mdhender",
|
||||
"mdshortcode",
|
||||
"MENUENTRY",
|
||||
"mercredi",
|
||||
"Milli",
|
||||
"Mittwoch",
|
||||
"mkdir",
|
||||
"mmark",
|
||||
"modh",
|
||||
"monokai",
|
||||
"Morling",
|
||||
"mspowerpoint",
|
||||
|
@ -155,17 +174,20 @@
|
|||
"mydeployment",
|
||||
"myindex",
|
||||
"mylayout",
|
||||
"mylogin",
|
||||
"mypage",
|
||||
"mypartials",
|
||||
"mypost",
|
||||
"mysite",
|
||||
"myspa",
|
||||
"mystyle",
|
||||
"mytextpartial",
|
||||
"mytheme",
|
||||
"NDJSON",
|
||||
"needsexample",
|
||||
"Netravali",
|
||||
"newparam",
|
||||
"Nichlas",
|
||||
"Nikhil",
|
||||
"Njjy",
|
||||
"nlist",
|
||||
|
@ -176,6 +198,7 @@
|
|||
"NOSQL",
|
||||
"notoc",
|
||||
"novembre",
|
||||
"numfmt",
|
||||
"NUMWORKERMULTIPLIER",
|
||||
"Obhu",
|
||||
"octohug",
|
||||
|
@ -191,18 +214,25 @@
|
|||
"PCRE",
|
||||
"peaceiris",
|
||||
"Pedersen",
|
||||
"Pekka",
|
||||
"permalinkable",
|
||||
"plainify",
|
||||
"POSIX",
|
||||
"postprocess",
|
||||
"Poupin",
|
||||
"prerender",
|
||||
"println",
|
||||
"publishdate",
|
||||
"Pygments",
|
||||
"qref",
|
||||
"querify",
|
||||
"QVOMC",
|
||||
"Racic",
|
||||
"Rclone",
|
||||
"rdwatters",
|
||||
"readfile",
|
||||
"rebinded",
|
||||
"recommendedby",
|
||||
"REDIR",
|
||||
"reftext",
|
||||
"relatedfuncs",
|
||||
|
@ -210,16 +240,21 @@
|
|||
"relurl",
|
||||
"remarkjs",
|
||||
"rgba",
|
||||
"Riku",
|
||||
"rlimit",
|
||||
"roboto",
|
||||
"rssxml",
|
||||
"rwxrwxrwx",
|
||||
"RYUGV",
|
||||
"safehtml",
|
||||
"safejs",
|
||||
"Samsa",
|
||||
"schemaorg",
|
||||
"Shekhar",
|
||||
"Shortcode",
|
||||
"Shortcodes",
|
||||
"signup",
|
||||
"Silvola",
|
||||
"Sindre",
|
||||
"sitemapindex",
|
||||
"sitemapxml",
|
||||
|
@ -231,24 +266,33 @@
|
|||
"struct",
|
||||
"structs",
|
||||
"subdir",
|
||||
"svgs",
|
||||
"symdiff",
|
||||
"Talkyard",
|
||||
"taxo",
|
||||
"taxonomyname",
|
||||
"tbody",
|
||||
"tdewolff",
|
||||
"testshortcodes",
|
||||
"thead",
|
||||
"Thinkful",
|
||||
"Tknx",
|
||||
"TLDR",
|
||||
"TMPDIR",
|
||||
"TOCSS",
|
||||
"todos",
|
||||
"tojson",
|
||||
"Tomango",
|
||||
"topologix",
|
||||
"Torikian",
|
||||
"totoml",
|
||||
"toyaml",
|
||||
"twitteruser",
|
||||
"Unmarshal",
|
||||
"Unmarshal",
|
||||
"urlize",
|
||||
"urlset",
|
||||
"utimestamp",
|
||||
"vendored",
|
||||
"vimrc",
|
||||
"wanghc",
|
||||
"Wappalyzer",
|
||||
|
@ -258,19 +302,35 @@
|
|||
"wibble",
|
||||
"wordcount",
|
||||
"workson",
|
||||
"wpxr",
|
||||
"Xbaabbab",
|
||||
"xvzf",
|
||||
"yoyoyo",
|
||||
"Zgotmpl",
|
||||
"zzbbaabb"
|
||||
"zzbbaabb",
|
||||
"مدونتي"
|
||||
],
|
||||
"language": "en,en-GB,en-US,de,fr",
|
||||
"allowCompoundWords": true,
|
||||
"files": [
|
||||
"**/*.md"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
"<!-- prettier-ignore -->\\n(`{3,})\\w*\\n[\\s\\S]+?\\1",
|
||||
"\\[(\\*{2})?@\\w+?\\1\\]",
|
||||
"\\[`\\w+`\\]",
|
||||
"ve{2,}r{2,}y",
|
||||
"ve+r+y+long\\w*",
|
||||
"\\/.*?\\/",
|
||||
"\\_\\w+",
|
||||
"\\#\\w+"
|
||||
],
|
||||
"ignorePaths": [
|
||||
".cspell.json",
|
||||
"**/node_modules/**",
|
||||
"*.min.*"
|
||||
"*.min.*",
|
||||
"**/news/*",
|
||||
"**/showcase/*"
|
||||
],
|
||||
"useGitignore": true
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ The current list of content formats in Hugo:
|
|||
|MMark|mmark|Mmark is deprecated and will be removed in a future release.|
|
||||
|Emacs Org-Mode|org|See [go-org](https://github.com/niklasfasching/go-org).|
|
||||
|AsciiDoc|asciidocext, adoc, ad|Needs [Asciidoctor][ascii] installed.|
|
||||
|RST|rst|Needs [RST](https://docutils.sourceforge.net/rst.html) installed.|
|
||||
|RST|rst|Needs [RST](https://docutils.sourceforge.io/rst.html) installed.|
|
||||
|Pandoc|pandoc, pdc|Needs [Pandoc](https://www.pandoc.org/) installed.|
|
||||
|HTML|html, htm|To be treated as a content file, with layout, shortcodes etc., it must have front matter. If not, it will be copied as-is.|
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ hugoversion: 0.27
|
|||
relatedfuncs: [default]
|
||||
toc: false
|
||||
draft: false
|
||||
needsexamples: false
|
||||
---
|
||||
|
||||
`cond` returns *VAR1* if *CONTROL* is true, or *VAR2* if it is not.
|
||||
|
|
|
@ -18,7 +18,6 @@ relatedfuncs: []
|
|||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
needsexamples: false
|
||||
---
|
||||
|
||||
`default` checks whether a given value is set and returns a default value if it is not. *Set* in this context means different things depending on the data type:
|
||||
|
|
|
@ -16,7 +16,6 @@ hugoversion:
|
|||
relatedfuncs: []
|
||||
deprecated: false
|
||||
aliases: []
|
||||
needsexamples: false
|
||||
---
|
||||
|
||||
```
|
||||
|
|
|
@ -46,7 +46,7 @@ In addition to using a single site config file, one can use the `configDir` dire
|
|||
|
||||
- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
|
||||
- Each file's content must be top-level, for example:
|
||||
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
[Params]
|
||||
foo = "bar"
|
||||
|
@ -220,7 +220,7 @@ Disable automatic live reloading of browser window.
|
|||
|
||||
: Do not convert the url/path to lowercase.
|
||||
|
||||
### enableEmoji
|
||||
### enableEmoji
|
||||
|
||||
**Default value:** false
|
||||
|
||||
|
@ -254,18 +254,6 @@ Enable generation of `robots.txt` file.
|
|||
|
||||
See [Front matter Configuration](#configure-front-matter).
|
||||
|
||||
### footnoteAnchorPrefix
|
||||
|
||||
**Default value:** ""
|
||||
|
||||
Prefix for footnote anchors.
|
||||
|
||||
### footnoteReturnLinkContents
|
||||
|
||||
**Default value:** ""
|
||||
|
||||
Text to display for footnote return links.
|
||||
|
||||
### googleAnalytics
|
||||
|
||||
**Default value:** ""
|
||||
|
@ -279,6 +267,7 @@ Google Analytics tracking ID.
|
|||
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).
|
||||
|
||||
### languageCode
|
||||
|
@ -288,6 +277,7 @@ See [Image Processing Config](/content-management/image-processing/#image-proces
|
|||
A language tag as defined by [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). The internal [RSS template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml) populates its `<language>` element with this value. The value is not used elsewhere.
|
||||
|
||||
### languages
|
||||
|
||||
See [Configure Languages](/content-management/multilingual/#configure-languages).
|
||||
|
||||
### disableLanguages
|
||||
|
@ -330,7 +320,7 @@ Don't sync modification time of files.
|
|||
### outputFormats
|
||||
See [Configure Output Formats](#configure-additional-output-formats).
|
||||
|
||||
### paginate
|
||||
### paginate
|
||||
|
||||
**Default value:** 10
|
||||
|
||||
|
@ -568,7 +558,6 @@ The following is a typical example of a configuration file. The values nested un
|
|||
{{< code-toggle file="config">}}
|
||||
baseURL: "https://yoursite.example.com/"
|
||||
title: "My Hugo Site"
|
||||
footnoteReturnLinkContents: "↩"
|
||||
permalinks:
|
||||
posts: /:year/:month/:title/
|
||||
params:
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
title: Deployment with Rclone
|
||||
linktitle: Deployment with Rclone
|
||||
description: If you have access to your web host with SFTP/FTP/SSH/HTTP(DAV), you can use rclone to incrementally deploy your entire Hugo website.
|
||||
date: 2021-08-09
|
||||
publishdate: 2021-08-09
|
||||
lastmod: 2021-08-09
|
||||
categories: [hosting and deployment]
|
||||
keywords: [rclone,sftp,deployment]
|
||||
authors: [Daniel F. Dickinson]
|
||||
menu:
|
||||
docs:
|
||||
parent: "hosting-and-deployment"
|
||||
weight: 80
|
||||
weight: 80
|
||||
sections_weight: 80
|
||||
draft: false
|
||||
aliases: [/tutorials/deployment-with-rclone/]
|
||||
toc: true
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
## Assumptions
|
||||
|
||||
* A web host running a web server. This could be a shared hosting environment or a VPS.
|
||||
* Access to your web host with any of the [protocols supported by rclone](https://rclone.org/#providers), such as SFTP.
|
||||
* A functional static website built with Hugo
|
||||
* Deploying from an [Rclone](https://rclone.org) compatible operating system
|
||||
* You have [installed Rclone](https://rclone.org/install/).
|
||||
|
||||
**NB**: You can remove ``--interactive`` in the commands below once you are comfortable with rclone, if you wish. Also, ``--gc`` and ``--minify`` are optional in the ``hugo`` commands below.
|
||||
|
||||
## Getting Started
|
||||
|
||||
The spoiler is that you can even deploy your entire website from any compatible OS with no configuration. Using SFTP for example:
|
||||
|
||||
```
|
||||
hugo --gc --minify
|
||||
rclone sync --interactive --sftp-host sftp.example.com --sftp-user www-data --sftp-ask-password public/ :sftp:www/
|
||||
```
|
||||
|
||||
## Configure Rclone for Even Easier Usage
|
||||
|
||||
The easiest way is simply to run ``rclone config``.
|
||||
|
||||
The [Rclone docs](https://rclone.org/docs/) provide [an example of configuring Rclone to use SFTP](https://rclone.org/sftp/).
|
||||
|
||||
For the next commands, we will assume you configured a remote you named ``hugo-www``
|
||||
|
||||
The above 'spoiler' commands could become:
|
||||
|
||||
```
|
||||
hugo --gc --minify
|
||||
rclone sync --interactive public/ hugo-www:www/
|
||||
```
|
||||
|
||||
After you issue the above commands (and respond to any prompts), check your website and you will see that it is deployed.
|
|
@ -83,11 +83,11 @@ The Zone ID and API key are used to purge your zone – it’s not strictly need
|
|||
Now it’s time to push the newly created repository to GitLab:
|
||||
|
||||
```
|
||||
git remote add origin git@gitlab.com:youruser/ciexample.git
|
||||
git remote add origin git@gitlab.com:youruser/ci-example.git
|
||||
git push -u origin master
|
||||
```
|
||||
|
||||
You can watch the progress and CI job output in your Gitlab project under “Pipelines”.
|
||||
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.
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ linktitle: Host on Render
|
|||
description: Host your Hugo site for free with Render's global CDN, fully-managed SSL and auto deploys from GitHub.
|
||||
date: 2019-06-06
|
||||
publishdate: 2019-06-06
|
||||
lastmod: 2020-01-01
|
||||
categories: [hosting and deployment]
|
||||
keywords: [hosting,deployment]
|
||||
authors: [Anurag Goel]
|
||||
|
@ -88,5 +87,4 @@ Render automatically downloads all Git submodules defined in your Git repo on ev
|
|||
|
||||
Chat with Render developers at https://render.com/chat or email `support@render.com` if you need help.
|
||||
|
||||
|
||||
[Quick Start]: /getting-started/quick-start/
|
||||
|
|
|
@ -43,10 +43,10 @@ private
|
|||
: Comma separated glob list matching paths that should be treated as private.
|
||||
|
||||
workspace {{< new-in "0.83.0" >}}
|
||||
The workspace file to use. This enables Go workspace mode. Note that this can also be set via OS env, e.g. `export HUGO_MODULE_WORKSPACE=/my/hugo.work` This only works with Go 1.18+.
|
||||
: The workspace file to use. This enables Go workspace mode. Note that this can also be set via OS env, e.g. `export HUGO_MODULE_WORKSPACE=/my/hugo.work` This only works with Go 1.18+.
|
||||
|
||||
replacements {{< new-in "0.77.0" >}}
|
||||
: A comma separated (or a slice) list of module path to directory replacement mapping, e.g. `github.com/bep/myprettytheme -> ../..,github.com/bep/shortcodes -> /some/path`. This is mostly useful for temporary locally development of a module, and then it makes sense to set it as an OS environment variable, e.g: `env HUGO_MODULE_REPLACEMENTS="github.com/bep/myprettytheme -> ../.."`. Any relative path is relate to [themesDir](https://gohugo.io/getting-started/configuration/#all-configuration-settings), and absolute paths are allowed.
|
||||
: A comma separated (or a slice) list of module path to directory replacement mapping, e.g. `github.com/bep/my-theme -> ../..,github.com/bep/shortcodes -> /some/path`. This is mostly useful for temporary locally development of a module, and then it makes sense to set it as an OS environment variable, e.g: `env HUGO_MODULE_REPLACEMENTS="github.com/bep/my-theme -> ../.."`. Any relative path is relate to [themesDir](https://gohugo.io/getting-started/configuration/#all-configuration-settings), and absolute paths are allowed.
|
||||
|
||||
Note that the above terms maps directly to their counterparts in Go Modules. Some of these setting may be natural to set as OS environment variables. To set the proxy server to use, as an example:
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ Also see the [CLI Doc](/commands/hugo_mod_clean/).
|
|||
|
||||
Run `hugo mod clean` to delete the entire modules cache.
|
||||
|
||||
Note that you can also configure the `modules` cache with a `maxAge`, see [File Caches](/hugo-modules/configuration/#configure-file-caches).
|
||||
Note that you can also configure the `modules` cache with a `maxAge`, see [File Caches](/getting-started/configuration/#configure-file-caches).
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Hugo addresses all these needs, coupled with [Forestry.io](https://forestry.io/)
|
|||
- The **multilingual** content support, especially simple to setup.
|
||||
- The **multiple environments** support (develop, staging, test, production, ...).
|
||||
- Although a hard start with the Go language, the power of the **Hugo's templating**.
|
||||
- The **partial layouts**, including the `internals` (e.g. social metas).
|
||||
- The **partial layouts**, including the `internals` (e.g. social meta tags).
|
||||
- The **build time**, unbeatable ⚡️⚡️⚡️.
|
||||
|
||||
|
||||
|
@ -30,4 +30,3 @@ Hugo addresses all these needs, coupled with [Forestry.io](https://forestry.io/)
|
|||
- **[Forestry.io](https://forestry.io)** for the content management.
|
||||
|
||||
**All of these tools allow our editor to manage the blog's content without having to worry about its technical aspect, which is managed by the developers.**
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ Your 404.html file can be set to load automatically when a visitor enters a mist
|
|||
* Nginx. You might specify `error_page 404 /404.html;` in your `nginx.conf` file. [Details here](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page).
|
||||
* Amazon AWS S3. When setting a bucket up for static web serving, you can specify the error file from within the S3 GUI.
|
||||
* Amazon CloudFront. You can specify the page in the Error Pages section in the CloudFront 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)
|
||||
* Caddy Server. Use the `handle_errors` directive to specify error pages for one or more status codes. [Details here](https://caddyserver.com/docs/caddyfile/directives/handle_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).
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: Ordere and Grouping Hugo Lists
|
||||
title: Ordering and Grouping Hugo Lists
|
||||
linktitle: List Ordering and Grouping
|
||||
description: You can group or order your content in both your templating and content front matter.
|
||||
date: 2017-02-01
|
||||
|
@ -19,7 +19,7 @@ toc: true
|
|||
notes: This was originally going to be a separate page on the new docs site but it now makes more sense to keep everything within the templates/lists page. - rdwatters, 2017-03-12.
|
||||
---
|
||||
|
||||
In Hugo, A list template is any template that will be used to render multiple pieces of content in a single HTML page.
|
||||
In Hugo, a list template is any template that will be used to render multiple pieces of content in a single HTML page.
|
||||
|
||||
## Example List Templates
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ This means the partial will *only* be able to access those variables. The partia
|
|||
|
||||
## Returning a value from a Partial
|
||||
|
||||
In addition to outputting markup, partials can be used to return a value of any type. In order to return a value, a partial must include a lone `return` statement.
|
||||
In addition to outputting markup, partials can be used to return a value of any type. In order to return a value, a partial must include a lone `return` statement _at the end of the partial_.
|
||||
|
||||
### Example GetFeatured
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ The hook kinds currently supported are:
|
|||
* `image`
|
||||
* `link`
|
||||
* `heading` {{< new-in "0.71.0" >}}
|
||||
* `codeblock`{{< new-in "0.83.0" >}}
|
||||
* `codeblock`{{< new-in "0.93.0" >}}
|
||||
|
||||
You can define [Output-Format-](/templates/output-formats) and [language-](/content-management/multilingual/)specific templates if needed. Your `layouts` folder may look like this:
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
---
|
||||
title: Sitemap Template
|
||||
# linktitle: Sitemap
|
||||
description: Hugo ships with a built-in template file observing the v0.9 of the Sitemap Protocol, but you can override this template if needed.
|
||||
title: Sitemap Templates
|
||||
description: Hugo provides built-in sitemap templates.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates]
|
||||
keywords: [sitemap, xml, templates]
|
||||
menu:
|
||||
|
@ -15,92 +12,76 @@ weight: 160
|
|||
sections_weight: 160
|
||||
draft: false
|
||||
aliases: [/layout/sitemap/,/templates/sitemap/]
|
||||
toc: false
|
||||
toc: true
|
||||
---
|
||||
|
||||
A single Sitemap template is used to generate the `sitemap.xml` file.
|
||||
Hugo automatically comes with this template file. *No work is needed on
|
||||
the users' part unless they want to customize `sitemap.xml`.*
|
||||
## Overview
|
||||
|
||||
A sitemap is a `Page` and therefore has all the [page variables][pagevars] available to use in this template along with Sitemap-specific ones:
|
||||
Hugo's built-in sitemap templates conform to v0.9 of the [sitemap protocol].
|
||||
|
||||
`.Sitemap.ChangeFreq`
|
||||
: The page change frequency
|
||||
With a monolingual project, Hugo generates a sitemap.xml file in the root of the [`publishDir`] using the built-in [sitemap.xml] template.
|
||||
|
||||
`.Sitemap.Priority`
|
||||
: The priority of the page
|
||||
With a multilingual project, Hugo generates:
|
||||
|
||||
`.Sitemap.Filename`
|
||||
: The sitemap filename
|
||||
- A sitemap.xml file in the root of each site (language) using the built-in [sitemap.xml] template
|
||||
- A sitemap.xml file in the root of the [`publishDir`] using the built-in [sitemapindex.xml] template
|
||||
|
||||
If provided, Hugo will use `/layouts/sitemap.xml` instead of the internal `sitemap.xml` template that ships with Hugo.
|
||||
## Configuration
|
||||
|
||||
## Sitemap Templates
|
||||
|
||||
Hugo has built-on Sitemap templates, but you can provide your own if needed, in either `layouts/sitemap.xml` or `layouts/_default/sitemap.xml`.
|
||||
|
||||
For multilingual sites, we also create a Sitemap index. You can provide a custom layout for that in either `layouts/sitemapindex.xml` or `layouts/_default/sitemapindex.xml`.
|
||||
|
||||
## Hugo’s sitemap.xml
|
||||
|
||||
This template respects the version 0.9 of the [Sitemap Protocol](https://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 }}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{ end }}
|
||||
</urlset>
|
||||
```
|
||||
|
||||
## 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>
|
||||
<loc>{{ .SitemapAbsURL }}</loc>
|
||||
{{ if not .LastChange.IsZero }}
|
||||
<lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
|
||||
{{ end }}
|
||||
</sitemap>
|
||||
{{ end }}
|
||||
</sitemapindex>
|
||||
```
|
||||
|
||||
## Configure `sitemap.xml`
|
||||
|
||||
Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in the site's config file, e.g.:
|
||||
Set the default values for [change frequency] and [priority], and the name of the generated file, in your site configuration.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
[sitemap]
|
||||
changefreq = "monthly"
|
||||
changefreq = 'monthly'
|
||||
filename = 'sitemap.xml'
|
||||
priority = 0.5
|
||||
filename = "sitemap.xml"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
The same fields can be specified in an individual content file's front matter in order to override the value assigned to that piece of content at render time.
|
||||
changefreq
|
||||
: How frequently a page is likely to change. Valid values are `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`, and `never`. Default is `""` (change frequency omitted from rendered sitemap).
|
||||
|
||||
filename
|
||||
: The name of the generated file. Default is `sitemap.xml`.
|
||||
|
||||
priority
|
||||
: The priority of a page relative to any other page on the site. Valid values range from 0.0 to 1.0. Default is `-1` (priority omitted from rendered sitemap).
|
||||
|
||||
[pagevars]: /variables/page/
|
||||
## Override Default Values
|
||||
|
||||
Override the default values for a given page in front matter.
|
||||
|
||||
{{< code-toggle file="news.md" fm=true >}}
|
||||
title = 'News'
|
||||
[sitemap]
|
||||
changefreq = 'weekly'
|
||||
priority = 0.8
|
||||
{{</ code-toggle >}}
|
||||
|
||||
## Override Built-in Templates
|
||||
|
||||
To override the built-in sitemap.xml template, create a new file in either of these locations:
|
||||
|
||||
- layouts/sitemap.xml
|
||||
- layouts/_default/sitemap.xml
|
||||
|
||||
When ranging through the page collection, access the _change frequency_ and _priority_ with `.Sitemap.ChangeFreq` and `.Sitemap.Priority` respectively.
|
||||
|
||||
To override the built-in sitemapindex.xml template, create a new file in either of these locations:
|
||||
|
||||
- layouts/sitemapindex.xml
|
||||
- layouts/_default/sitemapindex.xml
|
||||
|
||||
## Disable Sitemap Generation
|
||||
|
||||
You may disable sitemap generation in your site configuration:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
disableKinds = ['sitemap']
|
||||
{{</ code-toggle >}}
|
||||
|
||||
[`publishDir`]: {{< relref "getting-started/configuration#publishdir" >}}
|
||||
[change frequency]: <https://www.sitemaps.org/protocol.html#changefreqdef>
|
||||
[priority]: <https://www.sitemaps.org/protocol.html#priority>
|
||||
[sitemap protocol]: <https://www.sitemaps.org/protocol.html>
|
||||
[sitemap.xml]: <https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/sitemap.xml>
|
||||
[sitemapindex.xml]: <https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml>
|
||||
|
|
|
@ -4,7 +4,7 @@ linktitle: Migrations
|
|||
description: A list of community-developed tools for migrating from your existing static site generator or content management system to Hugo.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
lastmod: 2022-03-26
|
||||
keywords: [migrations,jekyll,wordpress,drupal,ghost,contentful]
|
||||
menu:
|
||||
docs:
|
||||
|
@ -47,9 +47,9 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import
|
|||
## WordPress
|
||||
|
||||
- [wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter) - A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.)
|
||||
- [exitwp-for-hugo](https://github.com/wooni005/exitwp-for-hugo) - A python script which works with the xml export from WordPress and converts WordPress pages and posts to Markdown and YAML for hugo.
|
||||
- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts.
|
||||
- [wordhugopress](https://github.com/nantipov/wordhugopress) - A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotely. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one.
|
||||
- [wpxr-to-static](https://github.com/danielfdickinson/wpxr-to-static) - WordPress eXtended RSS to Static Generator Conversion, Python3 program to convert WordPress XML Export (WPXR) format files to Hugo Markdown files (with YAML metadata) and a `config.toml` for the site. Inspired by [exitwp-for-hugo](https://github.com/wooni005/exitwp-for-hugo) (a Python 2 \[EOL] script which works with the xml export from WordPress and converts WordPress pages and posts to Markdown and YAML for hugo).
|
||||
|
||||
## Medium
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="w-100">
|
||||
{{ $byLastMod := .Site.RegularPages.ByLastmod }}
|
||||
{{ $recent := ($byLastMod | last 30).Reverse }}
|
||||
{{ $leastRecent := $byLastMod | first 10 }}
|
||||
{{ $leastRecent := $byLastMod | first 10 }}
|
||||
<h2 id="last-updated">Last Updated</h2>
|
||||
{{ partial "maintenance-pages-table.html" $recent }}
|
||||
<h2 id="least-recently-updated">Least Recently Updated</h2>
|
||||
|
|
|
@ -3,7 +3,7 @@ publish = "public"
|
|||
command = "hugo --gc --minify"
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.95.0"
|
||||
HUGO_VERSION = "0.96.0"
|
||||
HUGO_ENV = "production"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
||||
|
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
|
|||
command = "hugo --gc --minify --enableGitInfo"
|
||||
|
||||
[context.split1.environment]
|
||||
HUGO_VERSION = "0.95.0"
|
||||
HUGO_VERSION = "0.96.0"
|
||||
HUGO_ENV = "production"
|
||||
|
||||
[context.deploy-preview]
|
||||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
||||
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.95.0"
|
||||
HUGO_VERSION = "0.96.0"
|
||||
|
||||
[context.branch-deploy]
|
||||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
||||
|
||||
[context.branch-deploy.environment]
|
||||
HUGO_VERSION = "0.95.0"
|
||||
HUGO_VERSION = "0.96.0"
|
||||
|
||||
[context.next.environment]
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
|
Loading…
Reference in a new issue