Squashed 'docs/' changes from 1de7a358c..ef9c4913c

ef9c4913c Clean up and removal of outdated examples
46122c9aa add godot tutorials to showcase
06d1d1ea2 Update scss-sass.md
1fc63c100 Spelling fix in 0.79.1 release notes
ad2f50e3d Update plainwords description (#1296)
33021d451 Update substr examples (#1304)
6b1cc59bb Release 0.80.0
521db8c6d Merge branch 'tempv0.80.0'
58626c2b3 releaser: Add release notes to /docs for release of 0.80.0
f81d118af dartsass: Dart Sass only supports `expanded` and `compressed`
7da6f54be Add Dart Sass support
b1f2661bb Replace jsconfig.js with jsconfig.json
38de0c1a4 Update index.md
223ceae80 Update index.md
f7ac0e59d Release v0.79.1
2d4583d43 Merge branch 'temp791-2'
1d34e609b releaser: Add release notes to /docs for release of 0.79.1
e26769988 Merge branch 'temp791'
75694d904 Fix Resource.ResourceType so it always returns MIME's main type
0f65d7783 Typo s/adds/add (#1298)
0b896b2c0 images: Add images.Overlay filter
0d4257dcd Clarify documentation on shimming
fcf601ddf Update index.html
6bf9bc1c1 Update index.html
1ce76bf3a Update index.html
e7d976eec Update index.html
db2996e64 Update index.html
245e5bfc9 news: Add post about Apple M1
3ad4115ed tpl: Add title parameter to YouTube shortcode
76ed976f8 Added two useful extensions to the list (#1243)
e5a30dd11 Update related.md
25cf8f48b Improve substr examples
e16e57e9a Update path.Split.md
2749b88fd Update path.Split.md
d76cad3ff Release 0.79.0
f5ccfbe98 releaser: Add release notes to /docs for release of 0.79.0
ebf1b87b0 Merge commit '9f1265fde4b9ef186148337c99f08601633b6056'
1f1e8f39c Allow setting the delimiter used for setting config via OS env, e.g. HUGO_
e9b1414dd deps: Update to github.com/evanw/esbuild 0.8.11 to 0.8.14
0f76cf66c docs: Regen docshelper
1ada5d47e Add menu params
1c120aef0 Revert "docs: Regenerate docshelper"
7b60b5624 docs: Regenerate docshelper

git-subtree-dir: docs
git-subtree-split: ef9c4913cdcf95d62ec12d872f412f97e55a55ad
This commit is contained in:
Bjørn Erik Pedersen 2021-01-20 12:47:49 +01:00
parent 9f1265fde4
commit e48ffb7635
34 changed files with 9487 additions and 81 deletions

View file

@ -113,6 +113,24 @@ This means that `.Title` will be used unless `.LinkTitle` is present, etc. In pr
In this example, the top level of the menu is defined in your [site `config` file][config]. All content entries are attached to one of these entries via the `.Parent` field.
## Params
You can also add user-defined content to menu items via the `params` field.
A common use case is to define a custom param to add a css class to a specific menu item.
{{< code-toggle file="config" >}}
[[menu.main]]
name = "about hugo"
pre = "<i class='fa fa-heart'></i>"
weight = -110
identifier = "about"
url = "/about/"
[menu.main.params]
class = "highlight-menu-item"
{{</ code-toggle >}}
## Render Menus
See [Menu Templates](/templates/menu-templates/) for information on how to render your site menus within your templates.

View file

@ -21,7 +21,9 @@ the lowest page they are bundled with, and simple which names does not contain `
## Properties
ResourceType
: The main type of the resource. For example, a file of MIME type `image/jpeg` has the ResourceType `image`.
: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`.
{{< new-in "0.80.0" >}} Note that we in Hugo `v0.80.0` fixed a bug where non-image resources (e.g. video) would return the MIME sub type, e.g. `json`.
Name
: Default value is the filename (relative to the owning page). Can be set in front matter.

View file

@ -84,6 +84,8 @@ related:
weight: 10
{{< /code-toggle >}}
Note that if you have configured `tags` as a taxonomy, `tags` will also be added to the default configuration abve with the weight of `80`.
Custom configuration should be set using the same syntax.
{{% note %}}

View file

@ -398,6 +398,13 @@ Furthermore, you can automatically start playback of the embedded video by setti
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
{{< /code >}}
For [accessibility reasons](https://dequeuniversity.com/tips/provide-iframe-titles), it's best to provide a title for your YouTube video. You can do this using the shortcode by providing a `title` parameter. If no title is provided, a default of "YouTube Video" will be used.
{{< code file="example-youtube-input-with-title.md" >}}
{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
{{< /code >}}
#### Example `youtube` Output
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:

View file

@ -17,6 +17,30 @@ toc: true
See [images.Filter](#filter) for how to apply these filters to an image.
### Overlay
{{< new-in "0.80.0" >}}
{{% funcsig %}}
images.Overlay SRC X Y
{{% /funcsig %}}
Overlay creates a filter that overlays the source image at position x y, e.g:
```go-html-template
{{ $logoFilter := (images.Overlay $logo 50 50 ) }}
{{ $img := $img | images.Filter $logoFilter }}
```
A shorter version of the above, if you only need to apply the filter once:
```go-html-template
{{ $img := $img.Filter (images.Overlay $logo 50 50 )}}
```
The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`).
### Brightness
{{% funcsig %}}

View file

@ -25,7 +25,7 @@ If there is no slash in `PATH`, it returns an empty directory and the base is se
**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
```
{{ path.Split "a/news.html" }} → "a/", "news.html"
{{ path.Split "news.html" }} → "", "news.html"
{{ path.Split "a/b/c" }} → "a/b/", "c"
{{ $dirFile := path.Split "a/news.html" }} → $dirDile.Dir → "a/", $dirFile.File → "news.html"
{{ $dirFile := path.Split "news.html" }} → $dirDile.Dir → "", $dirDile.File → "news.html"
{{ $dirFile := path.Split "a/b/c" }} → $dirDile.Dir → "a/b/", $dirDile.File → "c"
```

View file

@ -26,6 +26,21 @@ To extract characters from the end of the string, use a negative start number.
In addition, borrowing from the extended behavior described at https://php.net substr, if `length` is given and is negative, that number of characters will be omitted from the end of string.
```
{{substr "BatMan" 0 -3}} → "Bat"
{{substr "BatMan" 3 3}} → "Man"
{{ substr "abcdef" 0 }} → "abcdef"
{{ substr "abcdef" 1 }} → "bcdef"
{{ substr "abcdef" 0 1 }} → "a"
{{ substr "abcdef" 1 1 }} → "b"
{{ substr "abcdef" 0 -1 }} → "abcde"
{{ substr "abcdef" 1 -1 }} → "bcde"
{{ substr "abcdef" -1 }} → "f"
{{ substr "abcdef" -2 }} → "ef"
{{ substr "abcdef" -1 1 }} → "f"
{{ substr "abcdef" -2 1 }} → "e"
{{ substr "abcdef" -3 -1 }} → "de"
{{ substr "abcdef" -3 -2 }} → "d"
```

View file

@ -326,7 +326,7 @@ writeStats {{< new-in "0.69.0" >}}
: When enabled, a file named `hugo_stats.json` will be written to your project root with some aggregated data about the build, e.g. list of HTML entities published to be used to do [CSS pruning](/hugo-pipes/postprocess/#css-purging-with-postcss). If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory). It's also worth mentioning that, due to the nature of the partial server builds, new HTML entities will be added when you add or change them while the server is running, but the old values will not be removed until you restart the server or run a regular `hugo` build.
noJSConfigInAssets {{< new-in "0.78.0" >}}
: Turn off writing a `jsconfig.js` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
: Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
## Configure Server
@ -438,6 +438,8 @@ Names must be prefixed with `HUGO_` and the configuration key must be set in upp
To set config params, prefix the name with `HUGO_PARAMS_`
{{% /note %}}
{{< new-in "0.79.0" >}} If you are using snake_cased variable names, the above will not work, so since Hugo 0.79.0 Hugo determines the delimiter to use by the first character after `HUGO`. This allows you to define environment variables on the form `HUGOxPARAMSxAPI_KEY=abcdefgh`, using any [allowed](https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names#:~:text=So%20names%20may%20contain%20any,not%20begin%20with%20a%20digit.) delimiter.
{{< todo >}}
Test and document setting params via JSON env var.
{{< /todo >}}

View file

@ -29,7 +29,7 @@ If you are using the Hugo Snap package, Babel and plugin(s) need to be installed
{{< new-in "v0.75.0" >}}
In Hugo `v0.75` we improved the way we resolve JS configuration and dependencies. One of them is that we now adds the main project's `node_modules` to `NODE_PATH` when running Babel and similar tools. There are some known [issues](https://github.com/babel/babel/issues/5618) with Babel in this area, so if you have a `babel.config.js` living in a Hugo Module (and not in the project itself), we recommend using `require` to load the presets/plugins, e.g.:
In Hugo `v0.75` we improved the way we resolve JS configuration and dependencies. One of them is that we now add the main project's `node_modules` to `NODE_PATH` when running Babel and similar tools. There are some known [issues](https://github.com/babel/babel/issues/5618) with Babel in this area, so if you have a `babel.config.js` living in a Hugo Module (and not in the project itself), we recommend using `require` to load the presets/plugins, e.g.:
```js

View file

@ -115,7 +115,7 @@ And then in your JS file:
import * as params from '@params';
```
Hugo will, by default, generate a `assets/jsconfig.js` file that maps the imports. This is useful for navigation/intellisense help inside code editors, but if you don't need/want it, you can [turn it off](/getting-started/configuration/#configure-build).
Hugo will, by default, generate a `assets/jsconfig.json` file that maps the imports. This is useful for navigation/intellisense help inside code editors, but if you don't need/want it, you can [turn it off](/getting-started/configuration/#configure-build).
@ -147,27 +147,27 @@ Or with options:
#### Shimming a JS library
It's a very common practice to load external libraries using CDN rather than importing all packages in a single JS file, making it bulky. To do the same with Hugo, you'll need to shim the libraries as follows. In this example, `algoliasearch` and `instantsearch.js` will be shimmed.
It's a common practice to load external libraries using a content delivery network (CDN) rather than importing all packages in a single JS file. To load scripts from a CDN with Hugo, you'll need to shim the libraries as follows. In this example, `react` and `react-dom` will be shimmed.
Firstly, add the following to your project's `package.json`:
First, add React and ReactDOM [CDN script tags](https://reactjs.org/docs/add-react-to-a-website.html#tip-minify-javascript-for-production) in your HTML template files. Then create `assets/js/shims/react.js` and `assets/js/shims/react-dom.js` with the following contents:
```js
// In assets/js/shims/react.js
module.exports = window.React;
// In assets/js/shims/react-dom.js
module.exports = window.ReactDOM;
```
Finally, add the following to your project's `package.json`:
```json
{
"browser": {
"algoliasearch/lite": "./public/js/shims/algoliasearch.js",
"instantsearch.js/es/lib/main": "./public/js/shims/instantsearch.js"
"react": "./assets/js/shims/react.js",
"react-dom": "./assets/js/shims/react-dom.js"
}
}
```
What this does is it tells Hugo to look for the listed packages somewhere else. Here we're telling Hugo to look for `algoliasearch/lite` and `instantsearch.js/es/lib/main` in the project's `public/js/shims` folder.
This tells Hugo's `js.Build` command to look for `react` and `react-dom` in the project's `assets/js/shims` folder. Note that the `browser` field in your `package.json` file will cause React and ReactDOM to be excluded from your JavaScript bundle. Therefore, **it is unnecessary to add them to the `js.Build` command's `externals` argument.**
Now we'll need to create the shim JS files which export the global JS variables `module.exports = window.something`. You can create a separate shim JS file in your `assets` directory, and redirect the import paths there if you wish, but a much cleaner way is to create these files on the go, by having the following before your JS is built.
```go-html-template
{{ $a := "module.exports = window.algoliasearch" | resources.FromString "js/shims/algoliasearch.js" }}
{{ $i := "module.exports = window.instantsearch" | resources.FromString "js/shims/instantsearch.js" }}
{{/* Call RelPermalink unnecessarily to generate JS files */}}
{{ $placebo := slice $a.RelPermalink $i.RelPermalink }}
```
That's it! You should now have a browser-friendly JS which can use external JS libraries.

View file

@ -24,14 +24,19 @@ Any SASS or SCSS file can be transformed into a CSS file using `resources.ToCSS`
```
### Options
transpiler [string] {{< new-in "0.80.0" >}}
: The `transpiler` to use, valid values are `libsass` (default) and `dartsass`. Note that the Embedded Dart Sass project is still in beta (beta 5 at the time of writing). The release is scheduled for Q1 2021. We will try to improve the installation process by then, but if you want to use Hugo with Dart Sass you need to download a release binary from [Embedded Dart Sass](https://github.com/sass/dart-sass-embedded/releases) (beta 5) and make sure it's in your PC's `$PATH` (or `%PATH%` on Windows).
targetPath [string]
: If not set, the resource's target path will be the asset file original path with its extension replaced by `.css`.
outputStyle [string]
: Default is `nested`. Other available output styles are `expanded`, `compact` and `compressed`.
: Default is `nested` (LibSass) and `expanded` (Dart Sass). Other available output styles for LibSass are `expanded`, `compact` and `compressed`. Dart Sass only supports `expanded` and `compressed`.
precision [int]
: Precision of floating point math.
: Precision of floating point math. **Note:** This option is not supported by Dart Sass.
enableSourceMap [bool]
: When enabled, a source map will be generated.

View file

@ -12,7 +12,7 @@ Some notes on the improvements in this release:
* Now `js.Build` fully supports the virtual union filesystem in [Hugo Modules](https://gohugo.io/hugo-modules/). Any import inside your JavaScript components will resolve starting from the top component mount inside `/assets` with a fallback to the traditional "JS way" (`node_modules` etc.)
* You can now pass configuration data from the templates to your scripts via a new `params` option.
* Hugo now writes a `jsconfig.js` file inside `/assets` (you can turn it off) with import mappings to help editors such as VS Code with intellisense/navigation, which is especially useful when there is no common root and the source lives inside some temporary directory.
* Hugo now writes a `jsconfig.json` file inside `/assets` (you can turn it off) with import mappings to help editors such as VS Code with intellisense/navigation, which is especially useful when there is no common root and the source lives inside some temporary directory.
* We have also improved the build errors you get from `js.Build`. In server mode you will get a preview of the failing lines and in the console you will get a link to the location.
Read more about this in [the documentation](https://gohugo.io/hugo-pipes/js/), but a short usage example would look like:

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View file

@ -0,0 +1,71 @@
---
date: 2020-11-27
title: "Hugo 0.79.0: Black Friday Edition"
description: "Hugo 0.79.0 brings .Params to menus, snake_case support for OS environment config, and a refresh of upstream dependencies (Chroma, ESBuild etc.)."
categories: ["Releases"]
---
Hugo `0.79.0` is a small, but useful release. You can now set custom `.Params` in your [menu](https://gohugo.io/content-management/menus/) configuration, and you can now also override deeply nested snake_cased configuration variables with [OS environment variables](https://gohugo.io/getting-started/configuration/#configure-with-environment-variables). Other than that we have refreshed all the core upstream dependencies. A special thanks to [@alecthomas](https://github.com/alecthomas) (some new [Chroma lexers](https://github.com/alecthomas/chroma/releases/tag/v0.8.2) and fixes) and [@evanw](https://github.com/evanw) ([ESBuild](https://github.com/evanw/esbuild)).
This release represents **33 contributions by 8 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 [@AdamKorcz](https://github.com/AdamKorcz), and [@davidejones](https://github.com/davidejones) 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 [@davidsneighbour](https://github.com/davidsneighbour), [@coliff](https://github.com/coliff) and [@kaushalmodi](https://github.com/kaushalmodi) for all the 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 **13 contributions by 11 contributors**. A special thanks to [@Valac01](https://github.com/Valac01), [@bep](https://github.com/bep), [@mhansen](https://github.com/mhansen), and [@chanjarster](https://github.com/chanjarster) for their work on the documentation site.
Hugo now has:
* 48392+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 437+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 361+ [themes](http://themes.gohugo.io/)
## Enhancements
### Templates
* Add more layout lookup tests [34061706](https://github.com/gohugoio/hugo/commit/34061706e6a9631d92ae3d01e0458eee7bc251cc) [@moorereason](https://github.com/moorereason) [#7964](https://github.com/gohugoio/hugo/issues/7964)
### Other
* bump gopkg.in/yaml.v2 from 2.3.0 to 2.4.0 [17e0bbe8](https://github.com/gohugoio/hugo/commit/17e0bbe821b508cea936bcfd5c1c181bdb8ad70d) [@dependabot[bot]](https://github.com/apps/dependabot)
* Allow setting the delimiter used for setting config via OS env, e.g. HUGO_ [7e223b3b](https://github.com/gohugoio/hugo/commit/7e223b3baaef68d6e6f99e28f162362c81deffba) [@bep](https://github.com/bep) [#7829](https://github.com/gohugoio/hugo/issues/7829)
* Update to github.com/evanw/esbuild 0.8.11 to 0.8.14 [8a6e7060](https://github.com/gohugoio/hugo/commit/8a6e70605350255920100c5c085bb9ea6576d972) [@bep](https://github.com/bep) [#7986](https://github.com/gohugoio/hugo/issues/7986)
* bump github.com/google/go-cmp from 0.5.2 to 0.5.3 [6f7633df](https://github.com/gohugoio/hugo/commit/6f7633df7d2c06e32eac628f9c7809dfee75eeed) [@dependabot[bot]](https://github.com/apps/dependabot)
* Remove unneeded meta tag from blog example [a546059a](https://github.com/gohugoio/hugo/commit/a546059a9c0b4541f6c9e292f2bb065c1b6115d9) [@coliff](https://github.com/coliff)
* bump github.com/getkin/kin-openapi from 0.30.0 to 0.31.0 [b5d906e3](https://github.com/gohugoio/hugo/commit/b5d906e31e716328e2c0fbbdbfe6fc5b2ff98886) [@dependabot[bot]](https://github.com/apps/dependabot)
* Regen docshelper [fd70bdaf](https://github.com/gohugoio/hugo/commit/fd70bdafe7dc5d18c9a2f22c49acc3a8de376e8e) [@bep](https://github.com/bep)
* Add menu params [8f5c9a74](https://github.com/gohugoio/hugo/commit/8f5c9a747fcebb02bb99f5de272046411eb15370) [@davidejones](https://github.com/davidejones) [#7951](https://github.com/gohugoio/hugo/issues/7951)
* Preserve url set in frontmatter without sanitizing [e4fcb672](https://github.com/gohugoio/hugo/commit/e4fcb672ed8bae21fd9780292b54fea3040dd877) [@satotake](https://github.com/satotake) [#6007](https://github.com/gohugoio/hugo/issues/6007)
* Add file deleted by accident [18c13adc](https://github.com/gohugoio/hugo/commit/18c13adcd46bdff963311fdba9eaa9b5a299106e) [@bep](https://github.com/bep) [#7972](https://github.com/gohugoio/hugo/issues/7972)
* Regenerate docshelper" [20a35374](https://github.com/gohugoio/hugo/commit/20a35374a3c90adb32a90a5f671afb15165210be) [@bep](https://github.com/bep) [#7972](https://github.com/gohugoio/hugo/issues/7972)
* Regenerate docshelper [caf16c20](https://github.com/gohugoio/hugo/commit/caf16c20853947138883f6460682e19733895f52) [@bep](https://github.com/bep)
* Update to Chroma v0.8.2 [b298c06e](https://github.com/gohugoio/hugo/commit/b298c06e0551e3eba10b39ae5668b7a6a36a08a7) [@bep](https://github.com/bep) [#7970](https://github.com/gohugoio/hugo/issues/7970)
* bump github.com/evanw/esbuild from 0.8.8 to 0.8.11 [55e290af](https://github.com/gohugoio/hugo/commit/55e290af41ad1c92af13679d4a84d64985d41456) [@dependabot[bot]](https://github.com/apps/dependabot)
* bump github.com/getkin/kin-openapi from 0.26.0 to 0.30.0 [506a190a](https://github.com/gohugoio/hugo/commit/506a190a82cc5564012a1228b4179637b64e58eb) [@dependabot[bot]](https://github.com/apps/dependabot)
* bump github.com/evanw/esbuild from 0.8.6 to 0.8.8 [fc81de64](https://github.com/gohugoio/hugo/commit/fc81de643934e84bb1e1392f6200559ee0ada9b6) [@dependabot[bot]](https://github.com/apps/dependabot)
* Let ESBuild handle all imports from node_modules [78f227b6](https://github.com/gohugoio/hugo/commit/78f227b664d86c30fbb25f7a953b7ef8f2dacf13) [@bep](https://github.com/bep) [#7948](https://github.com/gohugoio/hugo/issues/7948)
* bump github.com/evanw/esbuild from 0.8.5 to 0.8.6 [5e03f644](https://github.com/gohugoio/hugo/commit/5e03f644a4507f51bdbcdb42b65ce4e99095374f) [@dependabot[bot]](https://github.com/apps/dependabot)
* bump github.com/evanw/esbuild from 0.8.4 to 0.8.5 [a92ef20f](https://github.com/gohugoio/hugo/commit/a92ef20ff6e43ba05844539b60782e8190712cdc) [@dependabot[bot]](https://github.com/apps/dependabot)
* bump github.com/getkin/kin-openapi from 0.22.1 to 0.26.0 [0d54a844](https://github.com/gohugoio/hugo/commit/0d54a844061e808dd5b4ff4874b2e4bd9df4d556) [@dependabot[bot]](https://github.com/apps/dependabot)
* Update GH docs to say "main" as default branch [943f3c93](https://github.com/gohugoio/hugo/commit/943f3c932f5f67ab52bf8e0636e57751dc9b1891) [@maco](https://github.com/maco)
* Updated year in header [4f20bf29](https://github.com/gohugoio/hugo/commit/4f20bf29eb246a2e65508175fdd5f25b44e98370) [@AdamKorcz](https://github.com/AdamKorcz)
* Added first fuzzer [4c613d5d](https://github.com/gohugoio/hugo/commit/4c613d5d5d60b80a262e968ae8a4525eba8619a2) [@AdamKorcz](https://github.com/AdamKorcz)
* bump github.com/frankban/quicktest from 1.11.1 to 1.11.2 [82a182e5](https://github.com/gohugoio/hugo/commit/82a182e52c4165b4f51d0cc8ef0f21df5d628c69) [@dependabot[bot]](https://github.com/apps/dependabot)
* bump golang.org/x/text from 0.3.3 to 0.3.4 [dfc662b2](https://github.com/gohugoio/hugo/commit/dfc662b2086430dde96c18ccb6b92bba4f1be428) [@dependabot[bot]](https://github.com/apps/dependabot)
* bump github.com/evanw/esbuild from 0.8.3 to 0.8.4 [2f0917cc](https://github.com/gohugoio/hugo/commit/2f0917cc014557e201a9348664736d608a7fa131) [@dependabot[bot]](https://github.com/apps/dependabot)
* Disable NPM test on Travis on Windows [3437174c](https://github.com/gohugoio/hugo/commit/3437174c3a7b96925b82b351ac87530b4fa796a5) [@bep](https://github.com/bep)
* Install nodejs on Windows [f66302ca](https://github.com/gohugoio/hugo/commit/f66302ca0579171ffd1730eb8f33dd05af3d9a00) [@bep](https://github.com/bep)
* Remove external source map option [944150ba](https://github.com/gohugoio/hugo/commit/944150bafbbb5c3e807ba3688174e70764dbdc64) [@bep](https://github.com/bep) [#7932](https://github.com/gohugoio/hugo/issues/7932)
## Fixes
### Other
* Fix memory usage in writeStats [d162bbd7](https://github.com/gohugoio/hugo/commit/d162bbd7990b6a523bdadcd10bf60fcb43ecf270) [@bep](https://github.com/bep) [#7945](https://github.com/gohugoio/hugo/issues/7945)
* Fix server rebuild issue with partials referenced from render hooks [e442cf30](https://github.com/gohugoio/hugo/commit/e442cf30a215e33b49ce588a9098147282bd883f) [@bep](https://github.com/bep) [#7990](https://github.com/gohugoio/hugo/issues/7990)
* Misc fixes [bf2837a3](https://github.com/gohugoio/hugo/commit/bf2837a314eaf70135791984a423b0b09f58741d) [@bep](https://github.com/bep) [#7924](https://github.com/gohugoio/hugo/issues/7924)[#7923](https://github.com/gohugoio/hugo/issues/7923)

View file

@ -0,0 +1,22 @@
---
date: 2020-12-19
title: "Hugo 0.79.1: One Security Patch for Hugo on Windows"
description: "Disallow running of e.g. Pandoc in the current directory."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
---
Hugo depends on Go's `os/exec` for certain features, e.g. for rendering of Pandoc documents if these binaries are found in the system `%PATH%` on Windows. However, if a malicious file with the same name (`exe` or `bat`) was found in the current working directory at the time of running `hugo`, the malicious command would be invoked instead of the system one.
Windows users who ran `hugo` inside untrusted Hugo sites were affected.
The origin of this issue comes from Go, see https://github.com/golang/go/issues/38736
We have fixed this in Hugo by [using](https://github.com/gohugoio/hugo/commit/4a8267d64a40564aced0695bca05249da17b0eab) a patched version of `exec.LookPath` from https://github.com/cli/safeexec (thanks to [@mislav](https://github.com/mislav) for the implementation).
Thanks to [@Ry0taK](https://github.com/Ry0taK) for the bug report.

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View file

@ -0,0 +1,79 @@
---
date: 2020-12-31
title: "Hugo 0.80: Last Release of 2020!"
description: "This release brings Dart Sass support, a new image overlay function, and more."
categories: ["Releases"]
---
The last Hugo release of the year brings a new [images.Overlay](https://gohugo.io/functions/images/#overlay) filter to overlay an image on top of another, e.g. for watermarking, and [Dart Sass](https://gohugo.io/hugo-pipes/scss-sass/#options) support.
This release represents **29 contributions by 12 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 [@moorereason](https://github.com/moorereason), and [@davidsneighbour](https://github.com/davidsneighbour) 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 [@davidsneighbour](https://github.com/davidsneighbour), [@coliff](https://github.com/coliff) and [@kaushalmodi](https://github.com/kaushalmodi) for all the 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 **22 contributions by 6 contributors**. A special thanks to [@bep](https://github.com/bep), [@D4D3VD4V3](https://github.com/D4D3VD4V3), [@chrischute](https://github.com/chrischute), and [@azenk](https://github.com/azenk) for their work on the documentation site.
Hugo now has:
* 49096+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 436+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 369+ [themes](http://themes.gohugo.io/)
## Notes
* Resource.ResourceType now always returns MIME's main type [81975f84](https://github.com/gohugoio/hugo/commit/81975f847dc19c21c2321207645807771db97fab) [@bep](https://github.com/bep) [#8052](https://github.com/gohugoio/hugo/issues/8052)
## Enhancements
### Templates
* Regenerate templates [a2d146ec](https://github.com/gohugoio/hugo/commit/a2d146ec32a26ccca9ffa68d3c840ec5b08cca96) [@bep](https://github.com/bep)
* tpl/internal/go_templates: Revert formatting [718e09ed](https://github.com/gohugoio/hugo/commit/718e09ed4bc538f4fccc4337f99e9eb86aea31f3) [@bep](https://github.com/bep)
* Add title parameter to YouTube shortcode [4fc918e0](https://github.com/gohugoio/hugo/commit/4fc918e02cfc7f260d6312248ff9d33e95b27943) [@azenk](https://github.com/azenk)
### Output
* Add missing OutputStyle option [428b0b32](https://github.com/gohugoio/hugo/commit/428b0b32947ec16f8585b8c33548d72fd4fb025d) [@bep](https://github.com/bep)
### Other
* Allow Dart Sass transformations to be cached on disk [ffbf5e45](https://github.com/gohugoio/hugo/commit/ffbf5e45fa0617a37950b34deab63736b1c6b1d3) [@bep](https://github.com/bep)
* Dart Sass only supports `expanded` and `compressed` [48994ea7](https://github.com/gohugoio/hugo/commit/48994ea766f08332f57c0f8e74843b6c8617c3d1) [@bep](https://github.com/bep)
* Update emoji import paths and version [1f7e9f73](https://github.com/gohugoio/hugo/commit/1f7e9f733397b891cefc725ffc94ba901e70425a) [@moorereason](https://github.com/moorereason)
* Add Dart Sass support [cea15740](https://github.com/gohugoio/hugo/commit/cea157402365f34a69882110a4208999728007a6) [@bep](https://github.com/bep) [#7380](https://github.com/gohugoio/hugo/issues/7380)[#8102](https://github.com/gohugoio/hugo/issues/8102)
* GroupByParamDate now supports datetimes [f9f77978](https://github.com/gohugoio/hugo/commit/f9f779786edcefc4449a14cfc04dd93379f71373) [@zerok](https://github.com/zerok)
* Skip para test when not on CI [a9718f44](https://github.com/gohugoio/hugo/commit/a9718f44cd6c938448fc697f0ec720ebed7d863a) [@bep](https://github.com/bep) [#6963](https://github.com/gohugoio/hugo/issues/6963)
* Update SECURITY.md [f802bb23](https://github.com/gohugoio/hugo/commit/f802bb236a60dcc6c64d53edac634891272e0c07) [@bep](https://github.com/bep)
* Improve LookPath [10ae7c32](https://github.com/gohugoio/hugo/commit/10ae7c3210cd1add14d3750aa9512a87df0e1146) [@bep](https://github.com/bep)
* create a SECURITY.md [ae2d1bd5](https://github.com/gohugoio/hugo/commit/ae2d1bd52df0099190ef9195666d0788708b0385) [@davidsneighbour](https://github.com/davidsneighbour) [#8074](https://github.com/gohugoio/hugo/issues/8074)
* Show more detail on failed time test [8103188b](https://github.com/gohugoio/hugo/commit/8103188b9b9e8eeb3bcb53c8b64e2b83397e82ae) [@moorereason](https://github.com/moorereason) [#6963](https://github.com/gohugoio/hugo/issues/6963)
* Add images.Overlay filter [3ba147e7](https://github.com/gohugoio/hugo/commit/3ba147e702a5ae0af6e8b3b0296d256c3246a546) [@bep](https://github.com/bep) [#8057](https://github.com/gohugoio/hugo/issues/8057)[#4595](https://github.com/gohugoio/hugo/issues/4595)[#6731](https://github.com/gohugoio/hugo/issues/6731)
* Bump github.com/spf13/cobra from 0.15.0 to 0.20.0 [c84ad8db](https://github.com/gohugoio/hugo/commit/c84ad8db821c10225c0e603c6ec920c67b6ce36f) [@anthonyfok](https://github.com/anthonyfok)
* configure proper link to discourse.gohugo.io (#8020) [4e0acb89](https://github.com/gohugoio/hugo/commit/4e0acb89b793d8895dc53eb8887be27430c3ab31) [@davidsneighbour](https://github.com/davidsneighbour)
* Format code with gofumpt [d90e37e0](https://github.com/gohugoio/hugo/commit/d90e37e0c6e812f9913bf256c9c81aa05b7a08aa) [@bep](https://github.com/bep)
* bump github.com/evanw/esbuild from 0.8.15 to 0.8.17 [32471b57](https://github.com/gohugoio/hugo/commit/32471b57bde51c55a15dbf1db75d6e5f7232c347) [@dependabot[bot]](https://github.com/apps/dependabot)
* Use --baseURL path for live-reload URL [0ad378b0](https://github.com/gohugoio/hugo/commit/0ad378b09cea90a2a70d7ff06af668abe22475a1) [@sth](https://github.com/sth) [#6595](https://github.com/gohugoio/hugo/issues/6595)
* bump github.com/getkin/kin-openapi from 0.31.0 to 0.32.0 [907d9e92](https://github.com/gohugoio/hugo/commit/907d9e92682ed56a57a2206ae9bd9a985b3e1870) [@dependabot[bot]](https://github.com/apps/dependabot)
## Fixes
### Templates
* Fix series detection in opengraph [d2d493ab](https://github.com/gohugoio/hugo/commit/d2d493ab5d6a054001a8448ea0de2949dac4b30e) [@Humberd](https://github.com/Humberd)
* Fix substr when length parameter is zero [5862fd2a](https://github.com/gohugoio/hugo/commit/5862fd2a60b5d16f2437bd8c8b7bac700de5f047) [@moorereason](https://github.com/moorereason) [#7993](https://github.com/gohugoio/hugo/issues/7993)
* Refactor and fix substr logic [64789fb5](https://github.com/gohugoio/hugo/commit/64789fb5dcf8326f14f13d69a2576ae3aa2bbbaa) [@moorereason](https://github.com/moorereason) [#7993](https://github.com/gohugoio/hugo/issues/7993)
### Other
* Fix Resource.ResourceType so it always returns MIME's main type [81975f84](https://github.com/gohugoio/hugo/commit/81975f847dc19c21c2321207645807771db97fab) [@bep](https://github.com/bep) [#8052](https://github.com/gohugoio/hugo/issues/8052)
* hugolib/paths: Fix typo [ce96895d](https://github.com/gohugoio/hugo/commit/ce96895debb67df20ae24fb5f0f04b98a30cc6cc) [@mayocream](https://github.com/mayocream)
* Fix minor typos [04b89857](https://github.com/gohugoio/hugo/commit/04b89857e104ac7dcbf9fc65d8d4f1a1178123e6) [@phil-davis](https://github.com/phil-davis)
* Fix BenchmarkMergeByLanguage [21fa1e86](https://github.com/gohugoio/hugo/commit/21fa1e86f2aa929fb0983a0cc3dc4e271ea1cc54) [@bep](https://github.com/bep) [#7914](https://github.com/gohugoio/hugo/issues/7914)
* Fix RelURL and AbsURL when path starts with language [aebfe156](https://github.com/gohugoio/hugo/commit/aebfe156fb2f27057e61b2e50c7576e6b06dab58) [@ivan-meridianbanc-com](https://github.com/ivan-meridianbanc-com)

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
[Godot Tutorials](https://godottutorials.com) aims to teach beginners how to get up and running with basic game programming and game development skills.
The website is built with the **Hugo Framework** alongside aws+cloudfront+lambda.
The site is built by:
* [Godot Tutorials](https://godottutorials.com)

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View file

@ -0,0 +1,25 @@
---
title: Godot Tutorials
date: 2021-01-07
description: "Teaching game development skills with love."
# The URL to the site on the internet.
siteURL: https://godottutorials.com
# Add credit to the article author. Leave blank or remove if not needed/wanted.
byline: "[Godot Tutorials](https://godottutorials.com), Web Developer & Game Programmer"
---
[Godot Tutorials](https://godottutorials.com) started as a way to teach beginners game programming and game development.
As I created videos, I ran into a problem; if I made a mistake with a Youtube video, it was difficult to correct errors.
I discovered that blogging episodes and having articles that teach on top of my videos is a fantastic solution to my problem.
As I researched blogging platforms, I came across two solutions; however, I chose [Hugo](https://gohugo.io) because it's built with markdown in mind and simplified my workflow.
In a sense, with [Hugo](https://gohugo.io) programmed the right way, I can focus **more time on planning, creating, and editing**
my videos and **less time maintaining and fixing** my website.

View file

@ -160,3 +160,23 @@ Here's an example:
{{ end }}
</nav>
```
## Using .Params in Menus
User-defined content on menu items are accessible via `.Params`.
Here's an example:
```
<nav class="sidebar-nav">
{{ range .Site.Menus.main }}
<a href="{{ .URL }}" title="{{ .Title }}" class="{{ with .Params.class }}{{ . }}{{ end }}">
{{- .Name -}}
</a>
{{ end }}
</nav>
```
{{% note %}}
With Menu-level .Params they can easily exist on one menu item but not another. It's recommended to access them gracefully using the [with function](/functions/with).
{{% /note %}}

View file

@ -124,8 +124,6 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
### Order Alphabetically Example
In Hugo 0.55 and later you can do:
```go-html-template
<ul>
{{ range .Data.Terms.Alphabetical }}
@ -134,22 +132,6 @@ In Hugo 0.55 and later you can do:
</ul>
```
Before that you would have to do something like:
```go-html-template
<ul>
{{ $type := .Type }}
{{ range $key, $value := .Data.Terms.Alphabetical }}
{{ $name := .Name }}
{{ $count := .Count }}
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a> {{ $count }}</li>
{{ end }}
{{ end }}
</ul>
```
<!-- [See Also Taxonomy Lists](/templates/list/) -->
## Order Content within Taxonomies
@ -220,8 +202,6 @@ Because we are leveraging the front matter system to define taxonomies for conte
### Example: List Tags in a Single Page Template
{{< new-in "0.65.0" >}}
```go-html-template
<ul>
{{ range (.GetTerms "tags") }}
@ -230,20 +210,6 @@ Because we are leveraging the front matter system to define taxonomies for conte
</ul>
```
Before Hugo 0.65.0 you needed to do something like this:
```go-html-template
{{ $taxo := "tags" }} <!-- Use the plural form here -->
<ul id="{{ $taxo }}">
{{ range .Param $taxo }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>
```
If you want to list taxonomies inline, you will have to take care of optional plural endings in the title (if multiple taxonomies), as well as commas. Let's say we have a taxonomy "directors" such as `directors: [ "Joel Coen", "Ethan Coen" ]` in the TOML-format front matter.
To list such taxonomies, use the following:
@ -310,8 +276,6 @@ The following example displays all terms in a site's tags taxonomy:
### Example: List All Site Tags {#example-list-all-site-tags}
In Hugo 0.55 and later you can simply do:
```go-html-template
<ul>
{{ range .Site.Taxonomies.tags }}
@ -320,20 +284,6 @@ In Hugo 0.55 and later you can simply do:
</ul>
```
Before that you would do something like this:
{{< todo >}}Clean up rest of the taxonomy examples re Hugo 0.55.{{< /todo >}}
```go-html-template
<ul id="all-tags">
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>
```
### Example: List All Taxonomies, Terms, and Assigned Content
This example will list all taxonomies and their terms, as well as all the content assigned to each of the terms.

View file

@ -29,6 +29,8 @@ The Hugo community uses a wide range of preferred tools and has developed plug-i
* [Hugofy](https://marketplace.visualstudio.com/items?itemName=akmittal.hugofy). Hugofy is a plugin for Visual Studio Code to "make life easier" when developing with Hugo. The source code can be found [here](https://github.com/akmittal/hugofy-vscode).
* [Hugo Helper](https://marketplace.visualstudio.com/items?itemName=rusnasonov.vscode-hugo). Hugo Helper is a plugin for Visual Studio Code that has some useful commands for Hugo. The source code can be found [here](https://github.com/rusnasonov/vscode-hugo).
* [Hugo Language and Syntax Support](https://marketplace.visualstudio.com/items?itemName=budparr.language-hugo-vscode). Hugo Language and Syntax Support is a Visual Studio Code plugin for Hugo syntax highlighting and snippets. The source code can be found [here](https://github.com/budparr/language-hugo-vscode).
* [Hugo Themer](https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hugo-themer). Hugo Themer is an extension to help you while developing themes. It allows you to easily navigate through your theme files.
* [Front Matter](https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter). Once you go for a static site, you need to think about how you are going to manage your articles. Front matter is a tool that helps you maintaining the metadata/front matter of your articles like: creation date, modified date, slug, tile, SEO check, and many more...
## Emacs

View file

@ -118,7 +118,7 @@ See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo].
: the Page content stripped of HTML tags and presented as a string.
.PlainWords
: the Page content stripped of HTML as a `[]string` using Go's [`strings.Fields`](https://golang.org/pkg/strings/#Fields) to split `.Plain` into a slice.
: the slice of strings that results from splitting .Plain into words, as defined in Go's [strings.Fields](https://golang.org/pkg/strings/#Fields).
.Prev
: Points down to the previous [regular page](/variables/site/#site-pages) (sorted by Hugo's [default sort](/templates/lists#default-weight-date-linktitle-filepath)). Example: `{{if .Prev}}{{.Prev.Permalink}}{{end}}`. Calling `.Prev` from the last page returns `nil`.

View file

@ -122,6 +122,7 @@
"bashrc",
"ebuild",
"eclass",
"env",
"exheres-0",
"exlib",
"ksh",
@ -974,6 +975,12 @@
"prolog"
]
},
{
"Name": "PromQL",
"Aliases": [
"promql"
]
},
{
"Name": "Protocol Buffer",
"Aliases": [
@ -1188,6 +1195,13 @@
"sml"
]
},
{
"Name": "Stylus",
"Aliases": [
"styl",
"stylus"
]
},
{
"Name": "Swift",
"Aliases": [

View file

@ -3,7 +3,7 @@ publish = "public"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.78.2"
HUGO_VERSION = "0.80.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
command = "hugo --gc --minify --enableGitInfo"
[context.split1.environment]
HUGO_VERSION = "0.78.2"
HUGO_VERSION = "0.80.0"
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.78.2"
HUGO_VERSION = "0.80.0"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
HUGO_VERSION = "0.78.2"
HUGO_VERSION = "0.80.0"
[context.next.environment]
HUGO_ENABLEGITINFO = "true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB