From: Bjørn Erik Pedersen Date: Wed, 18 Jul 2018 09:04:57 +0000 (+0200) Subject: Squashed 'docs/' changes from f59b3ab06..cfe89ecbc X-Git-Tag: v0.45~23^2~1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b6b37a1f00f808f3c0d2715f65ca2d3091f36495;p=brevno-suite%2Fhugo Squashed 'docs/' changes from f59b3ab06..cfe89ecbc cfe89ecbc Set all *.png files under static/images to mode 0644 d847ccd8b More spelling error fixes bf1405d92 Correction: .Pages on homepage is same as .Site.RegularPages 7efa41ff5 Merge commit 'd137efe0222269e09b427325176f0044558e3cc5' d137efe02 Squashed 'themes/gohugoioTheme/' changes from f31a3dc8..66249819 50df8bfb8 Replace .Data.Pages with .Pages 85d3712d0 Mention the newScratch template func 1c234db1b Release 0.44 a51cb3e36 Merge branch 'temp44' ec424a5e2 releaser: Prepare repository for 0.45-DEV 425e85574 releaser: Add release notes to /docs for release of 0.44 e6f9c65a2 releaser: Bump versions for release of 0.44 45548a5c9 Arch Linux: Partial upgrades are unsupported c0430f8f9 Update MenuEntry properties documentation 79109b685 Refresh the documentation on staticDir config parameter 80ed4592b Remove duplicate links; also sort them alphabetically f00a4e232 HTTPS links to third-party sites 2f6f682ba Fixed a typo 4be105202 add openbsd howto install 39808f50a Fix typo b55c0f3a0 Fix URL to hugotest 2fb157237 Release Hugo 0.43 e8af6a970 Merge branch 'temp43' 563dd4173 Adjust release notes 50aed2e52 releaser: Prepare repository for 0.44-DEV 363b363ff releaser: Add release notes to /docs for release of 0.43 93bfbef62 releaser: Bump versions for release of 0.43 893a27d33 Fix typos fe5908257 Celebrate: a few typo and grammar fixes bb20442df Merge commit '98293eaa1570b5aff4452021c8b6d6c8560b3f06' ef3d63936 Add a newScratch template func bf100a3cd Merge branch 'release-0.42.2' f1133c544 releaser: Prepare repository for 0.43-DEV 2ce058057 releaser: Add release notes to /docs for release of 0.42.2 6073927c6 releaser: Bump versions for release of 0.42.2 3bafddd52 releaser: Prepare repository for 0.43-DEV 8b9f805bd releaser: Add release notes to /docs for release of 0.42.1 efb6638ba releaser: Bump versions for release of 0.42.1 1e74ffbe0 releaser: Prepare repository for 0.43-DEV 2d2d0f8ab releaser: Add release notes to /docs for release of 0.42 17f685813 releaser: Bump versions for release of 0.42 67ef1a0e1 docs: Update theme documentation d74874e1e docs: Remove some files now moved 771d50cf3 Merge commit 'b239595af5a9fc1fc9a1ccc666c3ab06ccc32f04' f9b5fd2d2 tplimpl: Remove speakerdeck shortcode 523206579 tpl/strings: strings.RuneCount b389efc88 tpl: Add strings.Repeat a41ad0254 Add a BlackFriday option for rel="noreferrer" on external links a6e279362 Add a BlackFriday option for rel="nofollow" on external links 7e2c9846e releaser: Prepare repository for 0.42-DEV b4f81c38a releaser: Add release notes to /docs for release of 0.41 55667b3a1 releaser: Bump versions for release of 0.41 afceb02d3 docs: Document the GDPR Privacy Config 8b8289027 Merge commit 'd2b1030060d3c91d5f9ffa3456418da16bd74f1d' be04a8886 Merge branch 'release-0.40.3' 33ca0b8da releaser: Prepare repository for 0.41-DEV 8c9a5a850 releaser: Add release notes to /docs for release of 0.40.3 85845a4fd releaser: Bump versions for release of 0.40.3 9af79e531 Merge commit '83bef6955e014d40c0f00db9cebe09113154e999' c4200dd0e Fix typo 8f8323336 releaser: Prepare repository for 0.41-DEV 9fab87505 releaser: Add release notes to /docs for release of 0.40.2 83648c666 releaser: Bump versions for release of 0.40.2 e6434d104 releaser: Prepare repository for 0.41-DEV 9389b2973 releaser: Add release notes to /docs for release of 0.40.1 32979e28a releaser: Bump versions for release of 0.40.1 196174a76 releaser: Prepare repository for 0.41-DEV 490a997bb releaser: Add release notes to /docs for release of 0.40 018aa6471 releaser: Bump versions for release of 0.40 92221934c Merge commit 'a215abf70e018f4bf40d6c09d8bd148d8684b33d' 0a58ef56e Merge commit 'd2ec1a06df8ab6b17ad05cb008d5701b40327d47' 312ab58c6 Improve .Get docs e43e8cee3 .Get function: fix syntax signature bb16150bc releaser: Prepare repository for 0.40-DEV 8cc80fed9 releaser: Add release notes to /docs for release of 0.39 f7aa0d1c5 releaser: Bump versions for release of 0.39 42e48706a Merge commit '047c4188dfc854f658d16f1e4a9501f9c97a31c7' 76acab68b releaser: Prepare repository for 0.39-DEV d270600b0 releaser: Add release notes to /docs for release of 0.38.2 97be36992 releaser: Bump versions for release of 0.38.2 cd29b8b79 releaser: Prepare repository for 0.39-DEV 9983a4bdf releaser: Add release notes to /docs for release of 0.38.1 7774afd01 releaser: Bump versions for release of 0.38.1 b89157f20 releaser: Prepare repository for 0.39-DEV af4d0bf62 releaser: Add release notes to /docs for release of 0.38 ca98e7d4f releaser: Bump versions for release of 0.38 8b773833a Merge commit 'ed8bf081fdbf336e026517b7e1b123c039014ab5' 24202bb71 docs: Generate docshelper data 43d15975d Add .Site.IsServer 6f99d3d65 Merge commit '0a23baa6a90901f772c234107c4f12c16c76f4aa' 17487ccdd hugolib: Add Reset method to delete key from Scratch ccbf7a05c docs: Add docs for lang.Merge 5ad46d78e Merge commit '3886fc1fef6ac19d58b9ba1bb642d0c6c9a54031' ac403c280 docs: Add docs on the new front matter configuration 6066c60e6 Merge commit 'c0290655825e7bb36e13fb39f89d85b392cf1adc' ee605c7ae releaser: Prepare repository for 0.38-DEV 31a4de966 releaser: Add release notes to /docs for release of 0.37.1 9dd3dafe1 releaser: Bump versions for release of 0.37.1 141750aec releaser: Prepare repository for 0.38-DEV c9bb39bc3 releaser: Add release notes to /docs for release of 0.37 c7009f064 releaser: Bump versions for release of 0.37 9f727d916 Merge commit '900b5f6cfe5a377ef369d26cd700201be4cf6b06' 87fd97853 Merge commit '374d184e6747678364fd61f5faf328ec9205eb6b' 244deafc2 Fix typos in development contribution doc 608c80f72 Merge branch 'release-0.36.1' 0f8ffbd5c releaser: Prepare repository for 0.37-DEV 5028ee849 releaser: Add release notes to /docs for release of 0.36.1 9ccc7cb11 releaser: Bump versions for release of 0.36.1 3db31be07 Merge commit '9cc9bab46288d8d5f9fda7009c5f746258cec1b4' 9468246c5 Add "target" and "rel" parameters to figure shortcode 6d7fa89f9 releaser: Prepare repository for 0.37-DEV 1aec7ad81 releaser: Add release notes to /docs for release of 0.36 b522da389 releaser: Bump versions for release of 0.36 bb78bea13 docs: Add documentation for smart cropping etc. 930f16cae Merge commit 'c305e44f5f081e4436195923a4593e396f07cd49' 0e4c80ab9 releaser: Prepare repository for 0.36-DEV e0d4c6bcd releaser: Add release notes to /docs for release of 0.35 f4ac67eb3 releaser: Bump versions for release of 0.35 229a50b1f docs: Regenerate CLI docs 72958eb9c Merge commit '337d0c5f516ee085205e8abefdb7f87e6d33ca05' d998ca4c0 command: Remove undraft command 34a0052ef docs: Re-generate CLI docs fa04ff331 releaser: Prepare repository for 0.35-DEV 55e595720 releaser: Add release notes to /docs for release of 0.34 bf4d0e8fb releaser: Bump versions for release of 0.34 07673370e releaser: Prepare repository for 0.34-DEV 921ea8920 releaser: Add release notes to /docs for release of 0.33 3307f61bd releaser: Bump versions for release of 0.33 792a4410d Merge commit '3cf4300097610bb8b5bd0686d96d1df5db641895' 6d8a9f657 releaser: Prepare repository for 0.33-DEV e3afccf6f releaser: Add release notes to /docs for release of 0.32.4 7f29cb196 releaser: Bump versions for release of 0.32.4 baa364436 releaser: Prepare repository for 0.33-DEV 60c775166 releaser: Add release notes to /docs for release of 0.32.3 9cbab1803 releaser: Bump versions for release of 0.32.3 51823efee releaser: Prepare repository for 0.33-DEV 71e03684c releaser: Add release notes to /docs for release of 0.32.2 e18bf56fb releaser: Bump versions for release of 0.32.2 54aa93927 Merge commit 'eb738cd35cca1ffc68c5ed688dbe2a19108e8761' 5e8123994 releaser: Prepare repository for 0.33-DEV a55b78124 releaser: Add release notes to /docs for release of 0.32.1 7de53ff41 releaser: Bump versions for release of 0.32.1 e6e58785d releaser: Prepare repository for 0.33-DEV 58cf5009d releaser: Add release notes to /docs for release of 0.32 031719821 Merge commit 'f3cd083961f36dc96d05e98aaf67f650102bc757' b9183604b Add Pandoc support, refactor external helpers 3f9b9474c releaser: Prepare repository for 0.32-DEV 11e4ce514 releaser: Add release notes to /docs for release of 0.31.1 aebb1504b releaser: Bump versions for release of 0.31.1 d70b54d4a releaser: Prepare repository for 0.32-DEV cdc10468e releaser: Add release notes to /docs for release of 0.31 38bd41cab releaser: Bump versions for release of 0.31 1c581a11d Merge commit '30c0d485eaff6d70df1be0353911ddca485d52bf' b88e46d02 Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683' a45ab174e Handle Taxonomy permalinks 9f27354f6 Add support for height argument to figure shortcode acc8e49c1 releaser: Prepare repository for 0.31-DEV 977266b19 releaser: Add release notes to /docs for release of 0.30.2 31b672844 releaser: Bump versions for release of 0.30.2 b8f6b72a8 Merge commit '325009c3fd4ac90021897b7e3e025c14e70ce162' c6e3dae71 releaser: Prepare repository for 0.31-DEV 2a3c7c7d9 releaser: Add release notes to /docs for release of 0.30.1 4c014117a releaser: Bump versions for release of 0.30.1 1da61da06 releaser: Prepare repository for 0.31-DEV 24864a46b releaser: Add release notes to /docs for release of 0.30 3011aa44a releaser: Bump versions for release of 0.30 bcbf3237b Merge commit 'ecf5e081b5540e69f4af330233f39a07baf53846' ab68b99ed Merge commit 'dae5a7c61cceeb0de59f2d755f63e453f71dd9b2' 0ae435725 tpl: Add errorf template function ac3fb3808 Change SummaryLength to be configurable (#3924) 3c0e4fa70 tpl: Add os.fileExists template function 9290f3983 Merge commit '9d68f695e782c6a83c77aff13317c7a22c694c98' 394e8b3f6 tpl: Add float template function c0c48c2ea releaser: Prepare repository for 0.30-DEV 0806d910b releaser: Add release notes to /docs for release of 0.29 0d1101836 releaser: Bump versions for release of 0.29 5d92b552b releaser: Prepare repository for 0.29-DEV 1ef521182 releaser: Add release notes to /docs for release of 0.28 c5441cff1 releaser: Bump versions for release of 0.28 46c2786f1 Merge commit '61c27b58b353c73772aae572c7d822fdfdf7791b' 6fed4008f Merge commit '30694a133a88d5f76a51d0372646e10cbeca7691' 595752e2f Merge commit '7a89dce53bfbd67a17442a8f9be8fa895fc4f9b1' af14cae0c Merge commit 'ba45da9d03056447e4873de13d4e0f8d658a769b' d0bb30963 releaser: Prepare repository for 0.28-DEV 469bf26aa releaser: Add release notes to /docs for release of 0.27.1 06ea00c12 releaser: Bump versions for release of 0.27.1 0668af58e releaser: Prepare repository for 0.28-DEV 4ce00c84d releaser: Add release notes to /docs for release of 0.27 68f318d0b releaser: Bump versions for release of 0.27 509ad6cc0 docs: Merge commit '1b4319be62ba071f79e90ef32dbe92eb893429f7' c625ae1ce docs: Document Related Content ecd5c24f5 docs: Merge commit '7d63a23b0c68d9cd7c7c09c2755619237bc03485' b97b84f9d Update docs versiona and README 2238f7a4a Merge commit 'ec4e6f9df2ab9ffdc62a3f59675369096e0d3f77' as 'docs' git-subtree-dir: docs git-subtree-split: cfe89ecbc2288a7270c23dbcc179733c8d978c4c --- diff --git a/config.toml b/config.toml index 61864c64..0ae616b8 100644 --- a/config.toml +++ b/config.toml @@ -34,7 +34,6 @@ section = [ "HTML", "RSS"] [mediaTypes] [mediaTypes."text/netlify"] -suffix = "" delimiter = "" [outputFormats] @@ -70,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.42.2" + release = "0.44" ## 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/new-in-032/index.md b/content/en/about/new-in-032/index.md index b8ca6430..5ae688fc 100644 --- a/content/en/about/new-in-032/index.md +++ b/content/en/about/new-in-032/index.md @@ -24,7 +24,7 @@ This documentation belongs in other places in this documentation site, but is pu Also see this demo project from [bep](https://github.com/bep/), the clever Norwegian behind these new features: -* http://hugotest.bep.is/ +* https://temp.bep.is/hugotest/ * https://github.com/bep/hugotest (source) ## Page Resources diff --git a/content/en/about/what-is-hugo.md b/content/en/about/what-is-hugo.md index 2c7339f7..de734486 100644 --- a/content/en/about/what-is-hugo.md +++ b/content/en/about/what-is-hugo.md @@ -43,27 +43,23 @@ Hugo is for people building a blog, a company site, a portfolio site, documentat [@spf13]: https://twitter.com/@spf13 [Aerobatic]: https://www.aerobatic.com/ -[Amazon S3]: http://aws.amazon.com/s3/ +[Amazon S3]: https://aws.amazon.com/s3/ [Azure]: https://blogs.msdn.microsoft.com/acoat/2016/01/28/publish-a-static-web-site-using-azure-web-apps/ -[CloudFront]: http://aws.amazon.com/cloudfront/ "Amazon CloudFront" -[contributing to it]: https://github.com/gohugoio/hugo -[DreamHost]: http://www.dreamhost.com/ +[CloudFront]: https://aws.amazon.com/cloudfront/ "Amazon CloudFront" +[DreamHost]: https://www.dreamhost.com/ [Firebase]: https://firebase.google.com/docs/hosting/ "Firebase static hosting" [GitHub Pages]: https://pages.github.com/ [GitLab Pages]: https://about.gitlab.com/features/pages/ [Go language]: https://golang.org/ [GoDaddy]: https://www.godaddy.com/ "Godaddy.com Hosting" -[Google Cloud Storage]: http://cloud.google.com/storage/ +[Google Cloud Storage]: https://cloud.google.com/storage/ [Heroku]: https://www.heroku.com/ -[Jekyll]: http://jekyllrb.com/ [Jekyll]: https://jekyllrb.com/ [Middleman]: https://middlemanapp.com/ -[Middleman]: https://middlemanapp.com/ -[Nanoc]: http://nanoc.ws/ [Nanoc]: https://nanoc.ws/ [Netlify]: https://netlify.com -[rackspace]: https://www.rackspace.com/cloud/files -[static site generator]: /about/benefits/ [Rackspace]: https://www.rackspace.com/cloud/files -[static site generator]: /about/benefits/ [Surge]: https://surge.sh +[contributing to it]: https://github.com/gohugoio/hugo +[rackspace]: https://www.rackspace.com/cloud/files +[static site generator]: /about/benefits/ diff --git a/content/en/content-management/authors.md b/content/en/content-management/authors.md index afc94fa6..530557ac 100644 --- a/content/en/content-management/authors.md +++ b/content/en/content-management/authors.md @@ -170,7 +170,7 @@ Last but not least, we have to create the second list that contains all publicat The layout for this page can be defined in the template `layouts/taxonomy/author.html`. {{< code file="layouts/taxonomy/author.html" download="author.html" >}} -{{ range .Data.Pages }} +{{ range .Pages }}

{{ .Title }}

written by {{ .Author.DisplayName }} {{ .Summary }} diff --git a/content/en/content-management/menus.md b/content/en/content-management/menus.md index c2eadf50..4278b03b 100644 --- a/content/en/content-management/menus.md +++ b/content/en/content-management/menus.md @@ -36,47 +36,7 @@ A **menu** is a named array of menu entries accessible by name via the [`.Site.M If you make use of the [multilingual feature](/content-management/multilingual/), you can define language-independent menus. {{% /note %}} -A menu entry has the following properties (i.e., variables) available to it: - -`.URL` -: string - -`.Name` -: string - -`.Menu` -: string - -`.Identifier` -: string - -`.Pre` -: template.HTML - -`.Post` -: template.HTML - -`.Weight` -: int - -`.Parent` -: string - -`.Children` -: Menu - -Note that menus also have the following functions available as well: - -`.HasChildren` -: boolean - -Additionally, there are some relevant functions available to menus on a page: - -`.IsMenuCurrent` -: (menu string, menuEntry *MenuEntry ) boolean - -`.HasMenuCurrent` -: (menu string, menuEntry *MenuEntry) boolean +See the [Menu Entry Properties][me-props] for all the variables and functions related to a menu entry. ## Add content to menus @@ -139,7 +99,7 @@ The URLs must be relative to the context root. If the `baseURL` is `https://exam {{% /note %}} ## Nesting - + All nesting of content is done via the `parent` field. The parent of an entry should be the identifier of another entry. The identifier should be unique (within a menu). @@ -159,3 +119,4 @@ See [Menu Templates](/templates/menu-templates/) for information on how to rende [config]: /getting-started/configuration/ [multilingual]: /content-management/multilingual/ [sitevars]: /variables/ +[me-props]: /variables/menus/ diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index 5755676c..9a4c77d4 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -39,7 +39,7 @@ To list up to 5 related pages is as simple as including something similar to thi 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 %}} -The full set of methods available on the page lists can bee seen in this Go interface: +The full set of methods available on the page lists can be seen in this Go interface: ```go // A PageGenealogist finds related pages in a page collection. This interface is implemented diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index 0116078f..35305764 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -178,7 +178,7 @@ This shortcode will convert the source code provided into syntax-highlighted HTM

{{ .Title }}

- {{ range .Data.Pages }} + {{ range .Pages }} {{ .Render "summary"}} {{ end }}
@@ -194,7 +194,7 @@ The `highlight` shortcode example above would produce the following HTML when th <section id="main"> <div> <h1 id="title">{{ .Title }}</h1> - {{ range .Data.Pages }} + {{ range .Pages }} {{ .Render "summary"}} {{ end }} </div> diff --git a/content/en/content-management/static-files.md b/content/en/content-management/static-files.md index fe5ea77e..8967f598 100644 --- a/content/en/content-management/static-files.md +++ b/content/en/content-management/static-files.md @@ -1,6 +1,6 @@ --- title: Static Files -description: "The `static` folder is where you place all your **static files**." +description: "Files that get served **statically** (as-is, no modification) on the site root." date: 2017-11-18 categories: [content management] keywords: [source, directories] @@ -13,36 +13,58 @@ aliases: [/static-files] toc: true --- -The `static` folder is where you place all your **static files**, e.g. stylesheets, JavaScript, images etc. +By default, the `static/` directory in the site project is used for +all **static files** (e.g. stylesheets, JavaScript, images). -You can set the name of the static folder to use in your configuration file. From **Hugo 0.31** you can configure as many static directories as you need. All the files in all the static directories will form a union filesystem. +Hugo can be configured to look into a different directory, or even +**multiple directories** for such static files by configuring the +`staticDir` parameter in the [site config][]. All the files in all the +static directories will form a union filesystem. -Example: +This union filesystem will be served from your site root. So a file +`/static/me.png` will be accessible as +`/me.png`. + +Here's an example of setting `staticDir` and `staticDir2` for a +multi-language site: {{< code-toggle copy="false" file="config" >}} staticDir = ["static1", "static2"] -[languages] -[languages.no] -staticDir = ["staticDir_override", "static_no"] -baseURL = "https://example.no" -languageName = "Norsk" -weight = 1 -title = "PÃ¥ norsk" +[languages] [languages.en] staticDir2 = "static_en" baseURL = "https://example.com" languageName = "English" weight = 2 title = "In English" +[languages.no] +staticDir = ["staticDir_override", "static_no"] +baseURL = "https://example.no" +languageName = "Norsk" +weight = 1 +title = "PÃ¥ norsk" {{}} In the above, with no theme used: -* The English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win. -* The Norwegian site will get its static files as a union of "staticDir_override" and "static_no". +- The English site will get its static files as a union of "static1", + "static2" and "static_en". On file duplicates, the right-most + version will win. +- The Norwegian site will get its static files as a union of + "staticDir_override" and "static_no". + +Note 1 +: The **2** (can be a number between 0 and 10) in `staticDir2` is + added to tell Hugo that you want to **add** this directory to the + global set of static directories defined using `staticDir`. Using + `staticDir` on the language level would replace the global value (as + can be seen in the Norwegian site case). -**Note:** The `2` `static2` (can be a number between 0 and 10) is added to tell Hugo that you want to **add** this directory to the global set of static directories. Using `staticDir` on the language level would replace the global value. +Note 2 +: The example above is a [multihost setup][]. In a regular setup, all + the static directories will be available to all sites. -**Note:** The example above is a [multihost setup](/content-management/multilingual/#configure-multilingual-multihost). In a regular setup, all the static directories will be available to all sites. +[site config]: /getting-started/configuration/#all-configuration-settings +[multihost setup]: /content-management/multilingual/#configure-multilingual-multihost diff --git a/content/en/content-management/summaries.md b/content/en/content-management/summaries.md index 1c341400..0f893937 100644 --- a/content/en/content-management/summaries.md +++ b/content/en/content-management/summaries.md @@ -1,7 +1,7 @@ --- title: Content Summaries linktitle: Summaries -description: Hugo generates summaries of your content. +description: Hugo generates summaries of your content. date: 2017-01-10 publishdate: 2017-01-10 lastmod: 2017-01-10 @@ -57,7 +57,7 @@ Be careful to enter <!--more--> exactly You can show content summaries with the following code. You could use the following snippet, for example, in a [section template][]. {{< code file="page-list-with-summaries.html" >}} -{{ range first 10 .Data.Pages }} +{{ range first 10 .Pages }}
@@ -78,4 +78,4 @@ Note how the `.Truncated` boolean valuable may be used to hide the "Read More... [org]: /content-management/formats/ [pagevariables]: /variables/page/ -[section template]: /templates/section-templates/ \ No newline at end of file +[section template]: /templates/section-templates/ diff --git a/content/en/content-management/syntax-highlighting.md b/content/en/content-management/syntax-highlighting.md index 4576624d..841ecbd3 100644 --- a/content/en/content-management/syntax-highlighting.md +++ b/content/en/content-management/syntax-highlighting.md @@ -134,7 +134,7 @@ Highlighting is carried out via the [built-in shortcode](/content-management/sho

{{ .Title }}

- {{ range .Data.Pages }} + {{ range .Pages }} {{ .Render "summary"}} {{ end }}
@@ -157,7 +157,7 @@ It is also possible to add syntax highlighting with GitHub flavored code fences.

{{ .Title }}

- {{ range .Data.Pages }} + {{ range .Pages }} {{ .Render "summary"}} {{ end }}
diff --git a/content/en/functions/after.md b/content/en/functions/after.md index f01ba143..d627f792 100644 --- a/content/en/functions/after.md +++ b/content/en/functions/after.md @@ -39,7 +39,7 @@ You can use `after` in combination with the [`first` function][] and Hugo's [pow {{ define "main" }}

Featured Article

- {{ range first 1 .Data.Pages.ByPublishDate.Reverse }} + {{ range first 1 .Pages.ByPublishDate.Reverse }}

{{.Title}}

@@ -48,7 +48,7 @@ You can use `after` in combination with the [`first` function][] and Hugo's [pow

Recent Articles

- {{ range first 3 (after 1 .Data.Pages.ByPublishDate.Reverse) }} + {{ range first 3 (after 1 .Pages.ByPublishDate.Reverse) }}

{{.Title}}

diff --git a/content/en/functions/first.md b/content/en/functions/first.md index 29ba3ac1..464dfa67 100644 --- a/content/en/functions/first.md +++ b/content/en/functions/first.md @@ -21,8 +21,7 @@ aliases: [] ``` -{{ range first 10 .Data.Pages }} +{{ range first 10 .Pages }} {{ .Render "summary" }} {{ end }} ``` - diff --git a/content/en/functions/hasmenucurrent.md b/content/en/functions/hasmenucurrent.md index eac41103..c7b8eb7a 100644 --- a/content/en/functions/hasmenucurrent.md +++ b/content/en/functions/hasmenucurrent.md @@ -10,14 +10,18 @@ menu: docs: parent: "functions" keywords: [menus] -signature: ["HasMenuCurrent"] +signature: ["PAGE.HasMenuCurrent MENU MENUENTRY"] workson: [menus] hugoversion: -relatedfuncs: [] +relatedfuncs: ["IsMenuCurrent"] deprecated: false toc: false -draft: true +draft: false aliases: [] --- -Used in [menu templates](/templates/menu-templates/). +`.HasMenuCurrent` is a method in `Page` object returning a _boolean_ value. It +returns `true` if the PAGE is the same object as the `.Page` in one of the +**children menu entries** under MENUENTRY in a given MENU. + +You can find its example use in [menu templates](/templates/menu-templates/). diff --git a/content/en/functions/ismenucurrent.md b/content/en/functions/ismenucurrent.md index 647dcdcf..66c7197a 100644 --- a/content/en/functions/ismenucurrent.md +++ b/content/en/functions/ismenucurrent.md @@ -10,14 +10,18 @@ menu: docs: parent: "functions" keywords: [menus] -signature: ["IsMenuCurrent"] +signature: ["PAGE.IsMenuCurrent MENU MENUENTRY"] workson: [menus] hugoversion: -relatedfuncs: [] +relatedfuncs: ["HasMenuCurrent"] deprecated: false -draft: true +draft: false aliases: [] needsexample: true --- -Used in [menu templates](/templates/menu-templates/). +`.IsMenuCurrent` is a method in `Page` object returning a _boolean_ value. It +returns `true` if the PAGE is the same object as the `.Page` in MENUENTRY in a +given MENU. + +You can find its example use in [menu templates](/templates/menu-templates/). diff --git a/content/en/functions/last.md b/content/en/functions/last.md index ea633837..f992b980 100644 --- a/content/en/functions/last.md +++ b/content/en/functions/last.md @@ -23,8 +23,7 @@ aliases: [] ``` -{{ range last 10 .Data.Pages }} +{{ range last 10 .Pages }} {{ .Render "summary" }} {{ end }} ``` - diff --git a/content/en/functions/render.md b/content/en/functions/render.md index a4abfa81..c76af39f 100644 --- a/content/en/functions/render.md +++ b/content/en/functions/render.md @@ -26,7 +26,7 @@ This function is only available when applied to a single piece of content within This example could render a piece of content using the content view located at `/layouts/_default/summary.html`: ``` -{{ range .Data.Pages }} +{{ range .Pages }} {{ .Render "summary"}} {{ end }} ``` diff --git a/content/en/functions/scratch.md b/content/en/functions/scratch.md index 9df78fe4..2282eff1 100644 --- a/content/en/functions/scratch.md +++ b/content/en/functions/scratch.md @@ -30,11 +30,19 @@ See [this Go issue](https://github.com/golang/go/issues/10608) for the main moti For a detailed analysis of `.Scratch` and in context use cases, see this [post](https://regisphilibert.com/blog/2017/04/hugo-scratch-explained-variable/). {{% /note %}} -## Methods +## Get a Scratch -`Scratch` is added to both `Page` and `Shortcode` -- with following methods: +From Hugo `0.43` you can also create a locally scoped `Scratch` by calling `newScratch`: + +```go-html-template +$scratch := newScratch +$scratch.Set "greeting" "Hello" +``` + +A `Scratch` is also added to both `Page` and `Shortcode`. `Sratch` have the following methods: #### .Set + Set the given value to a given key ```go-html-template diff --git a/content/en/functions/where.md b/content/en/functions/where.md index eb311121..9ad8daf2 100644 --- a/content/en/functions/where.md +++ b/content/en/functions/where.md @@ -23,7 +23,7 @@ needsexample: true `where` filters an array to only the elements containing a matching value for a given field. ```go-html-template -{{ range where .Data.Pages "Section" "post" }} +{{ range where .Pages "Section" "post" }} {{ .Content }} {{ end }} ``` @@ -45,7 +45,7 @@ series: golang It can also be used with the logical operators `!=`, `>=`, `in`, etc. Without an operator, `where` compares a given field with a matching value equivalent to `=`. ```go-html-template -{{ range where .Data.Pages "Section" "!=" "post" }} +{{ range where .Pages "Section" "!=" "post" }} {{ .Content }} {{ end }} ``` @@ -104,7 +104,7 @@ You can also put the returned value of the `where` clauses into a variable: The following grabs the first five content files in `post` using the [default ordering](/templates/lists/) for lists (i.e., `weight => date`): {{< code file="where-with-first.html" >}} -{{ range first 5 (where .Data.Pages "Section" "post") }} +{{ range first 5 (where .Pages "Section" "post") }} {{ .Content }} {{ end }} {{< /code >}} @@ -114,7 +114,7 @@ The following grabs the first five content files in `post` using the [default or You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured: ```go-html-template -{{ range where (where .Data.Pages "Section" "blog" ) ".Params.featured" "!=" "true" }} +{{ range where (where .Pages "Section" "blog" ) ".Params.featured" "!=" "true" }} ``` ## Unset Fields @@ -129,7 +129,7 @@ Only the following operators are available for `nil` * `!=`, `<>`, `ne`: True if the given field is set. ```go-html-template -{{ range where .Data.Pages ".Params.specialpost" "!=" nil }} +{{ range where .Pages ".Params.specialpost" "!=" nil }} {{ .Content }} {{ end }} ``` diff --git a/content/en/getting-started/code-toggle.md b/content/en/getting-started/code-toggle.md index 3e6b7da0..b304d2c5 100644 --- a/content/en/getting-started/code-toggle.md +++ b/content/en/getting-started/code-toggle.md @@ -12,7 +12,7 @@ toc: true ## The Config Toggler! -This is an exemple for the Config Toggle shortcode. +This is an example for the Config Toggle shortcode. Its purpose is to let users choose a Config language by clicking on its corresponding tab. Upon doing so, every Code toggler on the page will be switched to the target language. Also, target language will be saved in user's `localStorage` so when they go to a different pages, Code Toggler display their last "toggled" config language. ## That Config Toggler diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index ea21fa5c..7b0ca2a0 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -193,7 +193,7 @@ sitemap : Default [sitemap configuration](/templates/sitemap-template/#configure-sitemap-xml). staticDir ("static") -: Relative directory from where Hugo reads static files. +: A directory or a list of directories from where Hugo reads [static files][static-files]. stepAnalysis (false) : Display memory and timing of different steps of the program. @@ -405,3 +405,4 @@ Hugo v0.20 introduced the ability to render your content to multiple output form [templates]: /templates/ [toml]: https://github.com/toml-lang/toml [yaml]: http://yaml.org/spec/ +[static-files]: /content-management/static-files/ diff --git a/content/en/getting-started/installing.md b/content/en/getting-started/installing.md index 7a81d097..a4cf0801 100644 --- a/content/en/getting-started/installing.md +++ b/content/en/getting-started/installing.md @@ -1,7 +1,7 @@ --- title: Install Hugo linktitle: Install Hugo -description: Install Hugo on macOS, Windows, Linux, FreeBSD, and on any machine where the Go compiler tool chain can run. +description: Install Hugo on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine where the Go compiler tool chain can run. date: 2016-11-01 publishdate: 2016-11-01 lastmod: 2018-01-02 @@ -31,6 +31,7 @@ Hugo currently provides pre-built binaries for the following: * macOS (Darwin) for x64, i386, and ARM architectures * Windows * Linux +* OpenBSD * FreeBSD Hugo may also be compiled from source wherever the Go compiler tool chain can run; e.g., on other operating systems such as DragonFly BSD, OpenBSD, Plan 9, Solaris, and others. See for the full set of supported combinations of target operating systems and compilation architectures. @@ -451,7 +452,7 @@ Hugo-as-a-snap can write only inside the user’s `$HOME` directory---and gvfs-m You can also install Hugo from the Arch Linux [community](https://www.archlinux.org/packages/community/x86_64/hugo/) repository. Applies also for derivatives such as Manjaro. ``` -sudo pacman -Sy hugo +sudo pacman -Syu hugo ``` ### Fedora @@ -468,6 +469,14 @@ sudo dnf install hugo See the [related discussion in the Hugo forums][redhatforum]. +## OpenBSD + +OpenBSD provides a package for Hugo via `pkg_add`: + +``` +doas pkg_add hugo +``` + ## Upgrade Hugo Upgrading Hugo is as easy as downloading and replacing the executable you’ve placed in your `PATH` or run `brew upgrade hugo` if using Homebrew. diff --git a/content/en/news/0.30-relnotes/index.md b/content/en/news/0.30-relnotes/index.md index db49a1bf..9281a5c2 100644 --- a/content/en/news/0.30-relnotes/index.md +++ b/content/en/news/0.30-relnotes/index.md @@ -9,7 +9,7 @@ images: --- -Hugo `0.30` is the **Race Car Edition**. Hugo is already very very fast, but much wants more. So we added **Fast Render Mode**. It is hard to explain, so start the Hugo development server with `hugo server` and start editing. Live reloads just got so much faster! The "how and what" is discussed at length in [other places](https://github.com/gohugoio/hugo/pull/3959), but the short version is that we now re-render only the parts of the site that you are working on. +Hugo `0.30` is the **Race Car Edition**. Hugo is already very very fast, but wants much more. So we added **Fast Render Mode**. It is hard to explain, so start the Hugo development server with `hugo server` and start editing. Live reloads just got so much faster! The "how and what" is discussed at length in [other places](https://github.com/gohugoio/hugo/pull/3959), but the short version is that we now re-render only the parts of the site that you are working on. The second performance-related feature is a follow-up to the Template Metrics added in Hugo `0.29`. Now, if you add the flag `--templateMetricsHints`, we will calculate a score for how your partials can be cached (with the `partialCached` template func). diff --git a/content/en/news/0.43-relnotes/featured-hugo-43-poster.png b/content/en/news/0.43-relnotes/featured-hugo-43-poster.png new file mode 100644 index 00000000..b221ca7f Binary files /dev/null and b/content/en/news/0.43-relnotes/featured-hugo-43-poster.png differ diff --git a/content/en/news/0.43-relnotes/index.md b/content/en/news/0.43-relnotes/index.md new file mode 100644 index 00000000..cd851599 --- /dev/null +++ b/content/en/news/0.43-relnotes/index.md @@ -0,0 +1,100 @@ + +--- +date: 2018-07-09 +title: "And Now: Hugo Pipes!" +description: "Hugo 0.43 adds a powerful and simple to use assets pipeline with SASS/SCSS and much, much more …" +categories: ["Releases"] +--- + + Hugo `0.43` adds a powerful and very simple to use **Assets Pipeline** with **SASS and SCSS** with source map support, **PostCSS** and **minification** and **fingerprinting** and **Subresource Integrity** and ... much more. Oh, did we mention that you can now do **ad-hoc image processing** and execute text resources as Go templates? + +An example pipeline: + +```go-html-template +{{ $styles := resources.Get "scss/main.scss" | toCSS | postCSS | minify | fingerprint }} + +``` + +To me, the above is beautiful in its speed and simplicity. It could be printed on a t-shirt. I wrote in the [Hugo Birthday Post](https://gohugo.io/news/lets-celebrate-hugos-5th-birthday/) some days ago about the value of a single binary with native and fast implementations. I should have added _simplicity_ as a keyword. There seem to be a misconception that all of this needs to be hard and painful. + +New functions to create `Resource` objects: + +* `resources.Get` +* `resources.FromString`: Create a Resource from a string. + +New `Resource` transformation funcs: + +* `resources.ToCSS`: Compile `SCSS` or `SASS` into `CSS`. +* `resources.PostCSS`: Process your CSS with PostCSS. Config file support (project or theme or passed as an option). +* `resources.Minify`: Currently supports `css`, `js`, `json`, `html`, `svg`, `xml`. +* `resources.Fingerprint`: Creates a fingerprinted version of the given Resource with Subresource Integrity. +* `resources.Concat`: Concatenates a list of Resource objects. Think of this as a poor man's bundler. +* `resources.ExecuteAsTemplate`: Parses and executes the given Resource and data context (e.g. .Site) as a Go template. + + +I, [@bep](https://github.com/bep), implemented this in [dea71670](https://github.com/gohugoio/hugo/commit/dea71670c059ab4d5a42bd22503f18c087dd22d4). We will work hard to get the documentation up to date, but follow the links above for details, and also see this [demo project](https://github.com/bep/hugo-sass-test). + + +This release represents **35 contributions by 7 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), [@openscript](https://github.com/openscript), and [@caarlos0](https://github.com/caarlos0) 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 **11 contributions by 5 contributors**. A special thanks to [@bep](https://github.com/bep), [@danrl](https://github.com/danrl), [@regisphilibert](https://github.com/regisphilibert), and [@digitalcraftsman](https://github.com/digitalcraftsman) for their work on the documentation site. + +Hugo now has: + +* 26968+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 443+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 238+ [themes](http://themes.gohugo.io/) + +## Notes + +* Replace deprecated {Get,}ByPrefix with {Get,}Match [42ed6025](https://github.com/gohugoio/hugo/commit/42ed602580a672e420e1d860384e812f4871ff67) [@anthonyfok](https://github.com/anthonyfok) +* Hugo is now released with two binary version: One with and one without SCSS/SASS support. At the time of writing, this is only available in the binaries on the GitHub release page. Brew, Snap builds etc. will come. But note that you **only need the extended version if you want to edit SCSS**. For your CI server, or if you don't use SCSS, you will most likely want the non-extended version. + +## Enhancements + +### Templates + +* Return en empty slice in `after` instead of error [f8212d20](https://github.com/gohugoio/hugo/commit/f8212d20009c4b5cc6e1ec733d09531eb6525d9f) [@bep](https://github.com/bep) [#4894](https://github.com/gohugoio/hugo/issues/4894) +* Update internal pagination template to support Bootstrap 4 [ca1e46ef](https://github.com/gohugoio/hugo/commit/ca1e46efb94e3f3d2c8482cb9434d2f38ffd2683) [@bep](https://github.com/bep) [#4881](https://github.com/gohugoio/hugo/issues/4881) +* Support text/template/parse API change in go1.11 [9f27091e](https://github.com/gohugoio/hugo/commit/9f27091e1067875e2577c331acc60adaef5bb234) [@anthonyfok](https://github.com/anthonyfok) [#4784](https://github.com/gohugoio/hugo/issues/4784) + +### Core + +* Allow forward slash in shortcode names [de37455e](https://github.com/gohugoio/hugo/commit/de37455ec73cffd039b44e8f6c62d2884b1d6bbd) [@bep](https://github.com/bep) [#4886](https://github.com/gohugoio/hugo/issues/4886) +* Reset the global pages cache on server rebuilds [128f14ef](https://github.com/gohugoio/hugo/commit/128f14efad90886ffef37c01ac1e20436a732f97) [@bep](https://github.com/bep) [#4845](https://github.com/gohugoio/hugo/issues/4845) + +### Other + +* Bump CircleCI image [e3df6478](https://github.com/gohugoio/hugo/commit/e3df6478f09a7a5fed96aced791fa94fd2c35d1a) [@bep](https://github.com/bep) +* Add Goreleaser extended config [626afc98](https://github.com/gohugoio/hugo/commit/626afc98254421f5a5edc97c541b10bd81d5bbbb) [@bep](https://github.com/bep) [#4908](https://github.com/gohugoio/hugo/issues/4908) +* Build both hugo and hugo.extended for 0.43 [e1027c58](https://github.com/gohugoio/hugo/commit/e1027c5846b48c4ad450f6cc27e2654c9e0dae39) [@anthonyfok](https://github.com/anthonyfok) [#4908](https://github.com/gohugoio/hugo/issues/4908) +* Add temporary build script [bfc3488b](https://github.com/gohugoio/hugo/commit/bfc3488b8e8b3dc1ffc6a339ee2dac8dcbdb55a9) [@bep](https://github.com/bep) +* Add "extended" to "hugo version" [ce84b524](https://github.com/gohugoio/hugo/commit/ce84b524f4e94299b5b66afe7ce1a9bd4a9959fc) [@anthonyfok](https://github.com/anthonyfok) [#4913](https://github.com/gohugoio/hugo/issues/4913) +* Add a newScratch template func [2b8d907a](https://github.com/gohugoio/hugo/commit/2b8d907ab731627f4e2a30442cd729064516c8bb) [@bep](https://github.com/bep) [#4685](https://github.com/gohugoio/hugo/issues/4685) +* Add Hugo Piper with SCSS support and much more [dea71670](https://github.com/gohugoio/hugo/commit/dea71670c059ab4d5a42bd22503f18c087dd22d4) [@bep](https://github.com/bep) [#4381](https://github.com/gohugoio/hugo/issues/4381)[#4903](https://github.com/gohugoio/hugo/issues/4903)[#4858](https://github.com/gohugoio/hugo/issues/4858) +* Consider root and current section's content type if set in front matter [c790029e](https://github.com/gohugoio/hugo/commit/c790029e1dbb0b66af18d05764bd6045deb2e180) [@bep](https://github.com/bep) [#4891](https://github.com/gohugoio/hugo/issues/4891) +* Update docker image [554553c0](https://github.com/gohugoio/hugo/commit/554553c09c7657d28681e1fa0638806a452737a0) [@bep](https://github.com/bep) +* Merge branch 'release-0.42.2' [282f6035](https://github.com/gohugoio/hugo/commit/282f6035e7c36f8550d91033e3a66718468c6c8b) [@bep](https://github.com/bep) +* Release 0.42.2 [1637d12e](https://github.com/gohugoio/hugo/commit/1637d12e3762fc1ebab4cd675f75afaf25f59cdb) [@bep](https://github.com/bep) +* Update GoReleaser config [1f0c4e1f](https://github.com/gohugoio/hugo/commit/1f0c4e1fb347bb233f3312c424fbf5a013c03604) [@caarlos0](https://github.com/caarlos0) +* Create missing head.html partial on new theme generation [fd71fa89](https://github.com/gohugoio/hugo/commit/fd71fa89bd6c197402582c87b2b76d4b96d562bf) [@openscript](https://github.com/openscript) +* Add html doctype to baseof.html template for new themes [b5a3aa70](https://github.com/gohugoio/hugo/commit/b5a3aa7082135d0a573f4fbb00f798e26b67b902) [@openscript](https://github.com/openscript) +* Adds .gitattributes to force Go files to LF [6a2968fd](https://github.com/gohugoio/hugo/commit/6a2968fd5c0116d93de0f379ac615e9076821899) [@neurocline](https://github.com/neurocline) +* Update to Go 1.9.7 and Go 1.10.3 [23d5fc82](https://github.com/gohugoio/hugo/commit/23d5fc82ee01d56440d0991c899acd31e9b63e27) [@anthonyfok](https://github.com/anthonyfok) +* Update Dockerfile to a multi-stage build [8531ec7c](https://github.com/gohugoio/hugo/commit/8531ec7ca36fd35a57fba06bbb06a65c94dfd3ed) [@skoblenick](https://github.com/skoblenick) [#4154](https://github.com/gohugoio/hugo/issues/4154) +* Release 0.42.1 [d67e843c](https://github.com/gohugoio/hugo/commit/d67e843c1212e1f53933556b5f946c8541188d9a) [@bep](https://github.com/bep) +* Do not fail server build when /static is missing [34ee27a7](https://github.com/gohugoio/hugo/commit/34ee27a78b9e2b5f475d44253ae234067b76cc6e) [@bep](https://github.com/bep) [#4846](https://github.com/gohugoio/hugo/issues/4846) + +## Fixes + +* Do not create paginator pages for the other output formats [43338c3a](https://github.com/gohugoio/hugo/commit/43338c3a99769eb7d0df0c12559b8b3d42b67dba) [@bep](https://github.com/bep) [#4890](https://github.com/gohugoio/hugo/issues/4890) +* Fix the shortcodes/partials vs base template detection [a5d0a57e](https://github.com/gohugoio/hugo/commit/a5d0a57e6bdab583134a68c035aac9b3007f006a) [@bep](https://github.com/bep) [#4897](https://github.com/gohugoio/hugo/issues/4897) +* nfpm replacements [e1a052ec](https://github.com/gohugoio/hugo/commit/e1a052ecb823c688406a8af97dfaaf52a75231da) [@caarlos0](https://github.com/caarlos0) +* Fix typos [3cea2932](https://github.com/gohugoio/hugo/commit/3cea2932e17a08ebc19cd05f3079d9379bc8fba5) [@idealhack](https://github.com/idealhack) + + + + diff --git a/content/en/news/0.44-relnotes/featured-hugo-44-poster.png b/content/en/news/0.44-relnotes/featured-hugo-44-poster.png new file mode 100644 index 00000000..330b235f Binary files /dev/null and b/content/en/news/0.44-relnotes/featured-hugo-44-poster.png differ diff --git a/content/en/news/0.44-relnotes/index.md b/content/en/news/0.44-relnotes/index.md new file mode 100644 index 00000000..aa839689 --- /dev/null +++ b/content/en/news/0.44-relnotes/index.md @@ -0,0 +1,39 @@ + +--- +date: 2018-07-13 +title: "Hugo 0.44: Friday the 13th Edition" +description: "A sequel to the very popular Hugo Pipes Edition; bug-fixes and enhancements …" +categories: ["Releases"] +--- + + +Hugo `0.44` is the follow-up release, or **The Sequel**, of the very well received `0.43` only days ago. That release added **Hugo Pipes**, with SCSS/SASS support, assets bundling and minification, ad-hoc image processing and much more. + +This is mostly a bug-fix release, but it also includes several important improvements. + +Many complained that their SVG images vanished when browsed from the `hugo server`. With **Hugo Pipes** MIME types suddenly got really important, but Hugo's use of `Suffix` was ambiguous. This became visible when we redefined the `image/svg+xml` to work with **Hugo Pipes**. We have now added a `Suffixes` field on the MIME type definition in Hugo, which is a list of one or more filename suffixes the MIME type is identified with. If you need to add a custom MIME type definition, this means that you also need to specify the full MIME type as the key, e.g. `image/svg+xml`. + +Hugo now has: + +* 27120+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 443+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 239+ [themes](http://themes.gohugo.io/) + +## Notes +* `MediaType.Suffix` is deprecated and replaced with a plural version, `MediaType.Suffixes`, with a more specific definition. You will get a detailed WARNING in the console if you need to do anything. + +## Enhancements +* Allow multiple file suffixes per media type [b874a1ba](https://github.com/gohugoio/hugo/commit/b874a1ba7ab8394dc741c8c70303a30a35b63e43) [@bep](https://github.com/bep) [#4920](https://github.com/gohugoio/hugo/issues/4920) +* Clean up the in-memory Resource reader usage [47d38628](https://github.com/gohugoio/hugo/commit/47d38628ec0f4e72ff17661f13456b2a1511fe13) [@bep](https://github.com/bep) [#4936](https://github.com/gohugoio/hugo/issues/4936) +* Move opening of the transformed resources after cache check [0024dcfe](https://github.com/gohugoio/hugo/commit/0024dcfe3e016c67046de06d1dac5e7f5235f9e1) [@bep](https://github.com/bep) +* Improve type support in `resources.Concat` [306573de](https://github.com/gohugoio/hugo/commit/306573def0e20ec16ee5c447981cc09ed8bb7ec7) [@bep](https://github.com/bep) [#4934](https://github.com/gohugoio/hugo/issues/4934) +* Flush `partialCached` cache on rebuilds [6b6dcb44](https://github.com/gohugoio/hugo/commit/6b6dcb44a014699c289bf32fe57d4c4216777be0) [@bep](https://github.com/bep) [#4931](https://github.com/gohugoio/hugo/issues/4931) +* Include the transformation step in the error message [d96f2a46](https://github.com/gohugoio/hugo/commit/d96f2a460f58e91d8f6253a489d4879acfec6916) [@bep](https://github.com/bep) [#4924](https://github.com/gohugoio/hugo/issues/4924) +* Exclude *.svg from CRLF/LF conversion [9c1e8208](https://github.com/gohugoio/hugo/commit/9c1e82085eb07d5b4dcdacbe82d5bafd26e08631) [@anthonyfok](https://github.com/anthonyfok) + +## Fixes + +* Fix `resources.Concat` for transformed resources [beec1fc9](https://github.com/gohugoio/hugo/commit/beec1fc98e5d37bba742d6bc2a0ff7c344b469f8) [@bep](https://github.com/bep) [#4936](https://github.com/gohugoio/hugo/issues/4936) +* Fix static filesystem for themed multihost sites [80c8f3b8](https://github.com/gohugoio/hugo/commit/80c8f3b81a9849080e64bf877288ede28d960d3f) [@bep](https://github.com/bep) [#4929](https://github.com/gohugoio/hugo/issues/4929) +* Set permission of embedded templates to 0644 [2b73e89d](https://github.com/gohugoio/hugo/commit/2b73e89d6d2822e86360a6c92c87f539677c119b) [@anthonyfok](https://github.com/anthonyfok) + diff --git a/content/en/news/lets-celebrate-hugos-5th-birthday/index.md b/content/en/news/lets-celebrate-hugos-5th-birthday/index.md index a06d535d..9912027b 100644 --- a/content/en/news/lets-celebrate-hugos-5th-birthday/index.md +++ b/content/en/news/lets-celebrate-hugos-5th-birthday/index.md @@ -59,7 +59,7 @@ Hugo has stuck with the sub-zero versions to signal active development, with a n ### The Road to 1.0 -We have some more technical tasks that needs to be done (there is ongoing work to get the page quries into a more consistent state, also a simpler `.GetPage` method), but also some cool new functionality. The following roadmap is taken from memory, and may not be complete, but should be a good indication of what's ahead. +We have some more technical tasks that needs to be done (there is ongoing work to get the page queries into a more consistent state, also a simpler `.GetPage` method), but also some cool new functionality. The following roadmap is taken from memory, and may not be complete, but should be a good indication of what's ahead. Pages from "other data sources" : Currently, in addition to Hugo's list pages, every URL must be backed by a content file (Markdown, HTML etc.). This covers most use cases, but we need a flexible way to generate pages from other data sources. Think product catalogues and similar. @@ -67,7 +67,7 @@ Pages from "other data sources" Upgrade Blackfriday to v2 : [Blackfriday](https://github.com/russross/blackfriday) is the main content renderer in Hugo. It has been rewritten to a more flexible architecture, which should allow us to fix some of the current shortcomings. -We should be able to create a better and easier-to-use data structure from the rendered content: Summary, the content after the summary, being able to range over the footnotes and the ToC. Having ToC as a proper data structure also open up a few other potential uses; using it as an index in [Related Content](https://gohugo.io/content-management/related/) would be one example. +We should be able to create a better and easier-to-use data structure from the rendered content: Summary, the content after the summary, being able to range over the footnotes and the ToC. Having ToC as a proper data structure also opens up a few other potential uses; using it as an index in [Related Content](https://gohugo.io/content-management/related/) would be one example. This should also enable us to _do more_ with [Custom Output Formats](/templates/output-formats). It is already very powerful. GettyPubs are using it in [Quire](https://github.com/gettypubs/quire) to build [beautiful multi-platform publications](http://www.getty.edu/publications/digital/digitalpubs.html). But it can be improved. For rendering of content files, you are currently restricted to HTML. It would be great if we could configure alternative renderers per output format, such as LaTeX and EPUB. @@ -75,7 +75,7 @@ Related to this is also to add a configurable "Markdown URL rewriter", which sho ### The Road to the Future -These are the items that first comes to mind if you ask me to think even further ahead: +These are the items that first come to mind if you ask me to think even further ahead: Dependency manager for Theme Components : In Hugo `0.42` we added [Theme Components](/themes/theme-components/) and Theme Inheritance. With SCSS support in Hugo `0.43`, which also follows the same project/themes precedence order (add `_variables.scss` to your project, configure SASS colour variables in `config.toml`), we have a solid foundation for creating easy to use and extensible themes. But we are missing some infrastructure around this. We have a site with 235+ [themes](https://themes.gohugo.io/)[^themes] listed, but you currently need to do some added work to get the theme up and running for your site. In the Go world, we don't have NPM to use, which is a curse and a blessing, but I have some ideas about building a simple dependency manager into Hugo, modelled after how Go is doing it (`hugo install`). You should be able to configure what theme and theme components you want to use, and Hugo should handle the installation of the correct versions. This should make it easier for the user, but it would also enable community driven and even commercial "theme stores". @@ -90,19 +90,19 @@ The "New York Times on Hugo" Use Case : There are recurring questions on the support forum from [really big sites](https://discourse.gohugo.io/t/transition-2m-posts-from-wordpress-to-hugo/12704) that want to move to Hugo. There are many [good reasons](https://www.netlify.com/blog/2016/05/18/9-reasons-your-site-should-be-static/) why they want this (security, cost-saving, EU regulations etc.). And while there have been reports about companies building 600 000 pages with Hugo on very powerful hardware, we will have to rethink the build model to make this usable. Keywords are: streaming builds, segmented builds, partial rebuilds. There are other site generators also talking about this. It should be possible, and my instinct tells me that it should be easier to do when your starting point is "really fast". But this is not a small weekend project for me, and I have already talked to several companies about sponsoring this. Plugins -: A Theme Component could also be called a plugin. But there are several potential plugin hooks into Hugo's build pipeline: Resource transformations, content rendering etc. We will eventually get there, but we should do it without giving up too much of the Hugo speed and simplicity. +: A Theme Component could also be called a plugin. But there are several potential plugin hooks into Hugo's build pipeline: resource transformations, content rendering, etc. We will eventually get there, but we should do it without giving up too much of the Hugo speed and simplicity. ## Thanks -So, thanks to everyone who have contributed to getting Hugo where it is today. It is hard to single out individuals, but a big shout-out to all the Hugo experts and moderators helping out making the [discourse.gohugo.io](https://discourse.gohugo.io/) a very active and possibly one of the best support forums out there. +So, thanks to everyone who has contributed to getting Hugo where it is today. It is hard to single out individuals, but a big shout-out to all the Hugo experts and moderators helping out making [discourse.gohugo.io](https://discourse.gohugo.io/) a very active and possibly one of the best support forums out there. -And the last shout-out goes to two maintainers who have been there more or less from the start. [@digitalcraftsman](https://github.com/digitalcraftsman/) has been doing a fantastic job keeping the fast growing theme site and [repository](https://github.com/gohugoio/hugoThemes) in pristine condition. I have it on my watch list, but that is just out of curiosity. There are lots of activity, but it runs as clock work. [Anthony Fok](https://github.com/anthonyfok) has contributed with a variety of things but is most notable as the Linux expert on the team. He manages the Debian build and is the one to thank for up-to-date binaries on Debian and Ubuntu. +And the last shout-out goes to two maintainers who have been there more or less from the start. [@digitalcraftsman](https://github.com/digitalcraftsman/) has been doing a fantastic job keeping the fast growing theme site and [repository](https://github.com/gohugoio/hugoThemes) in pristine condition. I have it on my watch list, but that is just out of curiosity. There is lots of activity, but it runs as clock work. [Anthony Fok](https://github.com/anthonyfok) has contributed with a variety of things but is most notable as the Linux expert on the team. He manages the Debian build and is the one to thank for up-to-date binaries on Debian and Ubuntu. One final note: If you have not done so already, please visit [github.com/gohugoio/hugo](https://github.com/gohugoio/hugo) and push the "star button". Gopher artwork by [Ashley McNamara](https://github.com/ashleymcnamara/gophers/) (licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)). Inspired by [Renee French](https://reneefrench.blogspot.com/). -[^2]: Numbers from Google Analytics. The Hugo websites are https://discourse.gohugo.io/, https://gohugo.io/ and https://themes.gohugo.io/. It is rumoured that when [Matt Biilman](https://twitter.com/biilmann?lang=en), CEO and Co-founder of Netlify, opened the first power bill after sponsoring Hugo's hosting, said: "Du mÃ¥ lave fis med mig, those Hugo sites have lots of web traffic!" +[^2]: Numbers from Google Analytics. The Hugo websites are https://discourse.gohugo.io, https://gohugo.io and https://themes.gohugo.io. It is rumoured that when [Matt Biilman](https://twitter.com/biilmann?lang=en), CEO and Co-founder of Netlify, opened the first power bill after sponsoring Hugo's hosting, said: "Du mÃ¥ lave fis med mig, those Hugo sites have lots of web traffic!" [^sgen]: That was at the time of writing this article. _Next_, a React based static site generator, has momentum and is closing in on Hugo's 2nd place. -[^themes]: We pull all the themes from GitHub and build the theme site and 235 demo sites on Netlify in 4 minutes. And that is impressing. +[^themes]: We pull all the themes from GitHub and build the theme site and 235 demo sites on Netlify in 4 minutes. That is impressive. diff --git a/content/en/readfiles/menuvars.md b/content/en/readfiles/menuvars.md deleted file mode 100644 index 339fc108..00000000 --- a/content/en/readfiles/menuvars.md +++ /dev/null @@ -1,39 +0,0 @@ -`.URL` -: string - -`.Name` -: string - -`.Menu` -: string - -`.Identifier` -: string - -`.Pre` -: template.HTML - -`.Post` -: template.HTML - -`.Weight` -: int - -`.Parent` -: string - -`.Children` -: Menu - -Note that menus also have the following functions available as well: - -[`.HasChildren`](/functions/haschildren/) -: boolean - -Additionally, there are some relevant functions available to menus on a page: - -[`.IsMenuCurrent`](/functions/ismenucurrent/) -: (menu string, menuEntry *MenuEntry ) boolean - -[`.HasMenuCurrent`](/functions/hasmenucurrent/) -: (menu string, menuEntry *MenuEntry) boolean \ No newline at end of file diff --git a/content/en/templates/404.md b/content/en/templates/404.md index eaa479d2..64ebe169 100644 --- a/content/en/templates/404.md +++ b/content/en/templates/404.md @@ -21,7 +21,7 @@ When using Hugo with [GitHub Pages](http://pages.github.com/), you can provide y 404 pages will have all the regular [page variables][pagevars] available to use in the templates. -In addition to the standard page variables, the 404 page has access to all site content accessible from `.Data.Pages`. +In addition to the standard page variables, the 404 page has access to all site content accessible from `.Pages`. ``` ▾ layouts/ diff --git a/content/en/templates/base.md b/content/en/templates/base.md index 94d4cb2e..4948f6f3 100644 --- a/content/en/templates/base.md +++ b/content/en/templates/base.md @@ -90,7 +90,7 @@ From the above base template, you can define a [default list template][hugolists {{< code file="layouts/_default/list.html" download="list.html" >}} {{ define "main" }}

Posts

- {{ range .Data.Pages }} + {{ range .Pages }}

{{ .Title }}

{{ .Content }} diff --git a/content/en/templates/homepage.md b/content/en/templates/homepage.md index 83366486..48130c39 100644 --- a/content/en/templates/homepage.md +++ b/content/en/templates/homepage.md @@ -36,9 +36,9 @@ The homepage, similar to other [list pages in Hugo][lists], accepts content and See the homepage template below or [Content Organization][contentorg] for more information on the role of `_index.md` in adding content and front matter to list pages. -## `.Data.Pages` on the Homepage +## `.Pages` on the Homepage -In addition to the standard [page variables][pagevars], the homepage template has access to *all* site content via `.Data.Pages`. +In addition to the standard [page variables][pagevars], the homepage template has access to *all* site content via `.Pages`. ## Example Homepage Template @@ -58,8 +58,8 @@ The following is an example of a homepage template that uses [partial][partials] {{.Content}}
- - {{ range first 10 .Data.Pages }} + + {{ range first 10 .Pages }} {{ .Render "summary"}} {{ end }}
diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index f13378ef..7f3a862e 100644 --- a/content/en/templates/introduction.md +++ b/content/en/templates/introduction.md @@ -504,7 +504,7 @@ Go allows you to do more than what's shown here. Using Hugo's [`where` function] {{< code file="layouts/partials/upcoming-events.html" download="upcoming-events.html" >}}

Upcoming Events

    -{{ range where .Data.Pages.ByDate "Section" "events" }} +{{ range where .Pages.ByDate "Section" "events" }} {{ if ge .Date.Unix .Now.Unix }}
  • diff --git a/content/en/templates/lists.md b/content/en/templates/lists.md index 431407e4..2871b181 100644 --- a/content/en/templates/lists.md +++ b/content/en/templates/lists.md @@ -101,7 +101,7 @@ You can now access this `_index.md`'s' content in your list template: