From cfe751dbf59e60635f83b31da5eaa0a3f1923610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 10:54:47 +0200 Subject: [PATCH 01/27] Add some build info to README --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 60a554e54..b67a1974a 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,17 @@ Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast and flexible static site generator built with love in GoLang. -## Branches +## Build -* The `master` branch is the **current Hugo version** and will be auto-deployed to [gohugo.io/](https://gohugo.io/). -* Anything not relevant to the current Hugo version goes into the `dev` branch. -* Changes in [hugo/docs](https://github.com/gohugoio/hugo/tree/master/docs) will, in general, be merged once every release, but can be manually merged/cherry picked if needed. This goes both ways. -* All contributions that is not tightly coupled with code changes, should be made directly to `hugoDocs`. -* But we also merge PRs into [hugo/docs](https://github.com/gohugoio/hugo/tree/master/docs), but preferably changes that is related to the code in the PR itself +To view the documentation site locally, you need to clone this repository with submodules: -To summarize, we have two branches in this repository: `master` (current Hugo) and `dev` (next Hugo). +```bash +git clone --recursive https://github.com/gohugoio/hugoDocs.git +``` + +Or if you already have a clone locally: + +```bash +git submodule update --init +``` +Also note that the documentation version for a given version of Hugo can also be found in the `/docs` sub-folder of the [Hugo source repository](https://github.com/gohugoio/hugo). \ No newline at end of file From b6d90a1ee06c679504d8eaff37d8fd55f25a425e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 11:12:26 +0200 Subject: [PATCH 02/27] Fix News release titles --- content/news/0-16.md | 2 +- content/news/0-17.md | 2 +- content/news/0-18.md | 2 +- content/news/0-19.md | 2 +- content/news/0-20-1.md | 2 +- content/news/0-20-2.md | 2 +- content/news/0-20-3.md | 2 +- content/news/0-20-4.md | 2 +- content/news/0-20-5.md | 2 +- content/news/0-20-6.md | 2 +- content/news/0-20-7.md | 2 +- content/news/0-20.md | 2 +- content/news/0-21.md | 2 +- content/news/0-22-1.md | 2 +- content/news/0-22.md | 2 +- content/news/0-23.md | 2 +- content/news/0-24-1.md | 2 +- content/news/0-24.md | 2 +- content/news/0-25-1.md | 2 +- content/news/0-25.md | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/content/news/0-16.md b/content/news/0-16.md index 1447ef938..366862e4d 100644 --- a/content/news/0-16.md +++ b/content/news/0-16.md @@ -1,7 +1,7 @@ --- date: 2016-06-06T13:54:06-04:00 description: "Hugo 0.16 is our best and biggest release ever. The Hugo community has outdone itself with continued performance improvements, beautiful themes and increased stability." -title: "June Release" +title: "Hugo 0.16" categories: ["Releases"] --- diff --git a/content/news/0-17.md b/content/news/0-17.md index 1288de5a9..6c5245592 100644 --- a/content/news/0-17.md +++ b/content/news/0-17.md @@ -4,7 +4,7 @@ categories: ["Releases"] date: 2016-10-07T13:54:06-04:00 description: "Hugo now supports multilingual sites with the most simple and elegant experience." link: "" -title: "October Release: Hugo is going global" +title: "0.17: Hugo is going global" draft: false --- Hugo is going global with our 0.17 release. We put a lot of thought into how we could extend Hugo diff --git a/content/news/0-18.md b/content/news/0-18.md index 7afa33339..085d7fa0f 100644 --- a/content/news/0-18.md +++ b/content/news/0-18.md @@ -3,7 +3,7 @@ date: 2016-12-30T13:54:02-04:00 categories: ["Releases"] description: "The primary new feature in Hugo 0.18 is that every piece of content is now a Page." link: "" -title: "December Hugo Release" +title: "Hugo 0.18" draft: false author: bep --- diff --git a/content/news/0-19.md b/content/news/0-19.md index 0aad6ab77..5ccc94ca0 100644 --- a/content/news/0-19.md +++ b/content/news/0-19.md @@ -3,7 +3,7 @@ date: 2017-02-27T13:53:58-04:00 categories: ["Releases"] description: "Hugo 0.19 brings native Emacs Org-mode content support, and Hugo has its own Twitter account" link: "" -title: "February Release" +title: "Hugo 0.19" draft: false author: budparr --- diff --git a/content/news/0-20-1.md b/content/news/0-20-1.md index d58db935a..53350d741 100644 --- a/content/news/0-20-1.md +++ b/content/news/0-20-1.md @@ -3,7 +3,7 @@ date: 2017-04-13T13:53:58-04:00 categories: ["Releases"] description: "Hugo 0.20.1 is a bug fix release, fixing some important regressions introduced in 0.20" link: "" -title: "April Release" +title: "Hugo 0.20.1" draft: false author: bep --- diff --git a/content/news/0-20-2.md b/content/news/0-20-2.md index 7ea9e4b91..c4aaf9d5b 100644 --- a/content/news/0-20-2.md +++ b/content/news/0-20-2.md @@ -3,7 +3,7 @@ date: 2017-04-16T13:53:58-04:00 categories: ["Releases"] description: "Hugo 0.20.2 adds support for plain text partials included into HTML templates" link: "" -title: "April Release" +title: "Hugo 0.20.2" draft: false author: bep --- diff --git a/content/news/0-20-3.md b/content/news/0-20-3.md index f0299ba01..98176f3c4 100644 --- a/content/news/0-20-3.md +++ b/content/news/0-20-3.md @@ -3,7 +3,7 @@ date: 2017-04-24T13:53:58-04:00 categories: ["Releases"] description: "This is a bug-fix release with one important fix. But it also adds some harness around GoReleaser" link: "" -title: "April Release" +title: "Hugo 0.20.3" draft: false author: bep --- diff --git a/content/news/0-20-4.md b/content/news/0-20-4.md index ae566f93c..f67939faf 100644 --- a/content/news/0-20-4.md +++ b/content/news/0-20-4.md @@ -3,7 +3,7 @@ date: 2017-04-24T17:53:58-04:00 categories: ["Releases"] description: "This is the second bug-fix release of the day, fixing a couple of issues related to the new release scripts" link: "" -title: "April Release" +title: "Hugo 0.20.4" draft: false author: bep --- diff --git a/content/news/0-20-5.md b/content/news/0-20-5.md index ca7da4cdf..dd6863982 100644 --- a/content/news/0-20-5.md +++ b/content/news/0-20-5.md @@ -3,7 +3,7 @@ date: 2017-04-25T17:53:58-04:00 categories: ["Releases"] description: "" link: "" -title: "April Release" +title: "Hugo 0.20.5" draft: false author: bep --- diff --git a/content/news/0-20-6.md b/content/news/0-20-6.md index 249ea4bac..53e4cd812 100644 --- a/content/news/0-20-6.md +++ b/content/news/0-20-6.md @@ -3,7 +3,7 @@ date: 2017-04-27T17:53:58-04:00 categories: ["Releases"] description: "" link: "" -title: "April Release" +title: "Hugo 0.20.6" draft: false author: bep --- diff --git a/content/news/0-20-7.md b/content/news/0-20-7.md index 364306a2a..5b6675806 100644 --- a/content/news/0-20-7.md +++ b/content/news/0-20-7.md @@ -3,7 +3,7 @@ date: 2017-05-03T17:53:58-04:00 categories: ["Releases"] description: "This just fixes an issue with the release scripts, no change in the binaries" link: "" -title: "May Release" +title: "Hugo 0.20.7" draft: false author: bep --- diff --git a/content/news/0-20.md b/content/news/0-20.md index dba019709..7afd02135 100644 --- a/content/news/0-20.md +++ b/content/news/0-20.md @@ -3,7 +3,7 @@ date: 2017-04-10T13:53:58-04:00 categories: ["Releases"] description: "Hugo 0.20 introduces the powerful and long sought after feature Custom Output Formats" link: "" -title: "April Release" +title: "Hugo 0.20" draft: false author: bep --- diff --git a/content/news/0-21.md b/content/news/0-21.md index 4a75affc7..ce4764341 100644 --- a/content/news/0-21.md +++ b/content/news/0-21.md @@ -3,7 +3,7 @@ date: 2017-05-22T17:53:58-04:00 categories: ["Releases"] description: "Hugo 0.21 brings full support for shortcodes per Output Format, the last vital piece of that puzzle" link: "" -title: "May Release" +title: "Hugo 0.21" draft: false author: bep --- diff --git a/content/news/0-22-1.md b/content/news/0-22-1.md index f3157dca2..b02c71592 100644 --- a/content/news/0-22-1.md +++ b/content/news/0-22-1.md @@ -3,7 +3,7 @@ date: 2017-06-13T17:53:58-04:00 categories: ["Releases"] description: "Hugo 0.22.1 fixes a couple of issues reported after the 0.22 release" link: "" -title: "June Release" +title: "Hugo 0.22.1" draft: false author: bep --- diff --git a/content/news/0-22.md b/content/news/0-22.md index c85e2e8ac..4ae92e46b 100644 --- a/content/news/0-22.md +++ b/content/news/0-22.md @@ -3,7 +3,7 @@ date: 2017-06-12T17:53:58-04:00 categories: ["Releases"] description: "Hugo 0.22 brings nested sections, by popular demand and a long sought after feature" link: "" -title: "June Release" +title: "Hugo 0.22" draft: false author: bep --- diff --git a/content/news/0-23.md b/content/news/0-23.md index 49235f733..0e14bceed 100644 --- a/content/news/0-23.md +++ b/content/news/0-23.md @@ -3,7 +3,7 @@ date: 2017-06-16T17:53:58-04:00 categories: ["Releases"] description: "Hugo 0.23 is mainly a release that handles all the small changes needed to get Hugo moved to a GitHub organisation" link: "" -title: "June Release" +title: "Hugo 0.23" draft: false author: bep --- diff --git a/content/news/0-24-1.md b/content/news/0-24-1.md index 26fdcf45f..559e1e252 100644 --- a/content/news/0-24-1.md +++ b/content/news/0-24-1.md @@ -3,7 +3,7 @@ date: 2017-06-24T17:53:58-04:00 categories: ["Releases"] description: "This release fixes some important archetype-related regressions from Hugo 0.24" link: "" -title: "June Release" +title: "Hugo 0.24.1" draft: false author: bep --- diff --git a/content/news/0-24.md b/content/news/0-24.md index 1357a213d..42f3a920c 100644 --- a/content/news/0-24.md +++ b/content/news/0-24.md @@ -3,7 +3,7 @@ date: 2017-06-17T17:53:58-04:00 categories: ["Releases"] description: "The Revival of the Archetypes!" link: "" -title: "June Release" +title: "Hugo 0.24" draft: false author: bep --- diff --git a/content/news/0-25-1.md b/content/news/0-25-1.md index f2c6c9097..40e2124a3 100644 --- a/content/news/0-25-1.md +++ b/content/news/0-25-1.md @@ -3,7 +3,7 @@ date: 2017-07-10T17:53:58-04:00 categories: ["Releases"] description: "This is a bug-fix release with a couple of important fixes" link: "" -title: "July Release" +title: "Hugo 0.25.1" draft: false author: bep --- diff --git a/content/news/0-25.md b/content/news/0-25.md index 86d445f69..c354d6099 100644 --- a/content/news/0-25.md +++ b/content/news/0-25.md @@ -3,7 +3,7 @@ date: 2017-07-07T17:53:58-04:00 categories: ["Releases"] description: "Hugo 0.25 automatically opens the page you're working on in the browser" link: "" -title: "July Release" +title: "Hugo 0.25" draft: false author: bep --- From 2b1c4197905492167e3ea45f08885059242d43be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 11:21:50 +0200 Subject: [PATCH 03/27] Update theme --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index 18141c496..e0f1476d2 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit 18141c496f18ac74bfef480403b4bbb69c44bbbe +Subproject commit e0f1476d29c089e6cfd10f1eabe72789789c1f49 From 12d6b016eecc86573b3e1d0f48740f9803810dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 13:20:50 +0200 Subject: [PATCH 04/27] Update theme --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index e0f1476d2..77d4efca8 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit e0f1476d29c089e6cfd10f1eabe72789789c1f49 +Subproject commit 77d4efca8586d9dfa77fb330c55474819c534ace From 4198189dacd56126061b679a451cebf5ab88c758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 13:26:32 +0200 Subject: [PATCH 05/27] Update theme --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index 77d4efca8..b22e739e1 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit 77d4efca8586d9dfa77fb330c55474819c534ace +Subproject commit b22e739e1b141aed91ffa55cd37dd470bb0c6d20 From a8c3988a9ba515c0c7653ac77ef17ac13242fcdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 13:33:55 +0200 Subject: [PATCH 06/27] Update theme --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index b22e739e1..fa936087d 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit b22e739e1b141aed91ffa55cd37dd470bb0c6d20 +Subproject commit fa936087dfb10cae9085e8c15b6eb1f68c22fd2c From d9612cb3561cafc3485c0426e8350f67b83ac9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 18 Jul 2017 17:21:05 +0200 Subject: [PATCH 07/27] Update theme --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index fa936087d..5dc462c17 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit fa936087dfb10cae9085e8c15b6eb1f68c22fd2c +Subproject commit 5dc462c170da817167f3817a3c701af7ce760322 From 22f4b7a44efbe700828d52faa9aa1c2cbd09e43b Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 18 Jul 2017 10:34:36 -0600 Subject: [PATCH 08/27] Add example of starting up the local server --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b67a1974a..2d25da31d 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,15 @@ Or if you already have a clone locally: ```bash git submodule update --init ``` -Also note that the documentation version for a given version of Hugo can also be found in the `/docs` sub-folder of the [Hugo source repository](https://github.com/gohugoio/hugo). \ No newline at end of file +Also note that the documentation version for a given version of Hugo can also be found in the `/docs` sub-folder of the [Hugo source repository](https://github.com/gohugoio/hugo). + +Then to view the docs in your browser, run Hugo and open up the link: +```bash +hugo serve +Started building sites ... +. +. +Serving pages from memory +Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) +Press Ctrl+C to stop +``` From 6a5ca96acd12b5d8502dffe174095f3560734a08 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 18 Jul 2017 10:21:00 -0600 Subject: [PATCH 09/27] Update displayed site name for Hub The link is correct but the displayed name has a "www." that isn't really part of the site name. --- content/contribute/development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contribute/development.md b/content/contribute/development.md index bf90f7a28..fb386d6cd 100644 --- a/content/contribute/development.md +++ b/content/contribute/development.md @@ -102,7 +102,7 @@ There are several [GUI clients](https://git-scm.com/downloads/guis) that help yo ### Install Hub on Your System (Optional) -Hub is a great tool for working with GitHub. The main site for it is [www.hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper. +Hub is a great tool for working with GitHub. The main site for it is [hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper. On a Mac, you can install [Hub](https://github.com/github/hub) using [Homebrew](https://brew.sh): From 060a5e2762960d4e39d1c714c5ba6ef48466ec3b Mon Sep 17 00:00:00 2001 From: Tobias Meyer Date: Tue, 18 Jul 2017 21:51:28 +0200 Subject: [PATCH 10/27] Correct movie title in taxonomies.md --- content/content-management/taxonomies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/content-management/taxonomies.md b/content/content-management/taxonomies.md index 78317d9f2..13dd22523 100644 --- a/content/content-management/taxonomies.md +++ b/content/content-management/taxonomies.md @@ -52,7 +52,7 @@ To continue with the example of a movie site, the following demonstrates content ``` Actor <- Taxonomy Bruce Willis <- Term - The Six Sense <- Content + The Sixth Sense <- Content Unbreakable <- Content Moonrise Kingdom <- Content Samuel L. Jackson <- Term From fd675ee554795d624e78e6e40c6099ac00014a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 19 Jul 2017 00:52:37 +0200 Subject: [PATCH 11/27] Enable RSS feed for sections --- config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.toml b/config.toml index aafb6aa00..931ad9c25 100644 --- a/config.toml +++ b/config.toml @@ -18,6 +18,7 @@ disableAliases = true [outputs] home = [ "HTML", "RSS", "REDIR" ] +section = [ "HTML", "RSS"] [mediaTypes] [mediaTypes."text/netlify"] From b897b71b079a8400e63fcc943ecf9627706cf4a6 Mon Sep 17 00:00:00 2001 From: budparr Date: Wed, 19 Jul 2017 08:42:25 -0400 Subject: [PATCH 12/27] Change copy to use sentence case All the tagline level content in this section use sentence case. This change just matches that. Signed-off-by: budparr --- content/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/_index.md b/content/_index.md index f23aa99e9..3f9ad64a4 100644 --- a/content/_index.md +++ b/content/_index.md @@ -29,7 +29,7 @@ features: - heading: Custom Outputs image_path: /images/icon-custom-outputs.svg - tagline: HTML not Enough? + tagline: HTML not enough? copy: Hugo allows you to output your content in multiple formats, including JSON or AMP, and makes it easy to create your own. sections: - heading: "100s of Themes" From b9b8abef3db26791dc922bce1fbcd8dcb5b1aafd Mon Sep 17 00:00:00 2001 From: budparr Date: Wed, 19 Jul 2017 09:13:14 -0400 Subject: [PATCH 13/27] Update theme to reflect change to home page content --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index 5dc462c17..39820e2f1 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit 5dc462c170da817167f3817a3c701af7ce760322 +Subproject commit 39820e2f14532ba49949a11b19fc94ce07223a43 From 092271c24cd41af85d795183b48b3f9fadfb8363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 19 Jul 2017 19:19:29 +0200 Subject: [PATCH 14/27] Use infinitive mood for main titles Updates #46 --- content/contribute/_index.md | 4 ++-- content/getting-started/_index.md | 4 ++-- content/getting-started/configuration.md | 2 +- content/hosting-and-deployment/hosting-on-bitbucket.md | 4 ++-- content/hosting-and-deployment/hosting-on-firebase.md | 4 ++-- content/hosting-and-deployment/hosting-on-github.md | 4 ++-- content/hosting-and-deployment/hosting-on-gitlab.md | 4 ++-- content/hosting-and-deployment/hosting-on-netlify.md | 4 ++-- content/templates/ordering-and-grouping.md | 2 +- content/templates/shortcode-templates.md | 2 +- content/themes/creating.md | 4 ++-- content/themes/customizing.md | 4 ++-- content/themes/installing-and-using-themes.md | 4 ++-- content/troubleshooting/_index.md | 4 +--- 14 files changed, 24 insertions(+), 26 deletions(-) diff --git a/content/contribute/_index.md b/content/contribute/_index.md index 1df15f6c9..c28d90cdb 100644 --- a/content/contribute/_index.md +++ b/content/contribute/_index.md @@ -1,6 +1,6 @@ --- -title: Contributing to the Hugo Project -linktitle: Contributing to Hugo +title: Contribute to the Hugo Project +linktitle: Contribute to Hugo description: Contribute to Hugo development and documentation. date: 2017-02-01 publishdate: 2017-02-01 diff --git a/content/getting-started/_index.md b/content/getting-started/_index.md index 7946fdb26..fd399173b 100644 --- a/content/getting-started/_index.md +++ b/content/getting-started/_index.md @@ -1,6 +1,6 @@ --- -title: Getting Started -linktitle: Getting Started Overview +title: Get Started +linktitle: Get Started Overview description: Quick start and guides for installing Hugo on your preferred operating system. date: 2017-02-01 publishdate: 2017-02-01 diff --git a/content/getting-started/configuration.md b/content/getting-started/configuration.md index 43baa0f0c..b11c63991 100644 --- a/content/getting-started/configuration.md +++ b/content/getting-started/configuration.md @@ -1,5 +1,5 @@ --- -title: Configuring Hugo +title: Configure Hugo linktitle: Configuration description: Often the default settings are good enough, but the config file can provide highly granular control over how your site is rendered. date: 2013-07-01 diff --git a/content/hosting-and-deployment/hosting-on-bitbucket.md b/content/hosting-and-deployment/hosting-on-bitbucket.md index 2006e696b..235f5a352 100644 --- a/content/hosting-and-deployment/hosting-on-bitbucket.md +++ b/content/hosting-and-deployment/hosting-on-bitbucket.md @@ -1,6 +1,6 @@ --- -title: Hosting on Bitbucket -linktitle: Hosting on Bitbucket +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 diff --git a/content/hosting-and-deployment/hosting-on-firebase.md b/content/hosting-and-deployment/hosting-on-firebase.md index 086b252ad..27e4ac130 100644 --- a/content/hosting-and-deployment/hosting-on-firebase.md +++ b/content/hosting-and-deployment/hosting-on-firebase.md @@ -1,6 +1,6 @@ --- -title: Hosting on Firebase -linktitle: Hosting on Firebase +title: Host on Firebase +linktitle: Host on Firebase description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API. date: 2017-03-12 publishdate: 2017-03-12 diff --git a/content/hosting-and-deployment/hosting-on-github.md b/content/hosting-and-deployment/hosting-on-github.md index c86d1e44b..7e34e1c54 100644 --- a/content/hosting-and-deployment/hosting-on-github.md +++ b/content/hosting-and-deployment/hosting-on-github.md @@ -1,6 +1,6 @@ --- -title: Hosting on GitHub -linktitle: Hosting on GitHub +title: Host on GitHub +linktitle: Host on GitHub description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with a simple shell script. date: 2014-03-21 publishdate: 2014-03-21 diff --git a/content/hosting-and-deployment/hosting-on-gitlab.md b/content/hosting-and-deployment/hosting-on-gitlab.md index 47d552a84..7f3103949 100644 --- a/content/hosting-and-deployment/hosting-on-gitlab.md +++ b/content/hosting-and-deployment/hosting-on-gitlab.md @@ -1,6 +1,6 @@ --- -title: Hosting on GitLab -linktitle: Hosting on GitLab +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 diff --git a/content/hosting-and-deployment/hosting-on-netlify.md b/content/hosting-and-deployment/hosting-on-netlify.md index 9c676d1c2..2c4a01acc 100644 --- a/content/hosting-and-deployment/hosting-on-netlify.md +++ b/content/hosting-and-deployment/hosting-on-netlify.md @@ -1,6 +1,6 @@ --- -title: Hosting on Netlify -linktitle: Hosting on Netlify +title: Host on Netlify +linktitle: Host on Netlify description: Netlify can host your Hugo site with CDN, continuous deployment, 1-click HTTPS, an admin GUI, and its own CLI. date: 2017-02-01 publishdate: 2017-02-01 diff --git a/content/templates/ordering-and-grouping.md b/content/templates/ordering-and-grouping.md index 492392d8e..300a512b3 100644 --- a/content/templates/ordering-and-grouping.md +++ b/content/templates/ordering-and-grouping.md @@ -1,5 +1,5 @@ --- -title: Ordering and Grouping Hugo Lists +title: Ordere 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 diff --git a/content/templates/shortcode-templates.md b/content/templates/shortcode-templates.md index 9e5610022..01658fd46 100644 --- a/content/templates/shortcode-templates.md +++ b/content/templates/shortcode-templates.md @@ -1,5 +1,5 @@ --- -title: Creating Your Own Shortcodes +title: Create Your Own Shortcodes linktitle: Shortcode Templates description: You can extend Hugo's built-in shortcodes by creating your own using the same templating syntax as that for single and list pages. date: 2017-02-01 diff --git a/content/themes/creating.md b/content/themes/creating.md index 5f921d303..591165679 100644 --- a/content/themes/creating.md +++ b/content/themes/creating.md @@ -1,6 +1,6 @@ --- -title: Creating a Theme -linktitle: Creating a Theme +title: Create a Theme +linktitle: Create a Theme description: The `hugo new theme` command will scaffold the beginnings of a new theme for you to get you on your way. date: 2017-02-01 publishdate: 2017-02-01 diff --git a/content/themes/customizing.md b/content/themes/customizing.md index b0fbdd064..fd81160e1 100644 --- a/content/themes/customizing.md +++ b/content/themes/customizing.md @@ -1,6 +1,6 @@ --- -title: Customizing a Theme -linktitle: Customizing a Theme +title: Customize a Theme +linktitle: Customize a Theme description: Customize a theme by overriding theme layouts and static assets in your top-level project directories. date: 2017-02-01 publishdate: 2017-02-01 diff --git a/content/themes/installing-and-using-themes.md b/content/themes/installing-and-using-themes.md index f1e35477b..4c99433c3 100644 --- a/content/themes/installing-and-using-themes.md +++ b/content/themes/installing-and-using-themes.md @@ -1,6 +1,6 @@ --- -title: Installing and Using Themes -linktitle: Installing and Using Themes +title: Install and Use Themes +linktitle: Install and Use Themes description: Install and use a theme from the Hugo theme showcase easily through the CLI. date: 2017-02-01 publishdate: 2017-02-01 diff --git a/content/troubleshooting/_index.md b/content/troubleshooting/_index.md index 614ea209a..308e969bd 100644 --- a/content/troubleshooting/_index.md +++ b/content/troubleshooting/_index.md @@ -1,7 +1,5 @@ --- -title: Troubleshooting -linktitle: Troubleshooting -description: Frequently asked questions and known issues pulled from the Hugo Discuss forum. +title: Troubleshoot linktitle: Troubleshoot description: Frequently asked questions and known issues pulled from the Hugo Discuss forum. date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 From 2bdc771063b716a93da086aa33f532f79d3a1ed3 Mon Sep 17 00:00:00 2001 From: Ricardo N Feliciano Date: Wed, 19 Jul 2017 14:13:51 -0400 Subject: [PATCH 15/27] Clarify .Data.Pages sorting in lists.md --- content/templates/lists.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/templates/lists.md b/content/templates/lists.md index def088ebe..8c0d353a4 100644 --- a/content/templates/lists.md +++ b/content/templates/lists.md @@ -217,7 +217,7 @@ This list template has been modified slightly from a template originally used in Hugo lists render the content based on metadata you provide in [front matter][]. In addition to sane defaults, Hugo also ships with multiple methods to make quick work of ordering content inside list templates: -### Default List Ordering: Weight > Date +### Default: Weight > Date > LinkTitle > FilePath {{% code file="layouts/partials/default-order.html" %}} ```html @@ -648,4 +648,4 @@ Using `first` and `where` together can be very powerful: [taxvars]: /variables/taxonomy/ [views]: /templates/views/ [wherefunction]: /functions/where/ -[wherekeyword]: https://www.techonthenet.com/sql/where.php \ No newline at end of file +[wherekeyword]: https://www.techonthenet.com/sql/where.php From 4c44ee1c8bc454b619225b666e0030f88926e067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 19 Jul 2017 20:35:26 +0200 Subject: [PATCH 16/27] Fix broken content file Updates #46 --- content/troubleshooting/_index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/troubleshooting/_index.md b/content/troubleshooting/_index.md index 308e969bd..8900d78e2 100644 --- a/content/troubleshooting/_index.md +++ b/content/troubleshooting/_index.md @@ -1,5 +1,7 @@ --- -title: Troubleshoot linktitle: Troubleshoot description: Frequently asked questions and known issues pulled from the Hugo Discuss forum. +title: Troubleshoot +linktitle: Troubleshoot +description: Frequently asked questions and known issues pulled from the Hugo Discuss forum. date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 From 8bcf8a1961f9760f154663a5b0276f740cfbef8c Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Wed, 19 Jul 2017 21:04:03 +0200 Subject: [PATCH 17/27] Add contributing section to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 2d25da31d..95711c73d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast and flexible static site generator built with love in GoLang. +## Contributing + +We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you. + +Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository. + +*Pull requests shall only contain changes to the actual documentation. However, changes on the code base of Hugo and the documentation shall remain a single, atomic pull requests in the [hugo](https://github.com/gohugoio/hugo) repository.* + + ## Build To view the documentation site locally, you need to clone this repository with submodules: From 8f439c282bb70e0084fbef00fa7395c881935c0f Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Wed, 19 Jul 2017 21:13:13 +0200 Subject: [PATCH 18/27] Edit contributing section in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95711c73d..eba081c96 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ We welcome contributions to Hugo of any kind including documentation, suggestion Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository. -*Pull requests shall only contain changes to the actual documentation. However, changes on the code base of Hugo and the documentation shall remain a single, atomic pull requests in the [hugo](https://github.com/gohugoio/hugo) repository.* +*Pull requests shall **only** contain changes to the actual documentation. However, changes on the code base of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.* ## Build From b92c2042007dee7e37e961ffac760902378971be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 19 Jul 2017 21:32:14 +0200 Subject: [PATCH 19/27] Update theme --- themes/gohugoioTheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index 39820e2f1..6ddf4d83c 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit 39820e2f14532ba49949a11b19fc94ce07223a43 +Subproject commit 6ddf4d83cafd7fc6655e4623a6f5f90fe5bc1126 From 1473b1d91ae96f95344741bd0cf7299c45c01a3f Mon Sep 17 00:00:00 2001 From: Jeremiah Valenzuela Date: Wed, 19 Jul 2017 17:06:33 -0500 Subject: [PATCH 20/27] Remove redundant text --- content/readfiles/bfconfig.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/readfiles/bfconfig.md b/content/readfiles/bfconfig.md index 818bf079a..67b349f83 100644 --- a/content/readfiles/bfconfig.md +++ b/content/readfiles/bfconfig.md @@ -11,7 +11,7 @@ `angledQuotes` : default: **`false`**
Blackfriday flag: **`HTML_SMARTYPANTS_ANGLED_QUOTES`**
- Purpose: `true` enables smart, angled double quotes. Example: "Hugo" renders to renders to «Hugo» instead of “Hugo”. + Purpose: `true` enables smart, angled double quotes. Example: "Hugo" renders to «Hugo» instead of “Hugo”. `fractions` : default: **`true`**
@@ -52,4 +52,4 @@ : default: **`[]`**
Blackfriday flag: **`EXTENSION_*`**
Purpose: Enable one or more of Blackfriday's Markdown extensions (if they aren't Hugo defaults).
- Example: Include `autoHeaderIds` as `false` in the list to disable Blackfriday's `EXTENSION_AUTO_HEADER_IDS`. \ No newline at end of file + Example: Include `autoHeaderIds` as `false` in the list to disable Blackfriday's `EXTENSION_AUTO_HEADER_IDS`. From a1b2fd3bdcdd42871721a24614e6fe442594aa57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 20 Jul 2017 08:28:53 +0200 Subject: [PATCH 21/27] Remove the code fence language codes See #61 --- content/content-management/archetypes.md | 20 ++--- content/content-management/authors.md | 16 ++-- content/content-management/comments.md | 4 +- .../content-management/cross-references.md | 16 ++-- content/content-management/formats.md | 12 +-- content/content-management/front-matter.md | 8 +- content/content-management/menus.md | 10 +-- content/content-management/multilingual.md | 14 ++-- content/content-management/organization.md | 16 ++-- content/content-management/sections.md | 2 +- content/content-management/shortcodes.md | 58 +++++++-------- content/content-management/summaries.md | 2 +- content/content-management/taxonomies.md | 16 ++-- content/content-management/toc.md | 6 +- content/content-management/types.md | 2 +- content/content-management/urls.md | 22 +++--- content/contribute/development.md | 54 +++++++------- content/contribute/documentation.md | 50 ++++++------- content/contribute/themes.md | 6 +- content/functions/GetPage.md | 2 +- content/functions/abslangurl.md | 2 +- content/functions/absurl.md | 4 +- content/functions/adddate.md | 4 +- content/functions/after.md | 4 +- content/functions/apply.md | 14 ++-- content/functions/base64.md | 6 +- content/functions/chomp.md | 2 +- content/functions/countrunes.md | 2 +- content/functions/countwords.md | 2 +- content/functions/default.md | 14 ++-- content/functions/delimit.md | 10 +-- content/functions/dict.md | 4 +- content/functions/findRe.md | 2 +- content/functions/first.md | 2 +- content/functions/format.md | 2 +- content/functions/i18n.md | 2 +- content/functions/imageConfig.md | 2 +- content/functions/index-function.md | 8 +- content/functions/intersect.md | 4 +- content/functions/len.md | 4 +- content/functions/math.md | 6 +- content/functions/md5.md | 4 +- content/functions/now.md | 4 +- content/functions/partialCached.md | 2 +- content/functions/printf.md | 2 +- content/functions/querify.md | 4 +- content/functions/readfile.md | 2 +- content/functions/ref.md | 2 +- content/functions/relLangURL.md | 2 +- content/functions/relref.md | 2 +- content/functions/relurl.md | 4 +- content/functions/render.md | 2 +- content/functions/replacere.md | 2 +- content/functions/safeHTML.md | 6 +- content/functions/safeHTMLAttr.md | 2 +- content/functions/safeURL.md | 10 +-- content/functions/seq.md | 4 +- content/functions/sha.md | 4 +- content/functions/shuffle.md | 4 +- content/functions/slice.md | 2 +- content/functions/sort.md | 2 +- content/functions/time.md | 2 +- content/functions/union.md | 4 +- content/functions/uniq.md | 2 +- content/functions/unix.md | 2 +- content/functions/urlize.md | 6 +- content/functions/where.md | 18 ++--- content/functions/with.md | 2 +- content/getting-started/configuration.md | 18 ++--- .../getting-started/directory-structure.md | 2 +- content/getting-started/installing.md | 46 ++++++------ content/getting-started/quick-start.md | 72 +++++++++--------- content/getting-started/usage.md | 20 ++--- .../deployment-with-rsync.md | 12 +-- .../deployment-with-wercker.md | 28 +++---- .../hosting-on-bitbucket.md | 12 +-- .../hosting-on-firebase.md | 12 +-- .../hosting-on-github.md | 18 ++--- .../hosting-on-gitlab.md | 6 +- .../hosting-on-netlify.md | 4 +- content/news/0-22-1.md | 4 +- content/news/0-22.md | 2 +- content/news/0-24.md | 4 +- content/news/0-25.md | 2 +- content/news/release-notes.md | 8 +- content/templates/404.md | 4 +- content/templates/alternatives.md | 2 +- content/templates/base.md | 8 +- content/templates/data-templates.md | 12 +-- content/templates/files.md | 10 +-- content/templates/homepage.md | 2 +- content/templates/internal.md | 18 ++--- content/templates/introduction.md | 74 +++++++++---------- content/templates/lists.md | 66 ++++++++--------- content/templates/lookup-order.md | 8 +- content/templates/menu-templates.md | 8 +- content/templates/ordering-and-grouping.md | 54 +++++++------- content/templates/output-formats.md | 10 +-- content/templates/pagination.md | 6 +- content/templates/partials.md | 6 +- content/templates/robots.md | 4 +- content/templates/rss.md | 10 +-- content/templates/section-templates.md | 12 +-- content/templates/shortcode-templates.md | 50 ++++++------- content/templates/single-page-templates.md | 2 +- content/templates/sitemap-template.md | 4 +- content/templates/taxonomy-templates.md | 24 +++--- content/templates/template-debugging.md | 12 +-- content/templates/views.md | 8 +- content/themes/creating.md | 2 +- content/themes/customizing.md | 8 +- content/themes/installing-and-using-themes.md | 12 +-- content/tools/syntax-highlighting.md | 18 ++--- .../accented-characters-in-urls.md | 2 +- content/troubleshooting/eof-error.md | 2 +- content/variables/page.md | 14 ++-- content/variables/site.md | 4 +- content/variables/taxonomy.md | 2 +- 118 files changed, 643 insertions(+), 643 deletions(-) diff --git a/content/content-management/archetypes.md b/content/content-management/archetypes.md index d6d30b3f3..1c473b6b7 100644 --- a/content/content-management/archetypes.md +++ b/content/content-management/archetypes.md @@ -31,14 +31,14 @@ See above The `hugo new` generator for archetypes assumes your working directory is the content folder at the root of your project. Hugo is able to infer the appropriate archetype by assuming the content type from the content section passed to the CLI command: -```bash +``` hugo new / ``` We can use this pattern to create a new `.md` file in the `posts` section: {{% code file="archetype-example.sh" %}} -```bash +``` hugo new posts/my-first-post.md ``` {{% /code %}} @@ -50,7 +50,7 @@ To override the content type Hugo infers from `[content-section]`, add the `--ki Running this command in a new site that does not have default or custom archetypes will create the following file: {{% output file="content/posts/my-first-post.md" %}} -```toml +``` +++ date = "2017-02-01T19:20:04-07:00" title = "my first post" @@ -101,7 +101,7 @@ When you create a new Hugo project using `hugo new site`, you'll notice that Hug The following examples are from a site that's using `tags` and `categories` as [taxonomies][]. If we assume that all content files will require these two key-values, we can create a `default.md` archetype that *extends* Hugo's base archetype. In this example, we are including "golang" and "hugo" as tags and "web development" as a category. {{% code file="archetypes/default.md" %}} -```toml +``` +++ tags = ["golang", "hugo"] categories = ["web development"] @@ -118,7 +118,7 @@ If you get an `EOF error` when using `hugo new`, add a carriage return after the With an `archetypes/default.md` in place, we can use the CLI to create a new post in the `posts` content section: {{% code file="new-post-from-default.sh" %}} -```bash +``` $ hugo new posts/my-new-post.md ``` {{% /code %}} @@ -126,7 +126,7 @@ $ hugo new posts/my-new-post.md Hugo then creates a new markdown file with the following front matter: {{% output file="content/posts/my-new-post.md" %}} -```toml +``` +++ categories = ["web development"] date = "2017-02-01T19:20:04-07:00" @@ -149,7 +149,7 @@ Suppose your site's `posts` section requires more sophisticated front matter tha ### Create a Custom Archetype {{% code file="archetypes/posts.md"%}} -```toml +``` +++ description = "" tags = "" @@ -163,7 +163,7 @@ categories = "" With an `archetypes/posts.md` in place, you can use the Hugo CLI to create a new post with your preconfigured front matter in the `posts` content section: {{% code file="new-post-from-custom.sh" %}} -```bash +``` $ hugo new posts/post-from-custom.md ``` {{% /code %}} @@ -171,7 +171,7 @@ $ hugo new posts/post-from-custom.md This time, Hugo recognizes our custom `archetypes/posts.md` archetype and uses it instead of `archetypes/default.md`. The generated file will now include the full list of front matter parameters, as well as the base archetype's `title` and `date`: {{% output file="content/posts/post-from-custom-archetype.md" %}} -```toml +``` +++ categories = "" date = 2017-02-13T17:24:43-08:00 @@ -187,7 +187,7 @@ title = "post from custom archetype" As an example of archetypes in practice, the following is the `functions` archetype from the Hugo docs: {{% code file="archetypes/functions.md" %}} -```yaml +``` {{< readfile file="/themes/gohugoioTheme/archetypes/functions.md" >}} ``` {{% /code %}} diff --git a/content/content-management/authors.md b/content/content-management/authors.md index 80a783912..85606df81 100644 --- a/content/content-management/authors.md +++ b/content/content-management/authors.md @@ -31,7 +31,7 @@ You can create a profile containing metadata for each author on your website. Th Let's suppose Alice Allison is a blogger. A simple unique identifier would be `alice`. Now, we have to create a file called `alice.toml` in the `data/_authors/` directory. The following example is the standardized template written in TOML: {{% code file="data/_authors/alice.toml" %}} -```toml +``` givenName = "Alice" # or firstName as alias familyName = "Allison" # or lastName as alias displayName = "Alice Allison" @@ -67,7 +67,7 @@ The `params` section can contain arbitrary data much like the same-named section Earlier it was mentioned that content can be associated with an author through their corresponding identifier. In our case, blogger Alice has the identifier `alice`. In the front matter of a content file, you can create a list of identifiers and assign it to the `authors` variable. Here are examples for `alice` using YAML and TOML, respectively. -```yaml +``` --- title: Why Hugo is so Awesome date: 2016-08-22T14:27:502:00 @@ -77,7 +77,7 @@ authors: ["alice"] Nothing to read here. Move along... ``` -```toml +``` +++ title = Why Hugo is so Awesome date = "2016-08-22T14:27:502:00" @@ -117,7 +117,7 @@ This is can be done with the `.Social.URL` function. Its only parameter is the n Most articles feature a small section with information about the author at the end. Let's create one containing the author's name, a thumbnail, a (summarized) biography and links to all social networks: {{% code file="layouts/partials/author-info.html" download="author-info.html" %}} -```html +``` {{ with .Author }}

{{ .DisplayName }}

{{ .DisplayName }} @@ -137,12 +137,12 @@ That question can be answered with a list of all authors and another list contai In order to let Hugo know that we want to group content based on their author, we have to create a new taxonomy called `author` (the name corresponds to the variable in the front matter). Here is the snippet in a `config.yaml` and `config.toml`, respectively: -```yaml +``` taxonomies: author: authors ``` -```toml +``` [taxonomies] author = "authors" ``` @@ -153,7 +153,7 @@ taxonomies: In the next step we can create a template to list all authors of your website. Later, the list can be accessed at `www.example.com/authors/`. Create a new template in the `layouts/taxonomy/` directory called `authors.term.html`. This template will be exclusively used for this taxonomy. {{% code file="layouts/taxonomy/author.term.html" download="author.term.html" %}} -```html +```
    {{ range $author, $v := .Data.Terms }} {{ $profile := $.Authors.Get $author }} @@ -176,7 +176,7 @@ Last but not least, we have to create the second list that contains all publicat The layout for this page can be defined in the template `layouts/taxonomy/author.html`. {{% code file="layouts/taxonomy/author.html" download="author.html" %}} -```html +``` {{ range .Data.Pages }}

    {{ .Title }}

    written by {{ .Author.DisplayName }} diff --git a/content/content-management/comments.md b/content/content-management/comments.md index 33387e570..2db449738 100644 --- a/content/content-management/comments.md +++ b/content/content-management/comments.md @@ -29,11 +29,11 @@ Hugo comes with all the code you need to load Disqus into your templates. Before Disqus comments require you set a single value in your [site's configuration file][configuration]. The following show the configuration variable in a `config.toml` and `config.yml`, respectively: -```toml +``` disqusShortname = "yourdiscussshortname" ``` -```yaml +``` disqusShortname: "yourdiscussshortname" ``` diff --git a/content/content-management/cross-references.md b/content/content-management/cross-references.md index 9a2795330..acecc56d3 100644 --- a/content/content-management/cross-references.md +++ b/content/content-management/cross-references.md @@ -20,7 +20,7 @@ toc: true ## Use `ref` and `relref` -```md +``` {{}} {{}} {{}} @@ -35,14 +35,14 @@ The single parameter to `ref` is a string with a content `documentname` (e.g., ` The `documentname` is the name of a document, including the format extension; this may be just the filename, or the relative path from the `content/` directory. With a document `content/blog/post.md`, either format will produce the same result: -```md +``` {{}} => `/blog/post/` {{}} => `/blog/post/` ``` If you have the same filename used across multiple sections, you should only use the relative path format; otherwise, the behavior will be `undefined`. This is best illustrated with an example `content` directory: -```bash +``` . └── content ├── events @@ -58,7 +58,7 @@ If you have the same filename used across multiple sections, you should only use To be sure to get the correct reference in this case, use the full path: {{% code file="content/meta/my-article.md" copy="false" %}} -```md +``` {{}} => /events/my-birthday/ ``` {{% /code %}} @@ -66,7 +66,7 @@ To be sure to get the correct reference in this case, use the full path: {{< todo >}}Remove this warning when https://github.com/gohugoio/hugo/issues/3703 is released.{{< /todo >}} A relative document name must *not* begin with a slash (`/`). -```md +``` {{}} => "" ``` @@ -82,14 +82,14 @@ If the page exists in multiple [output formats][], `ref` or `relref` can be used When an `anchor` is provided by itself, the current page’s unique identifier will be appended; when an `anchor` is provided appended to `documentname`, the found page's unique identifier will be appended: -```md +``` {{}} => #anchors:9decaf7 {{}} => /blog/post/#who:badcafe ``` The above examples render as follows for this very page as well as a reference to the "Content" heading in the Hugo docs features pageyoursite -```md +``` {{}} => #who:9decaf7 {{}} => /blog/post/#who:badcafe ``` @@ -113,7 +113,7 @@ Ensuring heading uniqueness across the site is accomplished with a unique identi `ref` and `relref` were added so you can make these reference links without having to know the document’s unique identifier. (The links in document tables of contents are automatically up-to-date with this value.) -```md +``` {{}} /content-management/cross-references/#hugo-heading-anchors:77cd9ea530577debf4ce0f28c8dca242 ``` diff --git a/content/content-management/formats.md b/content/content-management/formats.md index ae6276db3..f3b6f8a6c 100644 --- a/content/content-management/formats.md +++ b/content/content-management/formats.md @@ -42,7 +42,7 @@ Hugo supports [GitHub-styled task lists (i.e., TODO lists)][gfmtasks] for the Bl #### Example Task List Input {{% code file="content/my-to-do-list.md" %}} -```markdown +``` - [ ] a task list item - [ ] list syntax required - [ ] incomplete @@ -54,7 +54,7 @@ Hugo supports [GitHub-styled task lists (i.e., TODO lists)][gfmtasks] for the Bl The preceding markdown produces the following HTML in your rendered website: -```html +```
    • a task list item
    • list syntax required
    • @@ -98,7 +98,7 @@ As Hugo ships with Mmark, using the syntax is as easy as changing the extension In the event that you want to only use Mmark in specific files, you can also define the Mmark syntax in your content's front matter: -```yaml +``` --- title: My Post date: 2017-04-01 @@ -121,7 +121,7 @@ This is not an introduction into actually using MathJax to render typeset mathem The first step is to enable MathJax on pages that you would like to have typeset math. There are multiple ways to do this (adventurous readers can consult the [Loading and Configuring](http://docs.mathjax.org/en/latest/configuration.html) section of the MathJax documentation for additional methods of including MathJax), but the easiest way is to use the secure MathJax CDN by include a ` ``` @@ -150,7 +150,7 @@ There are multiple ways to remedy this problem. One solution is to simply escape Another option is to tell Markdown to treat the MathJax code as verbatim code and not process it. One way to do this is to wrap the math expression inside a `
      ` `
      ` block. Markdown would ignore these sections and they would get passed directly on to MathJax and processed correctly. This works great for display style mathematics, but for inline math expressions the line break induced by the `
      ` is not acceptable. The syntax for instructing Markdown to treat inline text as verbatim is by wrapping it in backticks (`` ` ``). You might have noticed, however, that the text included in between backticks is rendered differently than standard text (on this site these are items highlighted in red). To get around this problem, we could create a new CSS entry that would apply standard styling to all inline verbatim text that includes MathJax code. Below I will show the HTML and CSS source that would accomplish this (note this solution was adapted from [this blog post](http://doswa.com/2011/07/20/mathjax-in-markdown.html)---all credit goes to the original author). {{% code file="mathjax-markdown-solution.html" %}} -```js +``` ``` @@ -270,7 +270,7 @@ To embed slides from [Speaker Deck][], click on "< /> Embed" (u Extract the value from the field `data-id` and pass it to the shortcode: {{% code file="speakerdeck-example-input.md" %}} -```md +``` {{}} ``` {{% /code %}} @@ -278,7 +278,7 @@ Extract the value from the field `data-id` and pass it to the shortcode: #### `speakerdeck` Example Output {{% output file="speakerdeck-example-input.md" %}} -```html +``` {{< speakerdeck 4e8126e72d853c0060001f97 >}} ``` {{% /output %}} @@ -302,7 +302,7 @@ https://twitter.com/spf13/status/877500564405444608 Pass the tweet's ID from the URL as a parameter to the `tweet` shortcode: {{% code file="example-tweet-input.md" %}} -```md +``` {{}} ``` {{% /code %}} @@ -312,7 +312,7 @@ Pass the tweet's ID from the URL as a parameter to the `tweet` shortcode: Using the preceding `tweet` example, the following HTML will be added to your rendered website's markup: {{% output file="example-tweet-output.html" %}} -```html +``` {{< tweet 877500564405444608 >}} ``` {{% /output %}} @@ -336,7 +336,7 @@ https://vimeo.com/channels/staffpicks/146022717 Extract the ID from the video's URL and pass it to the `vimeo` shortcode: {{% code file="example-vimeo-input.md" %}} -```md +``` {{}} ``` {{% /code %}} @@ -346,7 +346,7 @@ Extract the ID from the video's URL and pass it to the `vimeo` shortcode: Using the preceding `vimeo` example, the following HTML will be added to your rendered website's markup: {{% output file="example-vimeo-output.html" %}} -```html +``` {{< vimeo 146022717 >}} ``` {{% /output %}} @@ -354,7 +354,7 @@ Using the preceding `vimeo` example, the following HTML will be added to your re {{% tip %}} If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `
      ` that wraps the ` @@ -173,7 +173,7 @@ Would load the template at `/layouts/shortcodes/youtube.html`: {{% /code %}} {{% code file="youtube-embed.html" copy="false" %}} -```html +```
      @@ -258,7 +258,7 @@ Would load the template found at `/layouts/shortcodes/vimeo.html`: Would be rendered as: {{% code file="vimeo-iframes.html" copy="false" %}} -```html +```
      @@ -273,7 +273,7 @@ Would be rendered as: The following is taken from `highlight`, which is a [built-in shortcode][] that ships with Hugo. {{% code file="highlight-example.md" %}} -```markdown +``` {{}} This HTML @@ -284,14 +284,14 @@ The following is taken from `highlight`, which is a [built-in shortcode][] that The template for the `highlight` shortcode uses the following code, which is already included in Hugo: -```golang +``` {{ .Get 0 | highlight .Inner }} ``` The rendered output of the HTML example code block will be as follows: {{% code file="syntax-highlighted.html" copy="false" %}} -```html +```
      <html>
           <body> This HTML </body>
       </html>
      @@ -310,7 +310,7 @@ Hugo's [`.Parent` shortcode variable][parent] returns a boolean value depending
       The following example is contrived but demonstrates the concept. Assume you have a `gallery` shortcode that expects one named `class` parameter:
       
       {{% code file="layouts/shortcodes/gallery.html" %}}
      -```html
      +```
       
      {{.Inner}}
      @@ -320,7 +320,7 @@ The following example is contrived but demonstrates the concept. Assume you have You also have an `image` shortcode with a single named `src` parameter that you want to call inside of `gallery` and other shortcodes so that the parent defines the context of each `image`: {{% code file="layouts/shortcodes/image.html" %}} -```html +``` {{- $src := .Get "src" -}} {{- with .Parent -}} @@ -332,7 +332,7 @@ You also have an `image` shortcode with a single named `src` parameter that you You can then call your shortcode in your content as follows: -```markdown +``` {{}} {{}} {{}} @@ -342,7 +342,7 @@ You can then call your shortcode in your content as follows: This will output the following HTML. Note how the first two `image` shortcodes inherit the `class` value of `content-gallery` set with the call to the parent `gallery`, whereas the third `image` only uses `src`: -```html +``` {{ end }} -``` -{{% /code %}} +{{< /code >}} [base]: /templates/base/ [contentorg]: /content-management/organization/ diff --git a/content/templates/internal.md b/content/templates/internal.md index dd71b3559..022e95c3c 100644 --- a/content/templates/internal.md +++ b/content/templates/internal.md @@ -90,8 +90,7 @@ Users have noticed that enabling Disqus comments when running the Hugo web serve You can create the following `layouts/partials/disqus.html`: -{{% code file="layouts/partials/disqus.html" download="disqus.html" %}} -``` +{{< code file="layouts/partials/disqus.html" download="disqus.html" >}}
      comments powered by Disqus -``` -{{% /code %}} +{{< /code >}} The `if` statement skips the initialization of the Disqus comment injection when you are running on `localhost`. diff --git a/content/templates/introduction.md b/content/templates/introduction.md index 1883d7537..647d580c4 100644 --- a/content/templates/introduction.md +++ b/content/templates/introduction.md @@ -283,8 +283,7 @@ The most easily overlooked concept to understand about Go templates is that `{{ The following shows how to define a variable independent of the context. -{{% code file="tags-range-with-page-variable.html" %}} -``` +{{< code file="tags-range-with-page-variable.html" >}} {{ $title := .Site.Title }}
        {{ range .Params.tags }} @@ -294,8 +293,7 @@ The following shows how to define a variable independent of the context. {{ end }}
      -``` -{{% /code %}} +{{< /code >}} {{% note %}} Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}` has changed. We have defined a variable outside of the loop (`{{$title}}`) that we've assigned a value so that we have access to the value from within the loop as well. @@ -305,8 +303,7 @@ Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}` `$` has special significance in your templates. `$` is set to the starting value of `.` ("the dot") by default. This is a [documented feature of Go text/template][dotdoc]. This means you have access to the global context from anywhere. Here is an equivalent example of the preceding code block but now using `$` to grab `.Site.Title` from the global context: -{{% code file="range-through-tags-w-global.html" %}} -``` +{{< code file="range-through-tags-w-global.html" >}}
        {{ range .Params.tags }}
      • @@ -315,8 +312,7 @@ Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}`
      • {{ end }}
      -``` -{{% /code %}} +{{< /code >}} {{% warning "Don't Redefine the Dot" %}} The built-in magic of `$` would cease to work if someone were to mischievously redefine the special character; e.g. `{{ $ := .Site }}`. *Don't do it.* You may, of course, recover from this mischief by using `{{ $ := . }}` in a global context to reset `$` to its default value. @@ -386,8 +382,7 @@ notoc: true Here is an example of corresponding code that could be used inside a `toc.html` [partial template][partials]: -{{% code file="layouts/partials/toc.html" download="toc.html" %}} -``` +{{< code file="layouts/partials/toc.html" download="toc.html" >}} {{ if not .Params.notoc }} {{end}} -``` -{{% /code %}} +{{< /code >}} We want the *default* behavior to be for pages to include a TOC unless otherwise specified. This template checks to make sure that the `notoc:` field in this page's front matter is not `true`. @@ -410,14 +404,12 @@ You can arbitrarily define as many site-level parameters as you want in your [si For instance, you might declare the following: -{{% code file="config.yaml" %}} -``` +{{< code file="config.yaml" >}} params: copyrighthtml: "Copyright © 2017 John Doe. All Rights Reserved." twitteruser: "spf13" sidebarrecentlimit: 5 -``` -{{% /code %}} +{{< /code >}} Within a footer layout, you might then declare a `
      ` that is only rendered if the `copyrighthtml` parameter is provided. If it *is* provided, you will then need to declare the string is safe to use via the [`safeHTML` function][safehtml] so that the HTML entity is not escaped again. This would let you easily update just your top-level config file each January 1st, instead of hunting through your templates. @@ -429,16 +421,14 @@ Within a footer layout, you might then declare a `
      ` that is only rendere An alternative way of writing the "`if`" and then referencing the same value is to use [`with`][with] instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent: -{{% code file="layouts/partials/twitter.html" %}} -``` +{{< code file="layouts/partials/twitter.html" >}} {{with .Site.Params.twitteruser}} {{end}} -``` -{{% /code %}} +{{< /code >}} Finally, you can pull "magic constants" out of your layouts as well. The following uses the [`first`][first] function, as well as the [`.RelPermalink`][relpermalink] page variable and the [`.Site.Pages`][sitevars] site variable. @@ -457,8 +447,7 @@ Finally, you can pull "magic constants" out of your layouts as well. The followi Go allows you to do more than what's shown here. Using Hugo's [`where` function][where] and Go built-ins, we can list only the items from `content/events/` whose date (set in a content file's [front matter][]) is in the future. The following is an example [partial template][partials]: -{{% code file="layouts/partials/upcoming-events.html" download="upcoming-events.html" %}} -``` +{{< code file="layouts/partials/upcoming-events.html" download="upcoming-events.html" >}}

      Upcoming Events

        {{ range where .Data.Pages.ByDate "Section" "events" }} @@ -474,8 +463,7 @@ Go allows you to do more than what's shown here. Using Hugo's [`where` function] {{ end }} {{ end }}
      -``` -{{% /code %}} +{{< /code >}} [`where` function]: /functions/where/ diff --git a/content/templates/lists.md b/content/templates/lists.md index e061fa0cb..ea05f80d9 100644 --- a/content/templates/lists.md +++ b/content/templates/lists.md @@ -79,8 +79,7 @@ The following is an example of a typical Hugo project directory's content: Using the above example, let's assume you have the following in `content/post/_index.md`: -{{% code file="content/post/_index.md" %}} -``` +{{< code file="content/post/_index.md" >}} --- title: My Golang Journey date: 2017-03-23 @@ -90,13 +89,11 @@ publishdate: 2017-03-24 I decided to start learning Golang in March 2017. Follow my journey through this new blog. -``` -{{% /code %}} +{{< /code >}} You can now access this `_index.md`'s' content in your list template: -{{% code file="layouts/_default/list.html" download="list.html" %}} -``` +{{< code file="layouts/_default/list.html" download="list.html" >}} {{ define "main" }}
      @@ -116,13 +113,11 @@ You can now access this `_index.md`'s' content in your list template:
    {{ end }} -``` -{{% /code %}} +{{< /code >}} This above will output the following HTML: -{{% code file="yoursite.com/post/index.html" copy="false" %}} -``` +{{< code file="yoursite.com/post/index.html" copy="false" >}}
    @@ -138,8 +133,7 @@ This above will output the following HTML:
-``` -{{% /code %}} +{{< /code >}} ### List Pages Without `_index.md` @@ -147,8 +141,7 @@ You do *not* have to create an `_index.md` file for every list page (i.e. sectio Using this same `layouts/_default/list.html` template and applying it to the the `quotes` section above will render the following output. Note that `quotes` does not have an `_index.md` file to pull from: -{{% code file="yoursite.com/quote/index.html" copy="false" %}} -``` +{{< code file="yoursite.com/quote/index.html" copy="false" >}}
@@ -163,8 +156,7 @@ Using this same `layouts/_default/list.html` template and applying it to the the
-``` -{{% /code %}} +{{< /code >}} {{% note %}} The default behavior of Hugo is to pluralize list titles; hence the inflection of the `quote` section to "Quotes" when called with the `.Title` [page variable](/variables/page/). You can change this via the `pluralizeListTitles` directive in your [site configuration](/getting-started/configuration/). @@ -176,8 +168,7 @@ The default behavior of Hugo is to pluralize list titles; hence the inflection o This list template has been modified slightly from a template originally used in [spf13.com](http://spf13.com/). It makes use of [partial templates][partials] for the chrome of the rendered page rather than using a [base template][base] The examples that follow also use the [content view templates][views] `li.html` or `summary.html`. -{{% code file="layouts/section/post.html" %}} -``` +{{< code file="layouts/section/post.html" >}} {{ partial "header.html" . }} {{ partial "subheader.html" . }}
@@ -192,13 +183,11 @@ This list template has been modified slightly from a template originally used in
{{ partial "footer.html" . }} -``` -{{% /code %}} +{{< /code >}} ### Taxonomy Template -{{% code file="layouts/_default/taxonomies.html" download="taxonomies.html" %}} -``` +{{< code file="layouts/_default/taxonomies.html" download="taxonomies.html" >}} {{ define "main" }}
@@ -210,8 +199,7 @@ This list template has been modified slightly from a template originally used in
{{ end }} -``` -{{% /code %}} +{{< /code >}} ## Order Content @@ -219,8 +207,7 @@ Hugo lists render the content based on metadata you provide in [front matter][]. ### Default: Weight > Date > LinkTitle > FilePath -{{% code file="layouts/partials/default-order.html" %}} -``` +{{< code file="layouts/partials/default-order.html" >}}
    {{ range .Data.Pages }}
  • @@ -229,13 +216,11 @@ Hugo lists render the content based on metadata you provide in [front matter][].
  • {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Weight -{{% code file="layouts/partials/by-weight.html" %}} -``` +{{< code file="layouts/partials/by-weight.html" >}}
    {{ range .Data.Pages.ByWeight }}
  • @@ -244,13 +229,11 @@ Hugo lists render the content based on metadata you provide in [front matter][].
  • {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Date -{{% code file="layouts/partials/by-date.html" %}} -``` +{{< code file="layouts/partials/by-date.html" >}}
    {{ range .Data.Pages.ByDate }} @@ -260,13 +243,11 @@ Hugo lists render the content based on metadata you provide in [front matter][]. {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Publish Date -{{% code file="layouts/partials/by-publish-date.html" %}} -``` +{{< code file="layouts/partials/by-publish-date.html" >}}
    {{ range .Data.Pages.ByPublishDate }} @@ -276,13 +257,11 @@ Hugo lists render the content based on metadata you provide in [front matter][]. {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Expiration Date -{{% code file="layouts/partials/by-expiry-date.html" %}} -``` +{{< code file="layouts/partials/by-expiry-date.html" >}}
    {{ range .Data.Pages.ByExpiryDate }}
  • @@ -291,13 +270,11 @@ Hugo lists render the content based on metadata you provide in [front matter][].
  • {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Last Modified Date -{{% code file="layouts/partials/by-last-mod.html" %}} -``` +{{< code file="layouts/partials/by-last-mod.html" >}}
    {{ range .Data.Pages.ByLastmod }} @@ -307,13 +284,11 @@ Hugo lists render the content based on metadata you provide in [front matter][]. {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Length -{{% code file="layouts/partials/by-length.html" %}} -``` +{{< code file="layouts/partials/by-length.html" >}}
    {{ range .Data.Pages.ByLength }} @@ -323,13 +298,11 @@ Hugo lists render the content based on metadata you provide in [front matter][]. {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Title -{{% code file="layouts/partials/by-title.html" %}} -``` +{{< code file="layouts/partials/by-title.html" >}}
    {{ range .Data.Pages.ByTitle }} @@ -339,13 +312,11 @@ Hugo lists render the content based on metadata you provide in [front matter][]. {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Link Title -{{% code file="layouts/partials/by-link-title.html" %}} -``` +{{< code file="layouts/partials/by-link-title.html" >}}
    {{ range .Data.Pages.ByLinkTitle }} @@ -355,38 +326,32 @@ Hugo lists render the content based on metadata you provide in [front matter][]. {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Parameter Order based on the specified front matter parameter. Content that does not have the specified front matter field will use the site's `.Site.Params` default. If the parameter is not found at all in some entries, those entries will appear together at the end of the ordering. -{{% code file="layouts/partials/by-rating.html" %}} -``` +{{< code file="layouts/partials/by-rating.html" >}} {{ range (.Data.Pages.ByParam "rating") }} {{ end }} -``` -{{% /code %}} +{{< /code >}} If the targeted front matter field is nested beneath another field, you can access the field using dot notation. -{{% code file="layouts/partials/by-nested-param.html" %}} -``` +{{< code file="layouts/partials/by-nested-param.html" >}} {{ range (.Data.Pages.ByParam "author.last_name") }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### Reverse Order Reversing order can be applied to any of the above methods. The following uses `ByDate` as an example: -{{% code file="layouts/partials/by-date-reverse.html" %}} -``` +{{< code file="layouts/partials/by-date-reverse.html" >}}
    {{ range .Data.Pages.ByDate.Reverse }}
  • @@ -395,8 +360,7 @@ Reversing order can be applied to any of the above methods. The following uses `
  • {{ end }}
-``` -{{% /code %}} +{{< /code >}} ## Group Content @@ -404,8 +368,7 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. ### By Page Field -{{% code file="layouts/partials/by-page-field.html" %}} -``` +{{< code file="layouts/partials/by-page-field.html" >}} {{ range .Data.Pages.GroupBy "Section" }}

{{ .Key }}

@@ -418,13 +381,11 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. {{ end }} {{ end }} -``` -{{% /code %}} +{{< /code >}} In the above example, you may want `{{.Title}}` to point the `title` field you have added to your `_index.md` file instead. You can access this value using the [`.GetPage` function][getpage]: -{{% code file="layouts/partials/by-page-field.html" %}} -``` +{{< code file="layouts/partials/by-page-field.html" >}} {{ range .Data.Pages.GroupBy "Section" }} @@ -443,13 +404,11 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h {{ end }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Date -{{% code file="layouts/partials/by-page-date.html" %}} -``` +{{< code file="layouts/partials/by-page-date.html" >}} {{ range .Data.Pages.GroupByDate "2006-01" }}

{{ .Key }}

@@ -462,13 +421,11 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h {{ end }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Publish Date -{{% code file="layouts/partials/by-page-publish-date.html" %}} -``` +{{< code file="layouts/partials/by-page-publish-date.html" >}} {{ range .Data.Pages.GroupByPublishDate "2006-01" }}

{{ .Key }}

@@ -481,13 +438,11 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h {{ end }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Page Parameter -{{% code file="layouts/partials/by-page-param.html" %}} -``` +{{< code file="layouts/partials/by-page-param.html" >}} {{ range .Data.Pages.GroupByParam "param_key" }}

{{ .Key }}

@@ -500,15 +455,13 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h {{ end }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Page Parameter in Date Format The following template takes grouping by `date` a step further and uses Golang's layout string. See the [`Format` function][] for more examples of how to use Golang's layout string to format dates in Hugo. -{{% code file="layouts/partials/by-page-param-as-date.html" %}} -``` +{{< code file="layouts/partials/by-page-param-as-date.html" >}} {{ range .Data.Pages.GroupByParamDate "param_key" "2006-01" }}

{{ .Key }}

@@ -521,8 +474,7 @@ The following template takes grouping by `date` a step further and uses Golang's {{ end }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### Reverse Key Order @@ -560,8 +512,7 @@ Here is the ordering for the example that follows: 2. Groups are listed in ascending order (i.e., the oldest groups first) 3. Pages within each respective group are ordered alphabetically according to the `title`. -{{% code file="layouts/partials/by-group-by-page.html" %}} -``` +{{< code file="layouts/partials/by-group-by-page.html" >}} {{ range .Data.Pages.GroupByDate "2006-01" "asc" }}

{{ .Key }}

    @@ -573,8 +524,7 @@ Here is the ordering for the example that follows: {{ end }}
{{ end }} -``` -{{% /code %}} +{{< /code >}} ## Filter and Limiting Lists @@ -588,13 +538,11 @@ Sometimes you only want to list a subset of the available content. A common is t 2. `key` *or* `field name` 3. `match value` -{{% code file="layouts/_default/.html" %}} -``` +{{< code file="layouts/_default/.html" >}} {{ range where .Data.Pages "Section" "post" }} {{ .Content }} {{ end }} -``` -{{% /code %}} +{{< /code >}} You can see more examples in the [functions documentation for `where`][wherefunction]. @@ -605,26 +553,22 @@ You can see more examples in the [functions documentation for `where`][wherefunc 1. `array` *or* `slice of maps or structs` 2. `number of elements` -{{% code file="layout/_default/section.html" %}} -``` +{{< code file="layout/_default/section.html" >}} {{ range first 10 .Data.Pages }} {{ .Render "summary" }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### `first` and `where` Together Using `first` and `where` together can be very powerful: -{{% code file="first-and-where-together.html" %}} -``` +{{< code file="first-and-where-together.html" >}} {{ range first 5 (where .Data.Pages "Section" "post").ByTitle }} {{ .Content }} {{ end }} -``` -{{% /code %}} +{{< /code >}} [base]: /templates/base/ [bepsays]: http://bepsays.com/en/2016/12/19/hugo-018/ diff --git a/content/templates/lookup-order.md b/content/templates/lookup-order.md index 434109360..3f4ff79a0 100644 --- a/content/templates/lookup-order.md +++ b/content/templates/lookup-order.md @@ -88,15 +88,13 @@ Only three of the four markdown files in the above project are subject to the *s ### Example: `my-first-post.md` -{{% code file="content/posts/my-first-post.md" copy="false" %}} -``` +{{< code file="content/posts/my-first-post.md" copy="false" >}} --- title: My First Post date: 2017-02-19 description: This is my first post. --- -``` -{{% /code %}} +{{< /code >}} When building your site, Hugo will go through the lookup order until it finds what it needs for `my-first-post.md`: @@ -118,8 +116,7 @@ Notice the term `UNSPECIFIED` rather than `UNDEFINED`. If you don't tell Hugo th ### Example: `my-second-post.md` -{{% code file="content/posts/my-second-post.md" copy="false" %}} -``` +{{< code file="content/posts/my-second-post.md" copy="false" >}} --- title: My Second Post date: 2017-02-21 @@ -127,8 +124,7 @@ description: This is my second post. type: review layout: reviewarticle --- -``` -{{% /code %}} +{{< /code >}} Here is the way Hugo traverses the single-page lookup order for `my-second-post.md`: @@ -152,15 +148,13 @@ Notice that the directory for the template for `my-second-post.md` is `review` a ### Example: `my-first-event.md` -{{% code file="content/events/my-first-event.md" copy="false" %}} -``` +{{< code file="content/events/my-first-event.md" copy="false" >}} --- title: My First date: 2017-02-21 description: This is an upcoming event.. --- -``` -{{% /code %}} +{{< /code >}} Here is the way Hugo traverses the single-page lookup order for `my-first-event.md`: diff --git a/content/templates/menu-templates.md b/content/templates/menu-templates.md index 5b955c2a1..eb300afe7 100644 --- a/content/templates/menu-templates.md +++ b/content/templates/menu-templates.md @@ -24,8 +24,7 @@ able to build your menu however you want. The following is an example: -{{% code file="layouts/partials/sidebar.html" download="sidebar.html" %}} -``` +{{< code file="layouts/partials/sidebar.html" download="sidebar.html" >}} -``` -{{% /code %}} +{{< /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. diff --git a/content/templates/ordering-and-grouping.md b/content/templates/ordering-and-grouping.md index cbe26d6f8..c63e83b7e 100644 --- a/content/templates/ordering-and-grouping.md +++ b/content/templates/ordering-and-grouping.md @@ -27,8 +27,7 @@ In Hugo, A list template is any template that will be used to render multiple pi This list template is used for [spf13.com](http://spf13.com/). It makes use of [partial templates][partials]. All examples use a [view](/templates/views/) called either "li" or "summary." -{{% code file="layouts/section/post.html" %}} -``` +{{< code file="layouts/section/post.html" >}} {{ partial "header.html" . }} {{ partial "subheader.html" . }} @@ -43,13 +42,11 @@ This list template is used for [spf13.com](http://spf13.com/). It makes use of [ {{ partial "footer.html" . }} -``` -{{% /code %}} +{{< /code >}} ### Taxonomy Template -{{% code file="layouts/_default/taxonomies.html" download="taxonomies.html" %}} -``` +{{< code file="layouts/_default/taxonomies.html" download="taxonomies.html" >}} {{ define "main" }}
@@ -60,8 +57,7 @@ This list template is used for [spf13.com](http://spf13.com/). It makes use of [
{{ end }} -``` -{{% /code %}} +{{< /code >}} ## Order Content @@ -72,8 +68,7 @@ your list templates: ### Default: Weight > Date -{{% code file="layouts/partials/order-default.html" %}} -``` +{{< code file="layouts/partials/order-default.html" >}}
    {{ range .Data.Pages }}
  • @@ -82,113 +77,96 @@ your list templates:
  • {{ end }}
-``` -{{% /code %}} +{{< /code >}} ### By Weight -{{% code file="layouts/partials/by-weight.html" %}} -``` +{{< code file="layouts/partials/by-weight.html" >}} {{ range .Data.Pages.ByWeight }}
  • {{ .Title }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Date -{{% code file="layouts/partials/by-date.html" %}} -``` +{{< code file="layouts/partials/by-date.html" >}} {{ range .Data.Pages.ByDate }}
  • {{ .Title }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Publish Date -{{% code file="layouts/partials/by-publish-date.html" %}} -``` +{{< code file="layouts/partials/by-publish-date.html" >}} {{ range .Data.Pages.ByPublishDate }}
  • {{ .Title }}
    {{ .PublishDate.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Expiration Date -{{% code file="layouts/partials/by-expiry-date.html" %}} -``` +{{< code file="layouts/partials/by-expiry-date.html" >}} {{ range .Data.Pages.ByExpiryDate }}
  • {{ .Title }}
    {{ .ExpiryDate.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Last Modified Date -{{% code file="layouts/partials/by-last-mod.html" %}} -``` +{{< code file="layouts/partials/by-last-mod.html" >}} {{ range .Data.Pages.ByLastmod }}
  • {{ .Title }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Length -{{% code file="layouts/partials/by-length.html" %}} -``` +{{< code file="layouts/partials/by-length.html" >}} {{ range .Data.Pages.ByLength }}
  • {{ .Title }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Title -{{% code file="layouts/partials/by-title.html" %}} -``` +{{< code file="layouts/partials/by-title.html" >}} {{ range .Data.Pages.ByTitle }}
  • {{ .Title }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Link Title -{{% code file="layouts/partials/by-link-title.html" %}} -``` +{{< code file="layouts/partials/by-link-title.html" >}} {{ range .Data.Pages.ByLinkTitle }}
  • {{ .LinkTitle }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Parameter @@ -196,39 +174,33 @@ Order based on the specified front matter parameter. Content that does not have The below example sorts a list of posts by their rating. -{{% code file="layouts/partials/by-rating.html" %}} -``` +{{< code file="layouts/partials/by-rating.html" >}} {{ range (.Data.Pages.ByParam "rating") }} {{ end }} -``` -{{% /code %}} +{{< /code >}} If the front matter field of interest is nested beneath another field, you can also get it: -{{% code file="layouts/partials/by-nested-param.html" %}} -``` +{{< code file="layouts/partials/by-nested-param.html" >}} {{ range (.Data.Pages.ByParam "author.last_name") }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### Reverse Order Reversing order can be applied to any of the above methods. The following uses `ByDate` as an example: -{{% code file="layouts/partials/by-date-reverse.html" %}} -``` +{{< code file="layouts/partials/by-date-reverse.html" >}} {{ range .Data.Pages.ByDate.Reverse }}
  • {{ .Title }}
    {{ .Date.Format "Mon, Jan 2, 2006" }}
  • {{ end }} -``` -{{% /code %}} +{{< /code >}} ## Group Content @@ -236,8 +208,7 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. ### By Page Field -{{% code file="layouts/partials/by-page-field.html" %}} -``` +{{< code file="layouts/partials/by-page-field.html" >}} {{ range .Data.Pages.GroupBy "Section" }}

    {{ .Key }}

      @@ -249,13 +220,11 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. {{ end }}
    {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Page date -{{% code file="layouts/partials/by-page-date.html" %}} -``` +{{< code file="layouts/partials/by-page-date.html" >}} {{ range .Data.Pages.GroupByDate "2006-01" }}

    {{ .Key }}

      @@ -267,13 +236,11 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. {{ end }}
    {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Page publish date -{{% code file="layouts/partials/by-page-publish-date.html" %}} -``` +{{< code file="layouts/partials/by-page-publish-date.html" >}} {{ range .Data.Pages.GroupByPublishDate "2006-01" }}

    {{ .Key }}

      @@ -285,13 +252,11 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. {{ end }}
    {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Page Param -{{% code file="layouts/partials/by-page-param.html" %}} -``` +{{< code file="layouts/partials/by-page-param.html" >}} {{ range .Data.Pages.GroupByParam "param_key" }}

    {{ .Key }}

      @@ -303,13 +268,11 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. {{ end }}
    {{ end }} -``` -{{% /code %}} +{{< /code >}} ### By Page Param in Date Format -{{% code file="layouts/partials/by-page-param-as-date.html" %}} -``` +{{< code file="layouts/partials/by-page-param-as-date.html" >}} {{ range .Data.Pages.GroupByParamDate "param_key" "2006-01" }}

    {{ .Key }}

      @@ -321,8 +284,7 @@ Hugo provides some functions for grouping pages by Section, Type, Date, etc. {{ end }}
    {{ end }} -``` -{{% /code %}} +{{< /code >}} ### Reverse Key Order @@ -358,8 +320,7 @@ Because Grouping returns a `{{.Key}}` and a slice of pages, all of the ordering In the following example, groups are ordered chronologically and then content within each group is ordered alphabetically by title. -{{% code file="layouts/partials/by-group-by-page.html" %}} -``` +{{< code file="layouts/partials/by-group-by-page.html" >}} {{ range .Data.Pages.GroupByDate "2006-01" "asc" }}

    {{ .Key }}

      @@ -371,8 +332,7 @@ within each group is ordered alphabetically by title. {{ end }}
    {{ end }} -``` -{{% /code %}} +{{< /code >}} ## Filter and Limiting Lists @@ -386,13 +346,11 @@ Sometimes you only want to list a subset of the available content. A common requ 2. `key` or `field name` 3. `match value` -{{% code file="layouts/_default/.html" %}} -``` +{{< code file="layouts/_default/.html" >}} {{ range where .Data.Pages "Section" "post" }} {{ .Content }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### `first` @@ -401,25 +359,21 @@ Sometimes you only want to list a subset of the available content. A common requ 1. `array` or `slice of maps or structs` 2. `number of elements` -{{% code file="layout/_default/section.html" %}} -``` +{{< code file="layout/_default/section.html" >}} {{ range first 10 .Data.Pages }} {{ .Render "summary" }} {{ end }} -``` -{{% /code %}} +{{< /code >}} ### `first` and `where` Together Using `first` and `where` together can be very powerful: -{{% code file="first-and-where-together.html" %}} -``` +{{< code file="first-and-where-together.html" >}} {{ range first 5 (where .Data.Pages "Section" "post") }} {{ .Content }} {{ end }} -``` -{{% /code %}} +{{< /code >}} [views]: /templates/views/ diff --git a/content/templates/partials.md b/content/templates/partials.md index ffc6e5e78..6f8f0d841 100644 --- a/content/templates/partials.md +++ b/content/templates/partials.md @@ -103,8 +103,7 @@ Note that the variant parameters are not made available to the underlying partia The following `header.html` partial template is used for [spf13.com](http://spf13.com/): -{{% code file="layouts/partials/header.html" download="header.html" %}} -``` +{{< code file="layouts/partials/header.html" download="header.html" >}} @@ -120,8 +119,7 @@ The following `header.html` partial template is used for [spf13.com](http://spf1 {{ partial "head_includes.html" . }} -``` -{{% /code %}} +{{< /code >}} {{% note %}} The `header.html` example partial was built before the introduction of block templates to Hugo. Read more on [base templates and blocks](/templates/base/) for defining the outer chrome or shell of your master templates (i.e., your site's head, header, and footer). You can even combine blocks and partials for added flexibility. @@ -131,8 +129,7 @@ The `header.html` example partial was built before the introduction of block tem The following `footer.html` partial template is used for [spf13.com](http://spf13.com/): -{{% code file="layouts/partials/footer.html" download="footer.html" %}} -``` +{{< code file="layouts/partials/footer.html" download="footer.html" >}}