From 62d7b269fbe7aae608677fd684cd8d48200aaa8a Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Wed, 4 Oct 2017 10:29:02 -0400 Subject: [PATCH 01/15] Clarify that .Lastmod automatically uses .GitInfo.AuthorDate (#226) If the `lastmod` field in the content front matter is not set if `.GitInfo` is enabled, Page's .Lastmod is auto-set to .GitInfo.AuthorDate. --- content/variables/git.md | 4 ++++ content/variables/page.md | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/content/variables/git.md b/content/variables/git.md index 6ed752dad..a06ee104c 100644 --- a/content/variables/git.md +++ b/content/variables/git.md @@ -51,4 +51,8 @@ The `GitInfo` object contains the following fields: `.Subject` : commit message subject (e.g., `tpl: Add custom index function`) +## `.Lastmod` + +If the `.GitInfo` feature is enabled, **and** if the `lastmod` field in the content's front matter is not set, `.Lastmod` (on `Page`) is fetched from Git i.e. `.GitInfo.AuthorDate`. + [configuration]: /getting-started/configuration/ diff --git a/content/variables/page.md b/content/variables/page.md index 0e1313bbd..b813fc8e8 100644 --- a/content/variables/page.md +++ b/content/variables/page.md @@ -79,7 +79,12 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables. `config`. `.Lastmod` -: the date the content was last modified; `.Lastmod` pulls from the `lastmod` field in a content's front matter. If `lastmod` is not set, Hugo will default to the `date` field. See also `.ExpiryDate`, `.Date`, and `.PublishDate`. +: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter. + + - If `lastmod` is not set, and `.GitInfo` feature is disabled, the front matter `date` field will be used. + - If `lastmod` is not set, and `.GitInfo` feature is enabled, `.GitInfo.AuthorDate` will be used instead. + +See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo]. `.LinkTitle` : access when creating links to the content. If set, Hugo will use the `linktitle` from the front matter before `title`. @@ -266,3 +271,5 @@ The top-level key will be preferred. Therefore, the following method, when appli {{ $.Param "favorites.flavor" }} => vanilla ``` + +[gitinfo]: /variables/git/ From ee81931a4194721d03d850516ebd191f5ef9dabc Mon Sep 17 00:00:00 2001 From: i-give-up Date: Wed, 4 Oct 2017 22:36:03 +0800 Subject: [PATCH 02/15] Remove delimiters in YAML and TOML config examples The use of `---` and `...` delimiters in the YAML examples seem to suggest that those delimiters are necessary in a .yaml/.yml file when in fact they are optional. Also, it seems to be common practice to *not* use `---` and `...` in .yaml/.yml files. Similarly, it's less common to use `+++` in .toml files. The examples on TOML's Github repo don't use it, and Hugo-generated .toml files don't use it either. This commit removes the delimiters mentioned above to conform with the more common styles. Additionally this modifies the example for shortcut to find configuration option - add `cd` to make it clear that user has to change to the hugo site's directory first - separate the command and the output of the command --- content/getting-started/configuration.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/content/getting-started/configuration.md b/content/getting-started/configuration.md index dea4bbb48..1fe58e84a 100644 --- a/content/getting-started/configuration.md +++ b/content/getting-started/configuration.md @@ -34,10 +34,9 @@ In your `config` file, you can direct Hugo as to how you want your website rende ## YAML Configuration -The following is a typical example of a YAML configuration file. Note the document opens with 3 hyphens and closes with 3 periods. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]: +The following is a typical example of a YAML configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]: {{< code file="config.yml">}} ---- baseURL: "https://yoursite.example.com/" title: "My Hugo Site" footnoteReturnLinkContents: "↩" @@ -51,7 +50,6 @@ params: - "foo1" - "foo2" SidebarRecentLimit: 5 -... {{< /code >}} ### All Variables, YAML @@ -59,7 +57,6 @@ params: The following is the full list of Hugo-defined variables in an example YAML file. The values provided in this example represent the default values used by Hugo. {{< code file="config.yml" download="config.yml" >}} ---- archetypeDir: "archetypes" # hostname (and path) to the root, e.g. http://spf13.com/ baseURL: "" @@ -172,14 +169,13 @@ watch: true taxonomies: - category: "categories" - tag: "tags" ---- {{< /code >}} ## TOML Configuration The following is an example of a TOML configuration file. The values under `[params]` will populate the `.Site.Params` variable for use in [templates][]: -``` +{{< code file="config.toml">}} contentDir = "content" layoutDir = "layouts" publishDir = "public" @@ -195,14 +191,13 @@ title = "My Hugo Site" [params] subtitle = "Hugo is Absurdly Fast!" author = "John Doe" -``` +{{< /code >}} ### All Variables, TOML The following is the full list of Hugo-defined variables in an example TOML file. The values provided in this example represent the default values used by Hugo. {{< code file="config.toml" download="config.toml">}} -+++ archetypeDir = "archetypes" # hostname (and path) to the root, e.g. http://spf13.com/ baseURL = "" @@ -309,14 +304,18 @@ watch = true [taxonomies] category = "categories" tag = "tags" -+++ {{< /code >}} {{% note %}} If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line: ``` -~/sites/yourhugosite +cd ~/sites/yourhugosite hugo config | grep emoji +``` + +which shows output like + +``` enableemoji: true ``` {{% /note %}} From c578620b57af9b85138e5edbfc72324581adf3ab Mon Sep 17 00:00:00 2001 From: Andrew Brampton Date: Wed, 4 Oct 2017 08:11:27 -0700 Subject: [PATCH 03/15] Remove page arg from examples of ref shortcode --- content/functions/ref.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/functions/ref.md b/content/functions/ref.md index 54d938cd4..ac35cc8b7 100644 --- a/content/functions/ref.md +++ b/content/functions/ref.md @@ -11,7 +11,7 @@ menu: docs: parent: "functions" keywords: [cross references, anchors] -signature: ["ref PAGE CONTENT"] +signature: ["ref CONTENT"] workson: [] hugoversion: relatedfuncs: [relref] @@ -19,10 +19,10 @@ deprecated: false aliases: [] --- -`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink. Both functions require a `Page` object (usually satisfied with a "`.`"): +`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink: ``` -{{ relref . "about.md" }} +{{ ref "about.md" }} ``` These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref). From fc40d078d6a88535c2fac4a1f1ec706e2ac0ef5a Mon Sep 17 00:00:00 2001 From: Andrew Brampton Date: Wed, 4 Oct 2017 08:12:00 -0700 Subject: [PATCH 04/15] Remove page arg from examples of relref shortcode --- content/functions/relref.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/functions/relref.md b/content/functions/relref.md index 26ebeef71..32d7075c8 100644 --- a/content/functions/relref.md +++ b/content/functions/relref.md @@ -11,7 +11,7 @@ menu: docs: parent: "functions" keywords: [cross references, anchors] -signature: ["relref PAGE CONTENT"] +signature: ["relref CONTENT"] workson: [] hugoversion: relatedfuncs: [relref] @@ -19,10 +19,10 @@ deprecated: false aliases: [] --- -`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink. Both functions require a `Page` object (usually satisfied with a "`.`"): +`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink: ``` -{{ relref . "about.md" }} +{{ relref "about.md" }} ``` These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref). From bde95d89035a1b0be24832e81e5916f2a967fae0 Mon Sep 17 00:00:00 2001 From: Christopher Geary Date: Sat, 7 Oct 2017 12:29:09 +0100 Subject: [PATCH 05/15] Add Atlas starter kit --- content/tools/starter-kits.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/tools/starter-kits.md b/content/tools/starter-kits.md index be0d1841b..0ce81cc4e 100644 --- a/content/tools/starter-kits.md +++ b/content/tools/starter-kits.md @@ -27,6 +27,7 @@ The following starter kits are developed by active members of the Hugo community * [GOHUGO AMP][]. GoHugo AMP is a starter theme that aims to make it easy to adopt [Google's AMP Project][amp]. The starter kit comes with 40+ shortcodes and partials plus automatic structured data. The project also includes a [separate site with extensive documentation][gohugodocs]. * [Blaupause][]. Blaupause is a developer-friendly Hugo starter kit based on Gulp tasks. It comes ES6-ready with several helpers for SVG and fonts and basic structure for HTML, SCSS, and JavaScript. * [hugulp][]. hugulp is a tool to optimize the assets of a Hugo website. The main idea is to recreate the famous Ruby on Rails Asset Pipeline, which minifies, concatenates and fingerprints the assets used in your website. +* [Atlas][]. Atlas is a Hugo boilerplate designed to speed up development with support for Netlify, Netlify CMS, Gulp, Linting, SCSS, ES6 & more. It's actively maintained and contributions are always welcome. [addkit]: https://github.com/gohugoio/hugo/edit/master/docs/content/tools/starter-kits.md @@ -35,4 +36,5 @@ The following starter kits are developed by active members of the Hugo community [GOHUGO AMP]: https://github.com/wildhaber/gohugo-amp [gohugodocs]: https://gohugo-amp.gohugohq.com/ [hugulp]: https://github.com/jbrodriguez/hugulp -[Victor Hugo]: https://github.com/netlify/victor-hugo \ No newline at end of file +[Victor Hugo]: https://github.com/netlify/victor-hugo +[Atlas]: https://github.com/indigotree/atlas \ No newline at end of file From 040d8d2833c26c53cf9f0e035910821ed50e3863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 7 Oct 2017 18:38:16 +0200 Subject: [PATCH 06/15] Squashed 'themes/gohugoioTheme/' changes from cdaa89c8..6b632895 6b632895 Cache some partials git-subtree-dir: themes/gohugoioTheme git-subtree-split: 6b632895abe6a8644f528c5da780ef6caf1d48ed --- layouts/_default/baseof.html | 2 +- layouts/partials/site-nav.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index c2ea02c59..fb09c0db4 100755 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -44,7 +44,7 @@ {{ block "main" . }}{{ end }} - {{ block "footer" . }}{{ partial "site-footer.html" . }}{{ end }} + {{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }} {{ block "scripts" . }}{{- partial "site-scripts.html" . -}}{{ end }} diff --git a/layouts/partials/site-nav.html b/layouts/partials/site-nav.html index c96680e32..eabf0ea7c 100755 --- a/layouts/partials/site-nav.html +++ b/layouts/partials/site-nav.html @@ -29,7 +29,7 @@ - {{- partial "social-follow.html" . -}} + {{- partialCached "social-follow.html" . -}} From e8d259d3278a97d977a2a9c828f8f1bf586433e9 Mon Sep 17 00:00:00 2001 From: lumbric Date: Sat, 7 Oct 2017 20:54:55 +0200 Subject: [PATCH 07/15] Fix link to subsection in page --- content/content-management/menus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/content-management/menus.md b/content/content-management/menus.md index f5e2e1b5c..8de808391 100644 --- a/content/content-management/menus.md +++ b/content/content-management/menus.md @@ -18,7 +18,7 @@ toc: true --- {{% note "Lazy Blogger"%}} -If all you want is a simple menu for your sections, see the ["Section Menu for Lazy Bloggers" in Menu Templates](/templates/menu-templates/#section-menu-for-lazy-blogger). +If all you want is a simple menu for your sections, see the ["Section Menu for Lazy Bloggers" in Menu Templates](/templates/menu-templates/#section-menu-for-lazy-bloggers). {{% /note %}} You can do this: From d6dfbbc51102958247b1fc7735c2464ca5d72ada Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Tue, 10 Oct 2017 11:06:26 -0700 Subject: [PATCH 08/15] Add warning about MMark and TOCs --- content/content-management/toc.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/content-management/toc.md b/content/content-management/toc.md index f4e86d49e..681416a72 100644 --- a/content/content-management/toc.md +++ b/content/content-management/toc.md @@ -45,6 +45,10 @@ Hugo will take this Markdown and create a table of contents from `## Introductio The built-in `.TableOfContents` variables outputs a `