From 13e64d72763bf8d6d92d4cdfc15ed45ee9debfab Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Fri, 14 Sep 2018 08:34:58 +0200 Subject: Squashed 'docs/' changes from 9b494a58c..6b00298bb 6b00298bb Remove outdated "related example" 987f1e1cd Fix dead links (#601) 96287a20a Add config option "summaryLength" (#600) ced7f2085 Adjust Over showcase e334a6354 Add new showcase: over 10435b502 Add warning about privacy options only work with internal templates (#525) 48c6b0e4d Minor grammatical fix 684670ebc Add quote 0e9fada52 Improvements to taxonomy template examples e06c4bf73 Add syntax highlighting; consistent 4-space indentation c1cb3f081 Remove dead links for custom permalinks 3e3aefd04 Fix 0a671bc3751479e74a0a9d2132736c61d239707c d65888685 fix file name in 'Add Non-content Entries to a Menu' code toggle (#547) 1a0563857 Add Solus install guide (#590) 8a0d65b0d Update Windows Installation instructions (#564) c4348636a Fix typo 0a671bc37 Add post to menu example af14497c6 Add notes for `os.Stat` (Hugo 0.47) (#557) e49f65bb3 Singular to plural cb5608dbf Update introduction.md 30b060dff Add variable re-definition example (Hugo v0.48+) 21123967e Minor edits fac3df043 Refresh the Go Templates introduction 4a9600e92 Updating URL to how-to-guide for hosting hugo site on firebase bfaa7779c add missing word c2cb5d09b Tweak 'name: weight' to 'name: date' in example (#582) 5ea938ad6 Remove some Scratch 2708dcd57 Release 0.48 e375d0f05 Merge branch 'temp48' 75e36c160 releaser: Prepare repository for 0.49-DEV a6102f253 releaser: Add release notes to /docs for release of 0.48 41fc35db4 releaser: Bump versions for release of 0.48 64b9ecc74 Spell out the npm command for installing PostCSS 19e900a17 Improved Related Content doc fe21600e7 Merge commit '844aef544c19e9d8f529b4f8144e089d0982bb34' 844aef544 Squashed 'themes/gohugoioTheme/' changes from 66249819..68ddff44 069828db8 Update git.md d881d1433 Make default "related" behavior more explicit 60b9160eb Add docs for displaying 404 page on CloudFront b72ebc760 Add .gitattributes to /resources 000cf85f4 Make the pros/cons styling consistent for summaries; use desc list ebf1da97a Add note about outputStyle compressed e3338ee91 Triple backquote syntax fix 361962a7c Add one more Blogger to Hugo tool for Windows (.NET Framework 4.5) (#540) 066606a21 Fix wrong link about Mmark Syntax Document faee70757 Added exitwp-for-hugo 6b4108051 Add hugo-wrapper to starter-kits 4695dfba2 Added Utterances as Comments Alternatives. c7ba9e3e1 Correct typo beb850d9f Release 0.47.1 1cf417c8a Merge branch 'temp471' 0843bc46c releaser: Prepare repository for 0.48-DEV 8ff5c8b70 releaser: Add release notes to /docs for release of 0.47.1 e2353434d releaser: Bump versions for release of 0.47.1 ffb1300af Update development.md c22234ea5 netlify: Minify output 5b9191c56 Release 0.47 bfd92cf52 releaser: Prepare repository for 0.48-DEV ac7acf730 releaser: Add release notes to /docs for release of 0.47 b0096099d releaser: Bump versions for release of 0.47 86a7ae459 docs: Regenerate CLI docs d2c8b72bc Merge commit 'a95896878f4b4a79448b39ce93a4e0d3258b4a43' 84de7ef59 Merge commit '3a44bf182fed5f34621f450114083a6dd7e88a07' git-subtree-dir: docs git-subtree-split: 6b00298bb26b700281df28817b6556e7480cdd1e --- config.toml | 2 +- content/en/about/hugo-and-gdpr.md | 1 + content/en/commands/hugo.md | 79 ++--- content/en/commands/hugo_benchmark.md | 68 ++-- content/en/commands/hugo_check.md | 4 +- content/en/commands/hugo_check_ulimit.md | 4 +- content/en/commands/hugo_config.md | 4 +- content/en/commands/hugo_convert.md | 4 +- content/en/commands/hugo_convert_toJSON.md | 4 +- content/en/commands/hugo_convert_toTOML.md | 4 +- content/en/commands/hugo_convert_toYAML.md | 4 +- content/en/commands/hugo_env.md | 4 +- content/en/commands/hugo_gen.md | 4 +- content/en/commands/hugo_gen_autocomplete.md | 4 +- content/en/commands/hugo_gen_chromastyles.md | 4 +- content/en/commands/hugo_gen_doc.md | 4 +- content/en/commands/hugo_gen_man.md | 4 +- content/en/commands/hugo_import.md | 4 +- content/en/commands/hugo_import_jekyll.md | 4 +- content/en/commands/hugo_list.md | 4 +- content/en/commands/hugo_list_drafts.md | 4 +- content/en/commands/hugo_list_expired.md | 4 +- content/en/commands/hugo_list_future.md | 4 +- content/en/commands/hugo_new.md | 4 +- content/en/commands/hugo_new_site.md | 4 +- content/en/commands/hugo_new_theme.md | 4 +- content/en/commands/hugo_server.md | 84 ++--- content/en/commands/hugo_version.md | 4 +- content/en/content-management/archetypes.md | 2 +- content/en/content-management/comments.md | 2 +- content/en/content-management/formats.md | 2 +- content/en/content-management/menus.md | 3 +- content/en/content-management/related.md | 106 +++--- content/en/content-management/summaries.md | 30 +- content/en/contribute/development.md | 1 - content/en/contribute/documentation.md | 11 +- content/en/functions/GetPage.md | 2 +- content/en/functions/default.md | 2 +- content/en/functions/intersect.md | 22 +- content/en/functions/os.Stat.md | 33 ++ content/en/getting-started/installing.md | 10 +- .../hosting-and-deployment/hosting-on-netlify.md | 6 +- content/en/hugo-pipes/postcss.md | 4 +- content/en/hugo-pipes/scss-sass.md | 4 + .../news/0.47-relnotes/featured-hugo-47-poster.png | Bin 0 -> 88288 bytes content/en/news/0.47-relnotes/index.md | 79 +++++ content/en/news/0.47.1-relnotes/index.md | 30 ++ .../news/0.48-relnotes/featured-hugo-48-poster.png | Bin 0 -> 95358 bytes content/en/news/0.48-relnotes/index.md | 57 ++++ content/en/showcase/over/bio.md | 5 + content/en/showcase/over/featured-over.png | Bin 0 -> 234973 bytes content/en/showcase/over/index.md | 17 + content/en/templates/404.md | 1 + content/en/templates/files.md | 6 +- content/en/templates/introduction.md | 361 ++++++++++++++------- content/en/templates/taxonomy-templates.md | 171 ++++++---- content/en/tools/migrations.md | 2 + content/en/tools/starter-kits.md | 5 +- content/en/variables/git.md | 2 +- data/articles.toml | 2 +- data/docs.json | 13 + data/references.toml | 6 + layouts/shortcodes/code.html | 12 +- netlify.toml | 10 +- resources/.gitattributes | 2 + ...d1416f654ff_88288_480x0_resize_catmullrom_2.png | Bin 0 -> 38599 bytes ...d1416f654ff_88288_640x0_resize_catmullrom_2.png | Bin 0 -> 61347 bytes ...01d64fb9889_95358_480x0_resize_catmullrom_2.png | Bin 0 -> 42776 bytes ...01d64fb9889_95358_640x0_resize_catmullrom_2.png | Bin 0 -> 67402 bytes ...dc7c9_234973_1024x512_fill_catmullrom_top_2.png | Bin 0 -> 116441 bytes ...07849dc7c9_234973_640x0_resize_catmullrom_2.png | Bin 0 -> 55485 bytes ...7c9_234973_fea71f0b8a2baebaf03af6e3be6229bb.png | Bin 0 -> 40217 bytes .../layouts/partials/docs/page-meta-data.html | 2 +- .../layouts/partials/previous-next-links.html | 16 +- .../layouts/partials/site-footer.html | 2 +- 75 files changed, 875 insertions(+), 492 deletions(-) create mode 100644 content/en/functions/os.Stat.md create mode 100644 content/en/news/0.47-relnotes/featured-hugo-47-poster.png create mode 100644 content/en/news/0.47-relnotes/index.md create mode 100644 content/en/news/0.47.1-relnotes/index.md create mode 100644 content/en/news/0.48-relnotes/featured-hugo-48-poster.png create mode 100644 content/en/news/0.48-relnotes/index.md create mode 100644 content/en/showcase/over/bio.md create mode 100644 content/en/showcase/over/featured-over.png create mode 100644 content/en/showcase/over/index.md create mode 100644 resources/.gitattributes create mode 100644 resources/_gen/images/news/0.47-relnotes/featured-hugo-47-poster_hud3879b84908b49d38ac2cd1416f654ff_88288_480x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/news/0.47-relnotes/featured-hugo-47-poster_hud3879b84908b49d38ac2cd1416f654ff_88288_640x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/news/0.48-relnotes/featured-hugo-48-poster_hub95348423e80ff144dfee01d64fb9889_95358_480x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/news/0.48-relnotes/featured-hugo-48-poster_hub95348423e80ff144dfee01d64fb9889_95358_640x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/showcase/over/featured-over_hu778fbd1f621ca5db45e30107849dc7c9_234973_1024x512_fill_catmullrom_top_2.png create mode 100644 resources/_gen/images/showcase/over/featured-over_hu778fbd1f621ca5db45e30107849dc7c9_234973_640x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/showcase/over/featured-over_hu778fbd1f621ca5db45e30107849dc7c9_234973_fea71f0b8a2baebaf03af6e3be6229bb.png diff --git a/config.toml b/config.toml index e70d55f40..8a0634467 100644 --- a/config.toml +++ b/config.toml @@ -69,7 +69,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.46" + release = "0.48" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/content/en/about/hugo-and-gdpr.md b/content/en/about/hugo-and-gdpr.md index 15352ae7c..e193e1838 100644 --- a/content/en/about/hugo-and-gdpr.md +++ b/content/en/about/hugo-and-gdpr.md @@ -28,6 +28,7 @@ toc: true Note that: * These settings have their defaults setting set to _off_, i.e. how it worked before Hugo `0.41`. You must do your own evaluation of your site and apply the appropriate settings. + * These settings work with the [internal templates](/templates/internal/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect. * We will continue this work and improve this further in future Hugo versions. ## All Privacy Settings diff --git a/content/en/commands/hugo.md b/content/en/commands/hugo.md index 18aed3b75..1f35ba594 100644 --- a/content/en/commands/hugo.md +++ b/content/en/commands/hugo.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo" slug: hugo url: /commands/hugo/ @@ -24,43 +24,44 @@ hugo [flags] ### Options ``` - -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ - -D, --buildDrafts include content marked as draft - -E, --buildExpired include expired content - -F, --buildFuture include content with publishdate in the future - --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ - --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL - --cleanDestinationDir remove files from destination not found in static directories - --config string config file (default is path/config.yaml|json|toml) - -c, --contentDir string filesystem path to content directory - --debug debug output - -d, --destination string filesystem path to write files to - --disableKinds stringSlice disable different kind of pages (home, RSS etc.) - --enableGitInfo add Git revision, date and author info to the pages - --forceSyncStatic copy all files when static is changed. - --gc enable to run some cleanup tasks (remove unused cache files) after the build - -h, --help help for hugo - --i18n-warnings print missing translations - --ignoreCache ignores the cache directory - -l, --layoutDir string filesystem path to layout directory - --log enable Logging - --logFile string log File path (if set, logging enabled automatically) - --noChmod don't sync permission mode of files - --noTimes don't sync modification time of files - --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) - --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") - --quiet build in quiet mode - --renderToMemory render to memory (only useful for benchmark testing) - -s, --source string filesystem path to read files relative from - --stepAnalysis display memory and timing of different steps of the program - --templateMetrics display metrics about template executions - --templateMetricsHints calculate some improvement hints when combined with --templateMetrics - -t, --theme string theme to use (located in /themes/THEMENAME/) - --themesDir string filesystem path to themes directory - --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ - -v, --verbose verbose output - --verboseLog verbose logging - -w, --watch watch filesystem for changes and recreate as needed + -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ + -D, --buildDrafts include content marked as draft + -E, --buildExpired include expired content + -F, --buildFuture include content with publishdate in the future + --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ + --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL + --cleanDestinationDir remove files from destination not found in static directories + --config string config file (default is path/config.yaml|json|toml) + -c, --contentDir string filesystem path to content directory + --debug debug output + -d, --destination string filesystem path to write files to + --disableKinds strings disable different kind of pages (home, RSS etc.) + --enableGitInfo add Git revision, date and author info to the pages + --forceSyncStatic copy all files when static is changed. + --gc enable to run some cleanup tasks (remove unused cache files) after the build + -h, --help help for hugo + --i18n-warnings print missing translations + --ignoreCache ignores the cache directory + -l, --layoutDir string filesystem path to layout directory + --log enable Logging + --logFile string log File path (if set, logging enabled automatically) + --minify minify any supported output format (HTML, XML etc.) + --noChmod don't sync permission mode of files + --noTimes don't sync modification time of files + --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) + --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") + --quiet build in quiet mode + --renderToMemory render to memory (only useful for benchmark testing) + -s, --source string filesystem path to read files relative from + --stepAnalysis display memory and timing of different steps of the program + --templateMetrics display metrics about template executions + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics + -t, --theme string theme to use (located in /themes/THEMENAME/) + --themesDir string filesystem path to themes directory + --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ + -v, --verbose verbose output + --verboseLog verbose logging + -w, --watch watch filesystem for changes and recreate as needed ``` ### SEE ALSO @@ -77,4 +78,4 @@ hugo [flags] * [hugo server](/commands/hugo_server/) - A high performance webserver * [hugo version](/commands/hugo_version/) - Print the version number of Hugo -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_benchmark.md b/content/en/commands/hugo_benchmark.md index 63348c36d..56debca69 100644 --- a/content/en/commands/hugo_benchmark.md +++ b/content/en/commands/hugo_benchmark.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo benchmark" slug: hugo_benchmark url: /commands/hugo_benchmark/ @@ -20,38 +20,38 @@ hugo benchmark [flags] ### Options ``` - -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ - -D, --buildDrafts include content marked as draft - -E, --buildExpired include expired content - -F, --buildFuture include content with publishdate in the future - --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ - --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL - --cleanDestinationDir remove files from destination not found in static directories - -c, --contentDir string filesystem path to content directory - -n, --count int number of times to build the site (default 13) - --cpuprofile string path/filename for the CPU profile file - -d, --destination string filesystem path to write files to - --disableKinds stringSlice disable different kind of pages (home, RSS etc.) - --enableGitInfo add Git revision, date and author info to the pages - --forceSyncStatic copy all files when static is changed. - --gc enable to run some cleanup tasks (remove unused cache files) after the build - -h, --help help for benchmark - --i18n-warnings print missing translations - --ignoreCache ignores the cache directory - -l, --layoutDir string filesystem path to layout directory - --memprofile string path/filename for the memory profile file - --noChmod don't sync permission mode of files - --noTimes don't sync modification time of files - --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) - --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") - --renderToMemory render to memory (only useful for benchmark testing) - -s, --source string filesystem path to read files relative from - --stepAnalysis display memory and timing of different steps of the program - --templateMetrics display metrics about template executions - --templateMetricsHints calculate some improvement hints when combined with --templateMetrics - -t, --theme string theme to use (located in /themes/THEMENAME/) - --themesDir string filesystem path to themes directory - --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ + -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ + -D, --buildDrafts include content marked as draft + -E, --buildExpired include expired content + -F, --buildFuture include content with publishdate in the future + --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ + --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL + --cleanDestinationDir remove files from destination not found in static directories + -c, --contentDir string filesystem path to content directory + -n, --count int number of times to build the site (default 13) + --cpuprofile string path/filename for the CPU profile file + -d, --destination string filesystem path to write files to + --disableKinds strings disable different kind of pages (home, RSS etc.) + --enableGitInfo add Git revision, date and author info to the pages + --forceSyncStatic copy all files when static is changed. + --gc enable to run some cleanup tasks (remove unused cache files) after the build + -h, --help help for benchmark + --i18n-warnings print missing translations + --ignoreCache ignores the cache directory + -l, --layoutDir string filesystem path to layout directory + --memprofile string path/filename for the memory profile file + --noChmod don't sync permission mode of files + --noTimes don't sync modification time of files + --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) + --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") + --renderToMemory render to memory (only useful for benchmark testing) + -s, --source string filesystem path to read files relative from + --stepAnalysis display memory and timing of different steps of the program + --templateMetrics display metrics about template executions + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics + -t, --theme string theme to use (located in /themes/THEMENAME/) + --themesDir string filesystem path to themes directory + --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ ``` ### Options inherited from parent commands @@ -70,4 +70,4 @@ hugo benchmark [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_check.md b/content/en/commands/hugo_check.md index 239934dc2..e8af96413 100644 --- a/content/en/commands/hugo_check.md +++ b/content/en/commands/hugo_check.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo check" slug: hugo_check url: /commands/hugo_check/ @@ -35,4 +35,4 @@ Contains some verification checks * [hugo](/commands/hugo/) - hugo builds your site * [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_check_ulimit.md b/content/en/commands/hugo_check_ulimit.md index 340a51259..5f2e265b8 100644 --- a/content/en/commands/hugo_check_ulimit.md +++ b/content/en/commands/hugo_check_ulimit.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo check ulimit" slug: hugo_check_ulimit url: /commands/hugo_check_ulimit/ @@ -39,4 +39,4 @@ hugo check ulimit [flags] * [hugo check](/commands/hugo_check/) - Contains some verification checks -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_config.md b/content/en/commands/hugo_config.md index 66f3372ac..37033bff0 100644 --- a/content/en/commands/hugo_config.md +++ b/content/en/commands/hugo_config.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo config" slug: hugo_config url: /commands/hugo_config/ @@ -39,4 +39,4 @@ hugo config [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_convert.md b/content/en/commands/hugo_convert.md index 7ed15d309..60ff1a81e 100644 --- a/content/en/commands/hugo_convert.md +++ b/content/en/commands/hugo_convert.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo convert" slug: hugo_convert url: /commands/hugo_convert/ @@ -42,4 +42,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information. * [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML * [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_convert_toJSON.md b/content/en/commands/hugo_convert_toJSON.md index 03e2f692e..2643e79fb 100644 --- a/content/en/commands/hugo_convert_toJSON.md +++ b/content/en/commands/hugo_convert_toJSON.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo convert toJSON" slug: hugo_convert_toJSON url: /commands/hugo_convert_tojson/ @@ -42,4 +42,4 @@ hugo convert toJSON [flags] * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_convert_toTOML.md b/content/en/commands/hugo_convert_toTOML.md index 9abb418bb..a3441daf4 100644 --- a/content/en/commands/hugo_convert_toTOML.md +++ b/content/en/commands/hugo_convert_toTOML.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo convert toTOML" slug: hugo_convert_toTOML url: /commands/hugo_convert_totoml/ @@ -42,4 +42,4 @@ hugo convert toTOML [flags] * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_convert_toYAML.md b/content/en/commands/hugo_convert_toYAML.md index 8d87896eb..300448b9f 100644 --- a/content/en/commands/hugo_convert_toYAML.md +++ b/content/en/commands/hugo_convert_toYAML.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo convert toYAML" slug: hugo_convert_toYAML url: /commands/hugo_convert_toyaml/ @@ -42,4 +42,4 @@ hugo convert toYAML [flags] * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_env.md b/content/en/commands/hugo_env.md index b6062724e..bed60e7bb 100644 --- a/content/en/commands/hugo_env.md +++ b/content/en/commands/hugo_env.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo env" slug: hugo_env url: /commands/hugo_env/ @@ -38,4 +38,4 @@ hugo env [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_gen.md b/content/en/commands/hugo_gen.md index 025fe5875..631163df9 100644 --- a/content/en/commands/hugo_gen.md +++ b/content/en/commands/hugo_gen.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo gen" slug: hugo_gen url: /commands/hugo_gen/ @@ -38,4 +38,4 @@ A collection of several useful generators. * [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI. * [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_gen_autocomplete.md b/content/en/commands/hugo_gen_autocomplete.md index 2d327f64d..da349c86d 100644 --- a/content/en/commands/hugo_gen_autocomplete.md +++ b/content/en/commands/hugo_gen_autocomplete.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo gen autocomplete" slug: hugo_gen_autocomplete url: /commands/hugo_gen_autocomplete/ @@ -56,4 +56,4 @@ hugo gen autocomplete [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_gen_chromastyles.md b/content/en/commands/hugo_gen_chromastyles.md index 4db33e88e..31999e25b 100644 --- a/content/en/commands/hugo_gen_chromastyles.md +++ b/content/en/commands/hugo_gen_chromastyles.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo gen chromastyles" slug: hugo_gen_chromastyles url: /commands/hugo_gen_chromastyles/ @@ -43,4 +43,4 @@ hugo gen chromastyles [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_gen_doc.md b/content/en/commands/hugo_gen_doc.md index 2abf0c5a3..0634e623b 100644 --- a/content/en/commands/hugo_gen_doc.md +++ b/content/en/commands/hugo_gen_doc.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo gen doc" slug: hugo_gen_doc url: /commands/hugo_gen_doc/ @@ -45,4 +45,4 @@ hugo gen doc [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_gen_man.md b/content/en/commands/hugo_gen_man.md index 50b72d892..c5e8e5adc 100644 --- a/content/en/commands/hugo_gen_man.md +++ b/content/en/commands/hugo_gen_man.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo gen man" slug: hugo_gen_man url: /commands/hugo_gen_man/ @@ -41,4 +41,4 @@ hugo gen man [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_import.md b/content/en/commands/hugo_import.md index 5dae58bea..208b90203 100644 --- a/content/en/commands/hugo_import.md +++ b/content/en/commands/hugo_import.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo import" slug: hugo_import url: /commands/hugo_import/ @@ -37,4 +37,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p * [hugo](/commands/hugo/) - hugo builds your site * [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_import_jekyll.md b/content/en/commands/hugo_import_jekyll.md index c61116c6f..3b600fad4 100644 --- a/content/en/commands/hugo_import_jekyll.md +++ b/content/en/commands/hugo_import_jekyll.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo import jekyll" slug: hugo_import_jekyll url: /commands/hugo_import_jekyll/ @@ -41,4 +41,4 @@ hugo import jekyll [flags] * [hugo import](/commands/hugo_import/) - Import your site from others. -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_list.md b/content/en/commands/hugo_list.md index 69c3f8aa8..556124872 100644 --- a/content/en/commands/hugo_list.md +++ b/content/en/commands/hugo_list.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo list" slug: hugo_list url: /commands/hugo_list/ @@ -40,4 +40,4 @@ List requires a subcommand, e.g. `hugo list drafts`. * [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired * [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_list_drafts.md b/content/en/commands/hugo_list_drafts.md index c5f6251fa..0a4739401 100644 --- a/content/en/commands/hugo_list_drafts.md +++ b/content/en/commands/hugo_list_drafts.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo list drafts" slug: hugo_list_drafts url: /commands/hugo_list_drafts/ @@ -39,4 +39,4 @@ hugo list drafts [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_list_expired.md b/content/en/commands/hugo_list_expired.md index 6e5bc37b0..605b5d936 100644 --- a/content/en/commands/hugo_list_expired.md +++ b/content/en/commands/hugo_list_expired.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo list expired" slug: hugo_list_expired url: /commands/hugo_list_expired/ @@ -40,4 +40,4 @@ hugo list expired [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_list_future.md b/content/en/commands/hugo_list_future.md index 4fc138442..1b0ff5ef6 100644 --- a/content/en/commands/hugo_list_future.md +++ b/content/en/commands/hugo_list_future.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo list future" slug: hugo_list_future url: /commands/hugo_list_future/ @@ -40,4 +40,4 @@ hugo list future [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_new.md b/content/en/commands/hugo_new.md index 448951c94..8487e6c45 100644 --- a/content/en/commands/hugo_new.md +++ b/content/en/commands/hugo_new.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo new" slug: hugo_new url: /commands/hugo_new/ @@ -48,4 +48,4 @@ hugo new [path] [flags] * [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton) * [hugo new theme](/commands/hugo_new_theme/) - Create a new theme -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_new_site.md b/content/en/commands/hugo_new_site.md index 65316f7cb..293e7636f 100644 --- a/content/en/commands/hugo_new_site.md +++ b/content/en/commands/hugo_new_site.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo new site" slug: hugo_new_site url: /commands/hugo_new_site/ @@ -43,4 +43,4 @@ hugo new site [path] [flags] * [hugo new](/commands/hugo_new/) - Create new content for your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_new_theme.md b/content/en/commands/hugo_new_theme.md index a7def203d..1589f6fa0 100644 --- a/content/en/commands/hugo_new_theme.md +++ b/content/en/commands/hugo_new_theme.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo new theme" slug: hugo_new_theme url: /commands/hugo_new_theme/ @@ -42,4 +42,4 @@ hugo new theme [name] [flags] * [hugo new](/commands/hugo_new/) - Create new content for your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_server.md b/content/en/commands/hugo_server.md index c3ed93bc9..005475a06 100644 --- a/content/en/commands/hugo_server.md +++ b/content/en/commands/hugo_server.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo server" slug: hugo_server url: /commands/hugo_server/ @@ -30,46 +30,46 @@ hugo server [flags] ### Options ``` - --appendPort append port to baseURL (default true) - -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ - --bind string interface to which the server will bind (default "127.0.0.1") - -D, --buildDrafts include content marked as draft - -E, --buildExpired include expired content - -F, --buildFuture include content with publishdate in the future - --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ - --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL - --cleanDestinationDir remove files from destination not found in static directories - -c, --contentDir string filesystem path to content directory - -d, --destination string filesystem path to write files to - --disableFastRender enables full re-renders on changes - --disableKinds stringSlice disable different kind of pages (home, RSS etc.) - --disableLiveReload watch without enabling live browser reload on rebuild - --enableGitInfo add Git revision, date and author info to the pages - --forceSyncStatic copy all files when static is changed. - --gc enable to run some cleanup tasks (remove unused cache files) after the build - -h, --help help for server - --i18n-warnings print missing translations - --ignoreCache ignores the cache directory - -l, --layoutDir string filesystem path to layout directory - --liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1) - --meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms") - --memstats string log memory usage to this file - --navigateToChanged navigate to changed content file on live browser reload - --noChmod don't sync permission mode of files - --noHTTPCache prevent HTTP caching - --noTimes don't sync modification time of files - --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) - -p, --port int port on which the server will listen (default 1313) - --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") - --renderToDisk render to Destination path (default is render to memory & serve from there) - -s, --source string filesystem path to read files relative from - --stepAnalysis display memory and timing of different steps of the program - --templateMetrics display metrics about template executions - --templateMetricsHints calculate some improvement hints when combined with --templateMetrics - -t, --theme string theme to use (located in /themes/THEMENAME/) - --themesDir string filesystem path to themes directory - --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ - -w, --watch watch filesystem for changes and recreate as needed (default true) + --appendPort append port to baseURL (default true) + -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ + --bind string interface to which the server will bind (default "127.0.0.1") + -D, --buildDrafts include content marked as draft + -E, --buildExpired include expired content + -F, --buildFuture include content with publishdate in the future + --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ + --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL + --cleanDestinationDir remove files from destination not found in static directories + -c, --contentDir string filesystem path to content directory + -d, --destination string filesystem path to write files to + --disableFastRender enables full re-renders on changes + --disableKinds strings disable different kind of pages (home, RSS etc.) + --disableLiveReload watch without enabling live browser reload on rebuild + --enableGitInfo add Git revision, date and author info to the pages + --forceSyncStatic copy all files when static is changed. + --gc enable to run some cleanup tasks (remove unused cache files) after the build + -h, --help help for server + --i18n-warnings print missing translations + --ignoreCache ignores the cache directory + -l, --layoutDir string filesystem path to layout directory + --liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1) + --meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms") + --memstats string log memory usage to this file + --navigateToChanged navigate to changed content file on live browser reload + --noChmod don't sync permission mode of files + --noHTTPCache prevent HTTP caching + --noTimes don't sync modification time of files + --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) + -p, --port int port on which the server will listen (default 1313) + --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") + --renderToDisk render to Destination path (default is render to memory & serve from there) + -s, --source string filesystem path to read files relative from + --stepAnalysis display memory and timing of different steps of the program + --templateMetrics display metrics about template executions + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics + -t, --theme string theme to use (located in /themes/THEMENAME/) + --themesDir string filesystem path to themes directory + --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ + -w, --watch watch filesystem for changes and recreate as needed (default true) ``` ### Options inherited from parent commands @@ -88,4 +88,4 @@ hugo server [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/commands/hugo_version.md b/content/en/commands/hugo_version.md index 308013a4f..8249cd528 100644 --- a/content/en/commands/hugo_version.md +++ b/content/en/commands/hugo_version.md @@ -1,5 +1,5 @@ --- -date: 2018-04-16 +date: 2018-08-17 title: "hugo version" slug: hugo_version url: /commands/hugo_version/ @@ -38,4 +38,4 @@ hugo version [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Aug-2018 diff --git a/content/en/content-management/archetypes.md b/content/en/content-management/archetypes.md index 904ca8c31..ff4a2d783 100644 --- a/content/en/content-management/archetypes.md +++ b/content/en/content-management/archetypes.md @@ -35,7 +35,7 @@ The above will create a new content file in `content/posts/my-first-post.md` usi 3. `themes/my-theme/archetypes/posts.md` 4. `themes/my-theme/archetypes/default.md` -The last two list items is only applicable if you use a theme and it uses the `my-theme` theme name as an example. +The last two list items are only applicable if you use a theme and it uses the `my-theme` theme name as an example. ## Create a New Archetype Template diff --git a/content/en/content-management/comments.md b/content/en/content-management/comments.md index 268dc4c0e..17914ba2c 100644 --- a/content/en/content-management/comments.md +++ b/content/en/content-management/comments.md @@ -59,7 +59,7 @@ There are a few alternatives to commenting on static sites for those who do not * [Muut](http://muut.com/) * [isso](http://posativ.org/isso/) (Self-hosted, Python) * [Tutorial on Implementing Isso with Hugo][issotutorial] - +* [Utterances](https://utteranc.es/) (Open source, Github comments widget built on Github issues) diff --git a/content/en/content-management/formats.md b/content/en/content-management/formats.md index ab9fdd781..f7a466c3c 100644 --- a/content/en/content-management/formats.md +++ b/content/en/content-management/formats.md @@ -240,7 +240,7 @@ Markdown syntax is simple enough to learn in a single sitting. The following are [mdcheatsheet]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet [mdguide]: https://www.markdownguide.org/ [mdtutorial]: http://www.markdowntutorial.com/ -[Miek Gieben's website]: https://miek.nl/2016/March/05/mmark-syntax-document/ +[Miek Gieben's website]: https://miek.nl/2016/march/05/mmark-syntax-document/ [mmark]: https://github.com/miekg/mmark [mmarkgh]: https://github.com/miekg/mmark/wiki/Syntax [org]: http://orgmode.org/ diff --git a/content/en/content-management/menus.md b/content/en/content-management/menus.md index 4278b03be..bc48c82e7 100644 --- a/content/en/content-management/menus.md +++ b/content/en/content-management/menus.md @@ -80,7 +80,7 @@ You can also add entries to menus that aren’t attached to a piece of content. Here’s an example snippet pulled from a configuration file: -{{< code-toggle file="config.toml" >}} +{{< code-toggle file="config" >}} [[menu.main]] name = "about hugo" pre = "" @@ -90,6 +90,7 @@ Here’s an example snippet pulled from a configuration file: [[menu.main]] name = "getting started" pre = "" + post = "New!" weight = -100 url = "/getting-started/" {{< /code-toggle >}} diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index 9a4c77d40..636e95970 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -14,13 +14,13 @@ aliases: [/content/related/,/related/] toc: true --- -{{% note %}} -We currently do not index **Page content**. We thought we would release something that will make most people happy before we start solving [Sherlock's last case](https://github.com/joearms/sherlock). -{{% /note %}} + +Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content). ## List Related Content -To list up to 5 related pages is as simple as including something similar to this partial in your single page template: + +To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template: {{< code file="layouts/partials/related.html" >}} {{ $related := .Site.RegularPages.Related . | first 5 }} @@ -34,67 +34,62 @@ To list up to 5 related pages is as simple as including something similar to thi {{ end }} {{< /code >}} +### Methods -{{% note %}} -Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature. -{{% /note %}} +Here is the list of "Related" methods available on a page collection such `.RegularPages`. -The full set of methods available on the page lists can be seen in this Go interface: +#### .Related PAGE +Returns a collection of pages related the given one. -```go -// A PageGenealogist finds related pages in a page collection. This interface is implemented -// by Pages and PageGroup, which makes it available as `{{ .RegularPages.Related . }}` etc. -type PageGenealogist interface { +``` +{{ $related := .RegularPages.Related . }} +``` - // Template example: - // {{ $related := .RegularPages.Related . }} - Related(doc related.Document) (Pages, error) +#### .RelatedIndices PAGE INDICE1 [INDICE2 ...] +Returns a collection of pages related to a given one restricted to a list of indices. - // Template example: - // {{ $related := .RegularPages.RelatedIndices . "tags" "date" }} - RelatedIndices(doc related.Document, indices ...interface{}) (Pages, error) +``` +{{ $related := .RegularPages.RelatedIndices . "tags" "date" }} +``` + +#### .RelatedTo KEYVALS [KEYVALS2 ...] +Returns a collection of pages related together by a set of indices and their match. - // Template example: - // {{ $related := .RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }} - RelatedTo(args ...types.KeyValues) (Pages, error) -} +In order to build those set and pass them as argument, one must use the `keyVals` function where the first agrument would be the `indice` and the consective ones its potential `matches`. + +``` +{{ $related := .RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }} ``` + +{{% note %}} +Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature. +{{% /note %}} + ## Configure Related Content Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed. +### Default configuration + +Without any `related` configuration set on the project, Hugo's Related Content methods will use the following. + +```yaml +related: + threshold: 80 + includeNewer: false + toLower: false + indices: + - name: keywords + weight: 100 + - name: date + weight: 10 +``` + +Custom configuration should be set using the same syntax. + {{% note %}} If you add a `related` config section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults. {{% /note %}} -Below is a sample `config.toml` section: - -``` -[related] - -# Only include matches with rank >= threshold. This is a normalized rank between 0 and 100. -threshold = 80 - -# To get stable "See also" sections we, by default, exclude newer related pages. -includeNewer = false - -# Will lower case keywords in both queries and in the indexes. -toLower = false - -[[related.indices]] -name = "keywords" -weight = 150 -[[related.indices]] -name = "author" -toLower = true -weight = 30 -[[related.indices]] -name = "tags" -weight = 100 -[[related.indices]] -name = "date" -weight = 10 -pattern = "2006" -``` ### Top Level Config Options threshold @@ -135,9 +130,6 @@ He should now be able to add an improved version of that "Related Content" secti * If you don't use any of the `Related` methods, you will not use the Relate Content feature, and performance will be the same as before. * Calling `.RegularPages.Related` etc. will create one inverted index, also sometimes named posting list, that will be reused for any lookups in that same page collection. Doing that in addition to, as an example, calling `.Pages.Related` will work as expected, but will create one additional inverted index. This should still be very fast, but worth having in mind, especially for bigger sites. - - - - - - +{{% note %}} +We currently do not index **Page content**. We thought we would release something that will make most people happy before we start solving [Sherlock's last case](https://github.com/joearms/sherlock). +{{% /note %}} diff --git a/content/en/content-management/summaries.md b/content/en/content-management/summaries.md index 0f8939377..63d64aa3c 100644 --- a/content/en/content-management/summaries.md +++ b/content/en/content-management/summaries.md @@ -21,32 +21,40 @@ With the use of the `.Summary` [page variable][pagevariables], Hugo generates su ## Summary Splitting Options -* Hugo-defined Summary Split -* User-defined Summary Split +* Automatic Summary Split +* Manual Summary Split It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables]. -### Hugo-defined: Automatic Summary Splitting +### Automatic Summary Splitting -By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. Taking the Hugo-defined approach to summaries may save time, but it has pros and cons: +By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting `summaryLength` in your [site configuration](/getting-started/configuration/). -* **Pros:** Automatic, no additional work on your part. -* **Cons:** All HTML tags are stripped from the summary, and the first 70 words, whether they belong to a heading or to different paragraphs, are all put into one paragraph. +{{% note %}} +You can customize how HTML tags in the summary are loaded using functions such as `plainify` and `safeHTML`. +{{% /note %}} {{% note %}} -The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive white space characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in you [site configuration](/getting-started/configuration/). +The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive whitespace characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in your [site configuration](/getting-started/configuration/). {{% /note %}} -### User-defined: Manual Summary Splitting +### Manual Summary Splitting + +Alternatively, you may add the <!--more--> summary divider where you want to split the article. -Alternatively, you may add the <!--more--> summary divider where you want to split the article. For [org content][org], use `# more` where you want to split the article. Content that comes before the summary divider will be used as that content's summary and stored in the `.Summary` page variable with all HTML formatting intact. +For [Org mode content][org], use `# more` where you want to split the article. + +Content that comes before the summary divider will be used as that content's summary and stored in the `.Summary` page variable with all HTML formatting intact. {{% note "Summary Divider"%}} The concept of a *summary divider* is not unique to Hugo. It is also called the "more tag" or "excerpt separator" in other literature. {{% /note %}} -* Pros: Freedom, precision, and improved rendering. All HTML tags and formatting are preserved. -* Cons: Extra work for content authors, since they need to remember to type <!--more--> (or `# more` for [org content][org]) in each content file. This can be automated by adding the summary divider below the front matter of an [archetype](/content-management/archetypes/). +Pros +: Freedom, precision, and improved rendering. All HTML tags and formatting are preserved. + +Cons +: Extra work for content authors, since they need to remember to type <!--more--> (or `# more` for [org content][org]) in each content file. This can be automated by adding the summary divider below the front matter of an [archetype](/content-management/archetypes/). {{% warning "Be Precise with the Summary Divider" %}} Be careful to enter <!--more--> exactly; i.e., all lowercase and with no whitespace. diff --git a/content/en/contribute/development.md b/content/en/contribute/development.md index be2ca4a2b..e9e1cd10f 100644 --- a/content/en/contribute/development.md +++ b/content/en/contribute/development.md @@ -15,7 +15,6 @@ menu: weight: 10 sections_weight: 10 draft: false -aliases: [/contribute/development/] toc: true --- diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index e8603d432..7b198a4ca 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -94,15 +94,15 @@ Code blocks are crucial for providing examples of Hugo's new features to end use ### Standard Syntax -Across all pages on the Hugo docs, the typical triple-back-tick markdown syntax is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages. +Across many pages on the Hugo docs, the typical triple-back-tick markdown syntax (```` ``` ````) is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages. Your options for languages are `xml`/`html`, `go`/`golang`, `md`/`markdown`/`mkd`, `handlebars`, `apache`, `toml`, `yaml`, `json`, `css`, `asciidoc`, `ruby`, `powershell`/`ps`, `scss`, `sh`/`zsh`/`bash`/`git`, `http`/`https`, and `javascript`/`js`. -``` +```` ```

Hello world!

``` -``` +```` ### Code Block Shortcode @@ -118,14 +118,13 @@ With the `code` shortcodes, *you must include triple back ticks and a language d ``` {{%/* code file="smart/file/name/with/path.html" download="download.html" copy="true" */%}} -``` A whole bunch of coding going on up in here! -``` {{%/* /code */%}} ``` The following are the arguments passed into `code`: + ***`file`*** : the only *required* argument. `file` is needed for styling but also plays an important role in helping users create a mental model around Hugo's directory structure. Visually, this will be displayed as text in the top left of the code block. @@ -194,10 +193,8 @@ The `output` shortcode is almost identical to the `code` shortcode but only take ``` {{%/* output file="post/my-first-post/index.html" */%}} -```

This is my First Hugo Blog Post

I am excited to be using Hugo.

-``` {{%/* /output */%}} ``` diff --git a/content/en/functions/GetPage.md b/content/en/functions/GetPage.md index 2d9de4d7a..366d1f093 100644 --- a/content/en/functions/GetPage.md +++ b/content/en/functions/GetPage.md @@ -31,7 +31,7 @@ aliases: [] This method wil return `nil` when no page could be found, so the above will not print anything if the blog section is not found. -To fund a regular page in the blog section:: +To find a regular page in the blog section:: ```go-html-template {{ with .Site.GetPage "/blog/my-post.md" }}{{ .Title }}{{ end }} diff --git a/content/en/functions/default.md b/content/en/functions/default.md index 1b5a9fb6f..18f7b7d33 100644 --- a/content/en/functions/default.md +++ b/content/en/functions/default.md @@ -22,7 +22,7 @@ aliases: [] needsexamples: false --- -`default` checks whether a given value is set and returns a default value if it is not. *Set* in this context means different things depending on date type: +`default` checks whether a given value is set and returns a default value if it is not. *Set* in this context means different things depending on the data type: * non-zero for numeric types and times * non-zero length for strings, arrays, slices, and maps diff --git a/content/en/functions/intersect.md b/content/en/functions/intersect.md index a607ff217..6d2efacbc 100644 --- a/content/en/functions/intersect.md +++ b/content/en/functions/intersect.md @@ -19,27 +19,7 @@ deprecated: false aliases: [] --- -The elements supported are strings, integers, and floats (only float64). - -A useful example of `intersect` functionality is a "related posts" block. `isset` allows us to create a list of links to other posts that have tags that intersect with the tags in the current post. - -The following is an example of a "related posts" [partial template][partials] that could be added to a [single page template][single]: - -{{< code file="layouts/partials/related-posts.html" download="related-posts.html" >}} - -{{< /code >}} - -This is also very useful to use as `AND` filters when combined with where: +An useful example is to use it as `AND` filters when combined with where: ``` {{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }} diff --git a/content/en/functions/os.Stat.md b/content/en/functions/os.Stat.md new file mode 100644 index 000000000..1e878d896 --- /dev/null +++ b/content/en/functions/os.Stat.md @@ -0,0 +1,33 @@ +--- +title: os.Stat +description: Gets a file information of a given path. +godocref: +date: 2018-08-07 +publishdate: 2018-08-07 +lastmod: 2018-08-07 +categories: [functions] +menu: + docs: + parent: "functions" +keywords: [files] +signature: ["os.Stat PATH"] +workson: [] +hugoversion: +relatedfuncs: [readDir] +deprecated: false +aliases: [] +--- + +If your current project working directory has a single file named `README.txt` (30 bytes): +``` +{{ $stat := os.Stat "README.txt" }} +{{ $stat.Name }} → "README.txt" +{{ $stat.Size }} → 30 +``` + +Function [`os.Stat`][Stat] returns [`os.FileInfo`][osfileinfo]. +For further information of `os.FileInfo`, see [golang page][osfileinfo]. + + +[Stat]: /functions/os.Stat/ +[osfileinfo]: https://golang.org/pkg/os/#FileInfo diff --git a/content/en/getting-started/installing.md b/content/en/getting-started/installing.md index deb2605b1..ccf96317b 100644 --- a/content/en/getting-started/installing.md +++ b/content/en/getting-started/installing.md @@ -343,7 +343,7 @@ You'll need a place to store the Hugo executable, your [content][], and the gene 3. Find the Windows files near the bottom (they're in alphabetical order, so Windows is last) – download either the 32-bit or 64-bit file depending on whether you have 32-bit or 64-bit Windows. (If you don't know, [see here](https://esupport.trendmicro.com/en-us/home/pages/technical-support/1038680.aspx).) 4. Move the ZIP file into your `C:\Hugo\bin` folder. 5. Double-click on the ZIP file and extract its contents. Be sure to extract the contents into the same `C:\Hugo\bin` folder – Windows will do this by default unless you tell it to extract somewhere else. -6. You should now have three new files: hugo executable (e.g. `hugo_0.18_windows_amd64.exe`), `license.md`, and `readme.md`. (You can delete the ZIP download now.) Rename that hugo executable (`hugo_hugo-version_platform_arch.exe`) to `hugo.exe` for ease of use. +6. You should now have three new files: The hugo executable (`hugo.exe`), `LICENSE`, and `README.md`. Now you need to add Hugo to your Windows PATH settings: @@ -472,6 +472,14 @@ For the latest version, the Hugo package maintained by [@daftaupe](https://githu See the [related discussion in the Hugo forums][redhatforum]. +### Solus + +Solus includes Hugo in its package repository, it may be installed with: + +``` +sudo eopkg install hugo +``` + ## OpenBSD OpenBSD provides a package for Hugo via `pkg_add`: diff --git a/content/en/hosting-and-deployment/hosting-on-netlify.md b/content/en/hosting-and-deployment/hosting-on-netlify.md index f2820a8de..01ca42f4f 100644 --- a/content/en/hosting-and-deployment/hosting-on-netlify.md +++ b/content/en/hosting-and-deployment/hosting-on-netlify.md @@ -24,7 +24,7 @@ toc: true ## Assumptions * You have an account with GitHub, GitLab, or Bitbucket. -* You have completed the [Quick Start][] or have Hugo website you are ready to deploy and share with the world. +* You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world. * You do not already have a Netlify account. ## Create a Netlify account @@ -59,7 +59,7 @@ Select the repo you want to use for continuous deployment. If you have a large n Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch. -## Configure Hugo Version in Netlify +## Configure Hugo Version in Netlify You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console. @@ -80,7 +80,7 @@ For testing: The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`: {{< code file="netlify.toml" nocode="true" >}} -{{< readfile file="netlify.toml" highlight="toml" >}} +{{< readfile file="netlify.toml" highlight="toml" >}} {{< /code >}} ## Build and Deploy Site diff --git a/content/en/hugo-pipes/postcss.md b/content/en/hugo-pipes/postcss.md index a0ecc6d35..a0a673798 100755 --- a/content/en/hugo-pipes/postcss.md +++ b/content/en/hugo-pipes/postcss.md @@ -27,7 +27,9 @@ The resource will be processed using the project's or theme's own `postcss.confi ``` {{% note %}} -Hugo Pipe's PostCSS requires `postcss-cli` javascript package to be installed on the environement along with any PostCSS plugin used. +Hugo Pipe's PostCSS requires the `postcss-cli` JavaScript package to be installed in the environment (`npm install -g postcss-cli`) along with any PostCSS plugin(s) used (e.g., `npm install -g autoprefixer`). + +If you are using the Hugo Snap package, PostCSS and plugin(s) need to be installed locally within your Hugo site directory, e.g., `npm install postcss-cli` without the `-g` flag. {{% /note %}} ### Options diff --git a/content/en/hugo-pipes/scss-sass.md b/content/en/hugo-pipes/scss-sass.md index baed2b4d0..489d16e77 100755 --- a/content/en/hugo-pipes/scss-sass.md +++ b/content/en/hugo-pipes/scss-sass.md @@ -43,3 +43,7 @@ includePaths [string slice] {{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" true "includePaths" (slice "node_modules/myscss")) }} {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} ``` + +{{% note %}} +Setting `outputStyle` to `compressed` will handle SASS/SCSS files minification better than the more generic [`resources.Minify`]({{< ref "minification">}}). +{{% /note %}} diff --git a/content/en/news/0.47-relnotes/featured-hugo-47-poster.png b/content/en/news/0.47-relnotes/featured-hugo-47-poster.png new file mode 100644 index 000000000..601922961 Binary files /dev/null and b/content/en/news/0.47-relnotes/featured-hugo-47-poster.png differ diff --git a/content/en/news/0.47-relnotes/index.md b/content/en/news/0.47-relnotes/index.md new file mode 100644 index 000000000..79d15ec62 --- /dev/null +++ b/content/en/news/0.47-relnotes/index.md @@ -0,0 +1,79 @@ + +--- +date: 2018-08-17 +title: "Output Minification, Live-Reload Fixes and More" +description: "Hugo 0.47: Adds minification of rendered output, but is mostly a massive bug fix release." +categories: ["Releases"] +--- + +Hugo `0.47` is named **Hugo Reloaded**. It adds minification support for the final rendered output (run `hugo --minify`), but it is mostly a bug fix release. And most notably, it fixes a set of issues with live-reloading/partial rebuilds when running `hugo server`. Working with bundles should now be a more pleasant experience, to pick one example. + +This release represents **35 contributions by 6 contributors** to the main Hugo code base. +[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@satotake](https://github.com/satotake), [@anthonyfok](https://github.com/anthonyfok), and [@coliff](https://github.com/coliff) for their ongoing contributions. + +And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site. + +Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), +which has received **21 contributions by 10 contributors**. A special thanks to [@bep](https://github.com/bep), [@aapeliv](https://github.com/aapeliv), [@regisphilibert](https://github.com/regisphilibert), and [@brentybh](https://github.com/brentybh) for their work on the documentation site. + + +Hugo now has: + +* 27980+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 442+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 251+ [themes](http://themes.gohugo.io/) + +## Enhancements + +### Templates + +* Suppress blank lines from opengraph internal template [c09ee78f](https://github.com/gohugoio/hugo/commit/c09ee78fd235599d3fb794110cd75c024d80cfca) [@anthonyfok](https://github.com/anthonyfok) +* Add MIME type to embedded JS [755d1ffe](https://github.com/gohugoio/hugo/commit/755d1ffe7a22d8ad83485240ff78cf25d501602f) [@bep](https://github.com/bep) [#5042](https://github.com/gohugoio/hugo/issues/5042) +* Add `os.Stat` template function [d7112085](https://github.com/gohugoio/hugo/commit/d71120852a8e14d0ea4d24de269fce041ef7b666) [@satotake](https://github.com/satotake) + +### Output + +* Add support for minification of final output [789ef8c6](https://github.com/gohugoio/hugo/commit/789ef8c639e4621abd36da530bcb5942ac9297da) [@bep](https://github.com/bep) [#1251](https://github.com/gohugoio/hugo/issues/1251) + +### Other + +* Regenerate CLI docs [4a16b5f4](https://github.com/gohugoio/hugo/commit/4a16b5f4b0adbb31fee611c378de9d5526de2f86) [@bep](https://github.com/bep) +* Include theme name in version mismatch error [e5052f4e](https://github.com/gohugoio/hugo/commit/e5052f4e09b6df590cddf2f8bc2c834fd3af3082) [@bep](https://github.com/bep) [#5044](https://github.com/gohugoio/hugo/issues/5044) +* Make the JS minifier matcher less specific [c81fbf46](https://github.com/gohugoio/hugo/commit/c81fbf4625ae7cc7dd3a7a526331ddfdf5237cc6) [@bep](https://github.com/bep) [#5073](https://github.com/gohugoio/hugo/issues/5073) +* Close file when done [f6ae436c](https://github.com/gohugoio/hugo/commit/f6ae436c5878bafeafa0bb2646a2c9b32c9b4380) [@bep](https://github.com/bep) [#5062](https://github.com/gohugoio/hugo/issues/5062) +* https links to 3rd party sites [c2a67413](https://github.com/gohugoio/hugo/commit/c2a6741394bc609a663522b245d3d75f0ad17da4) [@coliff](https://github.com/coliff) +* Update alias.go [06bd0136](https://github.com/gohugoio/hugo/commit/06bd0136419ebd6727635716c7023494cc5a8257) [@coliff](https://github.com/coliff) +* Remove test debug [fb3cb05c](https://github.com/gohugoio/hugo/commit/fb3cb05cc3dfc50370449f622fb0130ba7e0ced2) [@bep](https://github.com/bep) +* Update dependencies [d07882df](https://github.com/gohugoio/hugo/commit/d07882dfb76a65cce79aaa6f27df71279cd30600) [@bep](https://github.com/bep) +* Update Chroma [7f535671](https://github.com/gohugoio/hugo/commit/7f5356717d14079432365974e1424fc4ff5987c9) [@bep](https://github.com/bep) [#5025](https://github.com/gohugoio/hugo/issues/5025) +* Remove alias of os.Stat [71931b30](https://github.com/gohugoio/hugo/commit/71931b30b1813b146aaa60f5cdab16c0f9ebebdb) [@satotake](https://github.com/satotake) +* Renmae FileStat Stat [d40116e5](https://github.com/gohugoio/hugo/commit/d40116e5f941e4734ed3bed69dce8ffe11fc76b2) [@satotake](https://github.com/satotake) +* Reduce allocation in the benchmark itself [a6b1eb1e](https://github.com/gohugoio/hugo/commit/a6b1eb1e9150aa5c1c86fe7424cc4167d6f59a5a) [@bep](https://github.com/bep) +* Simplify the 0 transformer case [27110133](https://github.com/gohugoio/hugo/commit/27110133ffca05feae2e11a9ff28a9a00f613350) [@bep](https://github.com/bep) + +## Fixes + +### Templates + +* Fix compiling Amber templates that import other templates [37438757](https://github.com/gohugoio/hugo/commit/37438757788d279c839506d54f460b2ab37db164) [@Stebalien](https://github.com/Stebalien) +* Reimplement the ".Params tolower" template transformer [5c538491](https://github.com/gohugoio/hugo/commit/5c5384916e8f954f3ea66148ecceb3732584588e) [@bep](https://github.com/bep) [#5068](https://github.com/gohugoio/hugo/issues/5068) + +### Output + +* Fix Resource output in multihost setups [78f8475a](https://github.com/gohugoio/hugo/commit/78f8475a054a6277d37f13329afd240b00dc9408) [@bep](https://github.com/bep) [#5058](https://github.com/gohugoio/hugo/issues/5058) + +### Core + +* Force render of any changed page, even in Fast Render Mode [22475460](https://github.com/gohugoio/hugo/commit/2247546017c00201d2ce1232dd5303295451f1cc) [@bep](https://github.com/bep) [#5083](https://github.com/gohugoio/hugo/issues/5083) +* Add configFile(s) back to the watch list after REMOVE event [abc54080](https://github.com/gohugoio/hugo/commit/abc54080ec8c43e8989c081d934b59f0c9570c0b) [@anthonyfok](https://github.com/anthonyfok) [#4701](https://github.com/gohugoio/hugo/issues/4701) +* Gracefully handle typos in server config when running the server [a655e00d](https://github.com/gohugoio/hugo/commit/a655e00d702dbc20b3961b131b33ab21841b043d) [@bep](https://github.com/bep) [#5081](https://github.com/gohugoio/hugo/issues/5081) +* Fix shortcode output wrapped in p [78c99463](https://github.com/gohugoio/hugo/commit/78c99463fdd45c91af9933528d12d36a86dc6482) [@gllera](https://github.com/gllera) [#1642](https://github.com/gohugoio/hugo/issues/1642) +* Adjust tests for shortcode p-issue [baa62d0a](https://github.com/gohugoio/hugo/commit/baa62d0abbbf24a17d0aa800a4bb217f026c49ad) [@bep](https://github.com/bep) [#1642](https://github.com/gohugoio/hugo/issues/1642) +* Fix image cache-clearing for sub-languages [9d973004](https://github.com/gohugoio/hugo/commit/9d973004f5379cff2adda489566fe40683553c4c) [@bep](https://github.com/bep) [#5084](https://github.com/gohugoio/hugo/issues/5084) +* Fix error when deleting a bundle in server mode [0a88741f](https://github.com/gohugoio/hugo/commit/0a88741fe85f4f7aedc02ed748dfeb8ccc073dbf) [@bep](https://github.com/bep) [#5077](https://github.com/gohugoio/hugo/issues/5077) +* Fix Related when called from shortcode [0dd06bda](https://github.com/gohugoio/hugo/commit/0dd06bdac008aa81ec2e8f29ad8110dac0227011) [@bep](https://github.com/bep) [#5071](https://github.com/gohugoio/hugo/issues/5071) +* Use the interface value when doing Related search [a6f199f7](https://github.com/gohugoio/hugo/commit/a6f199f7a640161333608b4a843d701f7e182829) [@bep](https://github.com/bep) [#5071](https://github.com/gohugoio/hugo/issues/5071) +* Fix GitInfo when multiple content dirs [2182ecfd](https://github.com/gohugoio/hugo/commit/2182ecfd34a24521bf0e3c939627a55327eb1e19) [@bep](https://github.com/bep) [#5054](https://github.com/gohugoio/hugo/issues/5054) +* Add multiple content dirs to GitInfo test site [e85833d8](https://github.com/gohugoio/hugo/commit/e85833d868a902840c5ed1c90713256153b2548b) [@bep](https://github.com/bep) [#5054](https://github.com/gohugoio/hugo/issues/5054) +* Fix "adding a bundle" in server mode [d139a037](https://github.com/gohugoio/hugo/commit/d139a037d98e4b388687eecb7831758412247c58) [@bep](https://github.com/bep) [#5075](https://github.com/gohugoio/hugo/issues/5075) +* Fix typo [c362634b](https://github.com/gohugoio/hugo/commit/c362634b7d8802ea81b0b4341c800a9f78f7cd7c) [@satotake](https://github.com/satotake) diff --git a/content/en/news/0.47.1-relnotes/index.md b/content/en/news/0.47.1-relnotes/index.md new file mode 100644 index 000000000..d35b0fad2 --- /dev/null +++ b/content/en/news/0.47.1-relnotes/index.md @@ -0,0 +1,30 @@ + +--- +date: 2018-08-20 +title: "Two Bug Fixes" +description: "Hugo 0.47.1: Two Bug Fixes" +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + + This is a bug-fix release with two fixes. + +# Fixes + +* Fix .Site.Params case regression [fdff0d3a](https://github.com/gohugoio/hugo/commit/fdff0d3af4670f7079e539fef4b92af2a866d02d) [@bep](https://github.com/bep) [#5094](https://github.com/gohugoio/hugo/issues/5094) +* Do not strip IE conditional statements [5a0ee2b9](https://github.com/gohugoio/hugo/commit/5a0ee2b934e38d596da0f9742361f81c1221e3d5) [@bep](https://github.com/bep) [#5089](https://github.com/gohugoio/hugo/issues/5089) + +## Updates to Linux Snap build + +* Remove unused files from Git, Perl, etc. [834617f9](https://github.com/gohugoio/hugo/commit/834617f9f8d870643b2631fe607471c8e2ef2f47) [@anthonyfok](https://github.com/anthonyfok) +* Add nodejs to allow PostCSS to work [ef20ec1f](https://github.com/gohugoio/hugo/commit/ef20ec1fbaa8f5841b3fbe18978d4d8c19d8fc53) [@anthonyfok](https://github.com/anthonyfok) + + + + + + + + diff --git a/content/en/news/0.48-relnotes/featured-hugo-48-poster.png b/content/en/news/0.48-relnotes/featured-hugo-48-poster.png new file mode 100644 index 000000000..7adb0d22e Binary files /dev/null and b/content/en/news/0.48-relnotes/featured-hugo-48-poster.png differ diff --git a/content/en/news/0.48-relnotes/index.md b/content/en/news/0.48-relnotes/index.md new file mode 100644 index 000000000..92c765f23 --- /dev/null +++ b/content/en/news/0.48-relnotes/index.md @@ -0,0 +1,57 @@ + +--- +date: 2018-08-29 +title: "This One Goes to 11!" +description: "With Go 1.11, Hugo finally gets support for variable overwrites in templates!" +categories: ["Releases"] +--- + +Hugo `0.48` is built with the brand new Go 1.11. On the technical side this means that Hugo now uses [Go Modules](https://github.com/golang/go/wiki/Modules) for the build. The big new functional thing in Go 1.11 for Hugo is added support for [variable overwrites](https://github.com/golang/go/issues/10608). This means that you can now do this and get the expected result: + +```go-html-template +{{ $var := "Hugo Page" }} +{{ if .IsHome }} + {{ $var = "Hugo Home" }} +{{ end }} +Var is {{ $var }} +``` + +The above may look obvious, but has not been possible until now. In Hugo we have had `.Scratch` as a workaround for this, but Go 1.11 will help clean up a lot of templates. + +This release represents **23 contributions by 5 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@anthonyfok](https://github.com/anthonyfok), [@vsopvsop](https://github.com/vsopvsop), and [@moorereason](https://github.com/moorereason) for their ongoing contributions. And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site. + +Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), +which has received **15 contributions by 12 contributors**. A special thanks to [@bep](https://github.com/bep), [@kaushalmodi](https://github.com/kaushalmodi), [@regisphilibert](https://github.com/regisphilibert), and [@anthonyfok](https://github.com/anthonyfok) for their work on the documentation site. + + +Hugo now has: + +* 28275+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 441+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 252+ [themes](http://themes.gohugo.io/) + +## Enhancements + +* Add a test for template variable overwrite [0c8a4154](https://github.com/gohugoio/hugo/commit/0c8a4154838e32a33d34202fd4fa0187aa502190) [@bep](https://github.com/bep) +* Include language code in REF_NOT_FOUND errors [94d0e79d](https://github.com/gohugoio/hugo/commit/94d0e79d33994b9a9d26a4d020500acdcc71e58c) [@bep](https://github.com/bep) [#5110](https://github.com/gohugoio/hugo/issues/5110) +* Improve minifier MIME type resolution [ebb56e8b](https://github.com/gohugoio/hugo/commit/ebb56e8bdbfaf4f955326017e40b2805850871e9) [@bep](https://github.com/bep) [#5093](https://github.com/gohugoio/hugo/issues/5093) +* Update to Go 1.11 [6b9934a2](https://github.com/gohugoio/hugo/commit/6b9934a26615ea614b1774770532cae9762a58d3) [@bep](https://github.com/bep) [#5115](https://github.com/gohugoio/hugo/issues/5115) +* Set GO111MODULE=on for mage install [c7f05779](https://github.com/gohugoio/hugo/commit/c7f057797ca7bfc781d5a2bbf181bb52360f160f) [@bep](https://github.com/bep) [#5115](https://github.com/gohugoio/hugo/issues/5115) +* Add instruction to install PostCSS when missing [08d14113](https://github.com/gohugoio/hugo/commit/08d14113b60ff70ffe922e8098e289b099a70e0f) [@anthonyfok](https://github.com/anthonyfok) [#5111](https://github.com/gohugoio/hugo/issues/5111) +* Update snapcraft build config to Go 1.11 [94d6d678](https://github.com/gohugoio/hugo/commit/94d6d6780fac78e9ed5ed58ecdb9821ad8f0f27c) [@bep](https://github.com/bep) [#5115](https://github.com/gohugoio/hugo/issues/5115) +* Use Go 1.11 modules with Mage [45c9c45d](https://github.com/gohugoio/hugo/commit/45c9c45d1d0d99443fa6bb524a1265fa9ba95e0e) [@bep](https://github.com/bep) [#5115](https://github.com/gohugoio/hugo/issues/5115) +* Add go.mod [fce32c07](https://github.com/gohugoio/hugo/commit/fce32c07fb80e9929bc2660cf1e681e93009d24b) [@bep](https://github.com/bep) [#5115](https://github.com/gohugoio/hugo/issues/5115) +* Update Travis to Go 1.11 and Go 1.10.4 [d32ff16f](https://github.com/gohugoio/hugo/commit/d32ff16fd61f55874e81d73759afa099b8bdcb57) [@bep](https://github.com/bep) [#5115](https://github.com/gohugoio/hugo/issues/5115) +* Skip installing postcss due to failure on build server [66f688f7](https://github.com/gohugoio/hugo/commit/66f688f7120560ca787c1a23e3e7fbc3aa617956) [@anthonyfok](https://github.com/anthonyfok) + +## Fixes + +* Keep end tags [e6eda2a3](https://github.com/gohugoio/hugo/commit/e6eda2a370aa1184e0afaf12e95dbd6f8b63ace5) [@vsopvsop](https://github.com/vsopvsop) +* Fix permissions when creating new folders [f4675fa0](https://github.com/gohugoio/hugo/commit/f4675fa0f0fae2358adfaea49e8da824ee094495) [@bep](https://github.com/bep) [#5128](https://github.com/gohugoio/hugo/issues/5128) +* Fix handling of taxonomy terms containing slashes [fff13253](https://github.com/gohugoio/hugo/commit/fff132537b4094221f4f099e2251f3cda613060f) [@moorereason](https://github.com/moorereason) [#4090](https://github.com/gohugoio/hugo/issues/4090) +* Fix build on armv7 [8999de19](https://github.com/gohugoio/hugo/commit/8999de193c18b7aa07b44e5b7d9f443a8572e117) [@caarlos0](https://github.com/caarlos0) [#5101](https://github.com/gohugoio/hugo/issues/5101) + + + + + diff --git a/content/en/showcase/over/bio.md b/content/en/showcase/over/bio.md new file mode 100644 index 000000000..415668f9e --- /dev/null +++ b/content/en/showcase/over/bio.md @@ -0,0 +1,5 @@ +The site is built by: + +* [Lauren Waller](https://twitter.com/waller_texas) +* [Wayne Ashley Berry](https://twitter.com/waynethebrain) + diff --git a/content/en/showcase/over/featured-over.png b/content/en/showcase/over/featured-over.png new file mode 100644 index 000000000..726d98731 Binary files /dev/null and b/content/en/showcase/over/featured-over.png differ diff --git a/content/en/showcase/over/index.md b/content/en/showcase/over/index.md new file mode 100644 index 000000000..9640198db --- /dev/null +++ b/content/en/showcase/over/index.md @@ -0,0 +1,17 @@ +--- +title: Over +date: 2018-09-12 +description: "Showcase: \"People from all disciplines contribute to our website; Hugo’s single static binary makes that possible.\"" +siteURL: https://madewithover.com/ + +--- + +At Over we're into creativity, and technology should not get in the way. We want it to be easy for everyone to create, and Hugo does the same for us. That's one of the reasons many of us are fond of using it. + +People from all disciplines contribute to our website, be it legal documentation, layout and design, recruiting, marketing and of course… engineering. Hugo allows us to do this with as little friction as possible. A lot of this comes down to Hugo being distributed as a single static binary. Copy, paste, run... and you're up and running! + +We use [Wercker](https://www.wercker.com/) for continuous integration and deployments, [GitHub](https://github.com/) for contributing to and writing markdown and [Firebase](https://firebase.google.com/docs/hosting/) for hosting. + +This infrastructure takes all the pressure off our engineers, anyone can contribute to our website. Anyone else can review the changes, and of course anyone with permission can deploy those approved changes as well! + +We're busy working on a few new features for our website, and Hugo continues to deliver above and beyond. We're so happy with the choice we made to use Hugo and to us it has become the de-facto static site generator. \ No newline at end of file diff --git a/content/en/templates/404.md b/content/en/templates/404.md index eba2d95df..c6bea1912 100644 --- a/content/en/templates/404.md +++ b/content/en/templates/404.md @@ -50,6 +50,7 @@ Your 404.html file can be set to load automatically when a visitor enters a mist * Apache. You can specify `ErrorDocument 404 /404.html` in an `.htaccess` file in the root of your site. * Nginx. You might specify `error_page 404 /404.html;` in your `nginx.conf` file. * Amazon AWS S3. When setting a bucket up for static web serving, you can specify the error file from within the S3 GUI. +* Amazon CloudFont. You can specify the page in the Error Pages section in the CloudFont Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) * Caddy Server. Using `errors { 404 /404.html }`. [Details here](https://caddyserver.com/docs/errors) {{% note %}} diff --git a/content/en/templates/files.md b/content/en/templates/files.md index 6e6f3ec4e..4969a4f33 100644 --- a/content/en/templates/files.md +++ b/content/en/templates/files.md @@ -104,12 +104,12 @@ And here is the result as [called directly in the Hugo docs][] and rendered for {{< readfile file="/content/en/readfiles/testing.txt" markdown="true">}} -[called directly in the Hugo docs]: https://github.com/gohugoio/hugo/blob/master/docs/content/templates/files.md +[called directly in the Hugo docs]: https://github.com/gohugoio/hugoDocs/blob/master/content/en/templates/files.md [dirindex]: https://github.com/gohugoio/hugo/blob/master/docs/layouts/shortcodes/directoryindex.html [osfileinfo]: https://golang.org/pkg/os/#FileInfo [readDir]: /functions/readdir/ [readFile]: /functions/readfile/ [sc]: /content-management/shortcodes/ [sct]: /templates/shortcode-templates/ -[readfilesource]: https://github.com/gohugoio/hugo/blob/master/ -[testfile]: https://github.com/gohugoio/hugo/blob/master/docs/testfile +[readfilesource]: https://github.com/gohugoio/hugoDocs/blob/master/layouts/shortcodes/readfile.html +[testfile]: https://github.com/gohugoio/hugoDocs/blob/master/content/en/readfiles/testing.txt diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index 0b9ad051b..1e1778eb0 100644 --- a/content/en/templates/introduction.md +++ b/content/en/templates/introduction.md @@ -20,26 +20,39 @@ toc: true --- {{% note %}} -The following is only a primer on Go templates. For an in-depth look into Go templates, check the official [Go docs](http://golang.org/pkg/html/template/). +The following is only a primer on Go Templates. For an in-depth look into Go Templates, check the official [Go docs](http://golang.org/pkg/html/template/). {{% /note %}} -Go templates provide an extremely simple template language that adheres to the belief that only the most basic of logic belongs in the template or view layer. +Go Templates provide an extremely simple template language that adheres to the belief that only the most basic of logic belongs in the template or view layer. {{< youtube gnJbPO-GFIw >}} ## Basic Syntax -Go templates are HTML files with the addition of [variables][variables] and [functions][functions]. Go template variables and functions are accessible within `{{ }}`. +Go Templates are HTML files with the addition of [variables][variables] and [functions][functions]. Go Template variables and functions are accessible within `{{ }}`. ### Access a Predefined Variable -``` -{{ foo }} +A _predefined variable_ could be a variable already existing in the +current scope (like the `.Title` example in the [Variables]({{< relref +"#variables" >}}) section below) or a custom variable (like the +`$address` example in that same section). + + +```go-html-template +{{ .Title }} +{{ $address }} ``` -Parameters for functions are separated using spaces. The following example calls the `add` function with inputs of `1` and `2`: +Parameters for functions are separated using spaces. The general syntax is: ``` +{{ FUNCTION ARG1 ARG2 .. }} +``` + +The following example calls the `add` function with inputs of `1` and `2`: + +```go-html-template {{ add 1 2 }} ``` @@ -47,64 +60,88 @@ Parameters for functions are separated using spaces. The following example calls Accessing the Page Parameter `bar` defined in a piece of content's [front matter][]. -``` +```go-html-template {{ .Params.bar }} ``` #### Parentheses Can be Used to Group Items Together -``` +```go-html-template {{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }} ``` -## Variables +## Variables {#variables} -Each Go template gets a data object. In Hugo, each template is passed a `Page`. See [variables][] for more information. +Each Go Template gets a data object. In Hugo, each template is passed +a `Page`. In the below example, `.Title` is one of the elements +accessible in that [`Page` variable][pagevars]. -This is how you access a `Page` variable from a template: +With the `Page` being the default scope of a template, the `Title` +element in current scope (`.` -- "the **dot**") is accessible simply +by the dot-prefix (`.Title`): -``` +```go-html-template {{ .Title }} ``` Values can also be stored in custom variables and referenced later: -``` -{{ $address := "123 Main St."}} +{{% note %}} +The custom variables need to be prefixed with `$`. +{{% /note %}} + +```go-html-template +{{ $address := "123 Main St." }} {{ $address }} ``` {{% warning %}} -Variables defined inside `if` conditionals and similar are not visible on the outside. See [https://github.com/golang/go/issues/10608](https://github.com/golang/go/issues/10608). +For Hugo v0.47 and older versions, variables defined inside `if` +conditionals and similar are not visible on the outside. +See [https://github.com/golang/go/issues/10608](https://github.com/golang/go/issues/10608). Hugo has created a workaround for this issue in [Scratch](/functions/scratch). - {{% /warning %}} +For **Hugo v0.48** and newer, variables can be re-defined using the +new `=` operator (new in Go 1.11). + +Below example will work only in these newer Hugo versions. The example +prints "Var is Hugo Home" on the home page, and "Var is Hugo Page" on +all other pages: + +```go-html-template +{{ $var := "Hugo Page" }} +{{ if .IsHome }} + {{ $var = "Hugo Home" }} +{{ end }} +Var is {{ $var }} +``` + ## Functions -Go templates only ship with a few basic functions but also provide a mechanism for applications to extend the original set. +Go Templates only ship with a few basic functions but also provide a mechanism for applications to extend the original set. [Hugo template functions][functions] provide additional functionality specific to building websites. Functions are called by using their name followed by the required parameters separated by spaces. Template functions cannot be added without recompiling Hugo. ### Example 1: Adding Numbers -``` +```go-html-template {{ add 1 2 }} -=> 3 + ``` ### Example 2: Comparing Numbers -``` +```go-html-template {{ lt 1 2 }} -=> true (i.e., since 1 is less than 2) + ``` -Note that both examples make use of Go template's [math functions][]. +Note that both examples make use of Go Template's [math functions][]. {{% note "Additional Boolean Operators" %}} -There are more boolean operators than those listed in the Hugo docs in the [Go template documentation](http://golang.org/pkg/text/template/#hdr-Functions). +There are more boolean operators than those listed in the Hugo docs in the [Go Template documentation](http://golang.org/pkg/text/template/#hdr-Functions). {{% /note %}} ## Includes @@ -124,116 +161,174 @@ within Hugo. The [`partial`][partials] function is used to include *partial* templates using the syntax `{{ partial "/." . }}`. -Example: +Example of including a `layouts/partials/header.html` partial: -``` +```go-html-template {{ partial "header.html" . }} ``` ### Template -The `template` function was used to include *partial* templates in much older -Hugo versions. Now it is still useful for calling [*internal* -templates][internal_templates]: +The `template` function was used to include *partial* templates +in much older Hugo versions. Now it useful only for calling +[*internal* templates][internal_templates]. The syntax is `{{ template +"_internal/