Squashed 'docs/' changes from 37095d540..d1cf9adc4

d1cf9adc4 Fix typo
26e10a690 Fix the name and arg mismatch between partial defn and call
2db0e53cd Merge commit '9c36cff15224f6cbd19058ad61311229b7a23c83'
9c36cff15 Squashed 'themes/gohugoioTheme/' changes from 68ddff44..b8202f53
4b021eff8 Update lang.Merge.md
b37af2916 Add title to yaml
a9a281233 Fixed incorrect usage of the code-toggle shortcode
4560a0169 Update Warning for Theme Links (#676)
0305e3c6b Document .File.ContentBaseName
6d30c5aa1 Update configuration.md
158df174a Document .Sites and .Sites.First
0c0f583b8 Add stale config
e2531afd8 Document path template functions
4dd779057 Clarify that partialCached is per site/language
19e5bbe0c Update index.md
44b000857 Add missing dot
a41300cf9 Release 0.52
2d1d92b88 Merge branch 'temp52'
c5925250d releaser: Prepare repository for 0.53-DEV
d000b04a2 releaser: Add release notes to /docs for release of 0.52
4bb983a0a releaser: Bump versions for release of 0.52
36736ca28 tpl: Add "param" shortcode
378677aa6 Add Elasticsearch/bonsai.io to services doc.
4c3fd4fa4 docs: Document inline shortcodes
6c64c374c Whitelist CSS modules from purge
817a872b9 Improve search icon position
cf86ff1c7 Add minification and resource cache clear to build command
fd77e8df3 Update asset dependencies and adopt Hugo Pipes
cdbe97e8c Update render.md
b0e279220 git command to update submodule to latest
a1cb98c12 cache/filecache: Add a :project placeholder
07c1b2b46 cache/filecache: Use time.Duration for maxAge
ffa9b165e Add AND as a title
6e7733b40 Add OR as a sub title to make it easier to find in search
72b6791a1 docs: Document the new file cache
714d3ca91 Fix minification issues
cd1e961da Revert "Add Elasticsearch/bonsai.io to services doc."
15a0cda6e Add Elasticsearch/bonsai.io to services doc.
f931d86de Release 0.51
e2ffe867a Merge branch 'temp51'
423e7f5c8 releaser: Prepare repository for 0.52-DEV
c6f2d6ae1 releaser: Add release notes to /docs for release of 0.51
5bbb556dc releaser: Bump versions for release of 0.51
3b2b172b9 docs: Document shortcode error handling
b8672f3d4 docs: Document symdiff
4bc6071e6 docs: Document complement
d1baab752 docs: Re-generate CLI docs
9ea667e24 Revert "tpl: Update Jsonify to return pretty-print output"
ce5a1403d docs: Regenerate the docs helper
99a1f4a94 Fix note for reserved partial name(starting with -> including).
eba3cbc42 fix accidentally modification on paragraph.
3eebd98c3 Add note for reserved partial name.
40b881cc2 Document templates.Exists
b5c3bcd3b Update multilingual.md
61c59c67e Fix misspelling (#648)
f21d8c4a4 Correct minor typo (#5372)
e967001b9 Release 0.50
685fd6b08 releaser: Prepare repository for 0.51-DEV
f245a9faa releaser: Add release notes to /docs for release of 0.50
4354da30d releaser: Bump versions for release of 0.50
feaa05469 docs: Regenerate CLI docs
5c724200c Merge commit 'd6a4af7018e8618944a6471ceeb7aae1d4df6afa'
2ddab36c2 Merge commit '74309fe5699a595080fdb3a14711e0869babce99'
8cf296a7c docs: Regenerate CLI docs
9097683dd tpl: Update Jsonify to return pretty-print output

git-subtree-dir: docs
git-subtree-split: d1cf9adc412245c96d9d32592a903370d3972aef
This commit is contained in:
Bjørn Erik Pedersen 2018-12-12 09:05:31 +01:00
parent d6a4af7018
commit eb16165694
232 changed files with 11757 additions and 22756 deletions

21
.github/stale.yml vendored Normal file
View file

@ -0,0 +1,21 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 120
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30
# Issues with these labels will never be considered stale
exemptLabels:
- Keep
- Security
# Label to use when marking an issue as stale
staleLabel: Stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If you still think this is important, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View file

@ -69,7 +69,7 @@ twitter = "GoHugoIO"
[params]
description = "The worlds fastest framework for building websites"
## Used for views in rendered HTML (i.e., rather than using the .Hugo variable)
release = "0.49.2"
release = "0.52"
## Setting this to true will add a "noindex" to *EVERY* page on the site
removefromexternalsearch = false
## Gh repo for site footer (include trailing slash)

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo"
slug: hugo
url: /commands/hugo/
@ -74,4 +74,4 @@ hugo [flags]
* [hugo server](/commands/hugo_server/) - A high performance webserver
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo benchmark"
slug: hugo_benchmark
url: /commands/hugo_benchmark/
@ -39,6 +39,7 @@ hugo benchmark [flags]
--ignoreCache ignores the cache directory
-l, --layoutDir string filesystem path to layout directory
--memprofile string path/filename for the memory profile file
--minify minify any supported output format (HTML, XML etc.)
--noChmod don't sync permission mode of files
--noTimes don't sync modification time of files
--renderToMemory render to memory (only useful for benchmark testing)
@ -66,4 +67,4 @@ hugo benchmark [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo check"
slug: hugo_check
url: /commands/hugo_check/
@ -35,4 +35,4 @@ Contains some verification checks
* [hugo](/commands/hugo/) - hugo builds your site
* [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo check ulimit"
slug: hugo_check_ulimit
url: /commands/hugo_check_ulimit/
@ -39,4 +39,4 @@ hugo check ulimit [flags]
* [hugo check](/commands/hugo_check/) - Contains some verification checks
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo config"
slug: hugo_config
url: /commands/hugo_config/
@ -39,4 +39,4 @@ hugo config [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo convert"
slug: hugo_convert
url: /commands/hugo_convert/
@ -42,4 +42,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo convert toJSON"
slug: hugo_convert_toJSON
url: /commands/hugo_convert_tojson/
@ -42,4 +42,4 @@ hugo convert toJSON [flags]
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo convert toTOML"
slug: hugo_convert_toTOML
url: /commands/hugo_convert_totoml/
@ -42,4 +42,4 @@ hugo convert toTOML [flags]
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo convert toYAML"
slug: hugo_convert_toYAML
url: /commands/hugo_convert_toyaml/
@ -42,4 +42,4 @@ hugo convert toYAML [flags]
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo env"
slug: hugo_env
url: /commands/hugo_env/
@ -38,4 +38,4 @@ hugo env [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo gen"
slug: hugo_gen
url: /commands/hugo_gen/
@ -38,4 +38,4 @@ A collection of several useful generators.
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo gen autocomplete"
slug: hugo_gen_autocomplete
url: /commands/hugo_gen_autocomplete/
@ -56,4 +56,4 @@ hugo gen autocomplete [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo gen chromastyles"
slug: hugo_gen_chromastyles
url: /commands/hugo_gen_chromastyles/
@ -43,4 +43,4 @@ hugo gen chromastyles [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo gen doc"
slug: hugo_gen_doc
url: /commands/hugo_gen_doc/
@ -45,4 +45,4 @@ hugo gen doc [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo gen man"
slug: hugo_gen_man
url: /commands/hugo_gen_man/
@ -41,4 +41,4 @@ hugo gen man [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo import"
slug: hugo_import
url: /commands/hugo_import/
@ -37,4 +37,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
* [hugo](/commands/hugo/) - hugo builds your site
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo import jekyll"
slug: hugo_import_jekyll
url: /commands/hugo_import_jekyll/
@ -41,4 +41,4 @@ hugo import jekyll [flags]
* [hugo import](/commands/hugo_import/) - Import your site from others.
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo list"
slug: hugo_list
url: /commands/hugo_list/
@ -40,4 +40,4 @@ List requires a subcommand, e.g. `hugo list drafts`.
* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo list drafts"
slug: hugo_list_drafts
url: /commands/hugo_list_drafts/
@ -39,4 +39,4 @@ hugo list drafts [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo list expired"
slug: hugo_list_expired
url: /commands/hugo_list_expired/
@ -40,4 +40,4 @@ hugo list expired [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo list future"
slug: hugo_list_future
url: /commands/hugo_list_future/
@ -40,4 +40,4 @@ hugo list future [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo new"
slug: hugo_new
url: /commands/hugo_new/
@ -17,6 +17,8 @@ You can also specify the kind with `-k KIND`.
If archetypes are provided in your theme or site, they will be used.
Ensure you run this within the root directory of your site.
```
hugo new [path] [flags]
```
@ -48,4 +50,4 @@ hugo new [path] [flags]
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo new site"
slug: hugo_new_site
url: /commands/hugo_new_site/
@ -43,4 +43,4 @@ hugo new site [path] [flags]
* [hugo new](/commands/hugo_new/) - Create new content for your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo new theme"
slug: hugo_new_theme
url: /commands/hugo_new_theme/
@ -42,4 +42,4 @@ hugo new theme [name] [flags]
* [hugo new](/commands/hugo_new/) - Create new content for your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo server"
slug: hugo_server
url: /commands/hugo_server/
@ -40,6 +40,7 @@ hugo server [flags]
--cleanDestinationDir remove files from destination not found in static directories
-c, --contentDir string filesystem path to content directory
-d, --destination string filesystem path to write files to
--disableBrowserError do not show build errors in the browser
--disableFastRender enables full re-renders on changes
--disableKinds strings disable different kind of pages (home, RSS etc.)
--disableLiveReload watch without enabling live browser reload on rebuild
@ -53,6 +54,7 @@ hugo server [flags]
--liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1)
--meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
--memstats string log memory usage to this file
--minify minify any supported output format (HTML, XML etc.)
--navigateToChanged navigate to changed content file on live browser reload
--noChmod don't sync permission mode of files
--noHTTPCache prevent HTTP caching
@ -84,4 +86,4 @@ hugo server [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -1,5 +1,5 @@
---
date: 2018-09-24
date: 2018-11-05
title: "hugo version"
slug: hugo_version
url: /commands/hugo_version/
@ -38,4 +38,4 @@ hugo version [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 24-Sep-2018
###### Auto generated by spf13/cobra on 5-Nov-2018

View file

@ -37,7 +37,6 @@ JSON
### Example
{{< code-toggle >}}
+++
title = "spf13-vim 3.0 release and new website"
description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
@ -47,8 +46,7 @@ categories = [
"VIM"
]
slug = "spf13-vim-3-0-release-and-new-website"
+++
{{</ code-toggle >}}
{{< /code-toggle >}}
## Front Matter Variables

View file

@ -349,12 +349,6 @@ And then in the template:
```
{{ i18n "readingTime" .ReadingTime }}
```
To track down missing translation strings, run Hugo with the `--i18n-warnings` flag:
```
hugo --i18n-warnings | grep i18n
i18n|MISSING_TRANSLATION|en|wordCount
```
## Customize Dates
@ -438,6 +432,13 @@ Hugo will generate your website with these missing translation placeholders. It
For merging of content from other languages (i.e. missing content translations), see [lang.Merge](/functions/lang.merge/).
To track down missing translation strings, run Hugo with the `--i18n-warnings` flag:
```
hugo --i18n-warnings | grep i18n
i18n|MISSING_TRANSLATION|en|wordCount
```
## Multilingual Themes support
To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:

View file

@ -15,6 +15,7 @@ categories: [content management]
keywords: [markdown,content,shortcodes]
draft: false
aliases: [/extras/shortcodes/]
testparam: "Hugo Rocks!"
toc: true
---
@ -240,6 +241,24 @@ Using the preceding `instagram` with `hidecaption` example above, the following
{{< instagram BWNjjyYFxVx hidecaption >}}
### `param`
Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. If will log an `ERROR` if the param with the given key could not be found in either.
```bash
{{</* param testparam */>}}
```
Since `testparam` is a param defined in front matter of this page with the value `Hugo Rocks!`, the above will print:
{{< param testparam >}}
To access deeply nested params, use "dot syntax", e.g:
```bash
{{</* param "my.nested.param" */>}}
```
### `ref` and `relref`
These shortcodes will look up the pages by their relative path (e.g., `blog/post.md`) or their logical name (`post.md`) and return the permalink (`ref`) or relative permalink (`relref`) for the found page.

View file

@ -22,7 +22,7 @@ toc: true
A collection of all themes created by the Hugo community, including screenshots and demos, can be found at <https://themes.gohugo.io>. Every theme in this list will automatically be added to the theme site. Theme updates aren't scheduled but usually happen at least once a week.
## tl;dr
## Adding a theme to the list
1. Create your theme using `hugo new theme <THEMENAME>`;
2. Test your theme against <https://github.com/gohugoio/hugoBasicExample> \*

View file

@ -0,0 +1,29 @@
---
title: "complement"
description: "`collections.Complement` (alias `complement`) gives the elements of a collection that are not in any of the others."
date: 2018-11-07
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [collections,intersect,union]
signature: ["COLLECTION | complement COLLECTION [COLLECTION]..." ]
hugoversion: "0.51"
aliases: []
---
Example:
```go-html-template
{{ $pages := .Site.RegularPages | first 50 }}
{{ $news := where $pages "Type" "news" | first 5 }}
{{ $blog := where $pages "Type" "blog" | first 5 }}
{{ $other := $pages | complement $news $blog | first 10 }}
```
The above is an imaginary use case for the home page where you want to display different page listings in sections/boxes on different places on the page: 5 from `news`, 5 from the `blog` and then 10 of the pages not shown in the other listings, to _complement_ them.

View file

@ -22,20 +22,25 @@ aliases: []
`dict` is especially useful for passing more than one value to a partial template.
## Example: `dict` with Embedded SVGs
## Example: Using `dict` to pass multiple values to a `partial`
The partial below creates a SVG and expects `fill` `height` and `width` from the caller:
The partial below creates a SVG and expects `fill`, `height` and `width` from the caller:
**Partial definition**
{{< code file="layouts/partials/svgs/external-links.svg" download="external-links.svg" >}}
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="{{ .fill }}" width="{{ .size }}" height="{{ .size }}" viewBox="0 0 32 32" aria-label="External Link">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
fill="{{ .fill }}" width="{{ .width }}" height="{{ .height }}" viewBox="0 0 32 32" aria-label="External Link">
<path d="M25.152 16.576v5.696q0 2.144-1.504 3.648t-3.648 1.504h-14.848q-2.144 0-3.648-1.504t-1.504-3.648v-14.848q0-2.112 1.504-3.616t3.648-1.536h12.576q0.224 0 0.384 0.16t0.16 0.416v1.152q0 0.256-0.16 0.416t-0.384 0.16h-12.576q-1.184 0-2.016 0.832t-0.864 2.016v14.848q0 1.184 0.864 2.016t2.016 0.864h14.848q1.184 0 2.016-0.864t0.832-2.016v-5.696q0-0.256 0.16-0.416t0.416-0.16h1.152q0.256 0 0.416 0.16t0.16 0.416zM32 1.152v9.12q0 0.48-0.352 0.8t-0.8 0.352-0.8-0.352l-3.136-3.136-11.648 11.648q-0.16 0.192-0.416 0.192t-0.384-0.192l-2.048-2.048q-0.192-0.16-0.192-0.384t0.192-0.416l11.648-11.648-3.136-3.136q-0.352-0.352-0.352-0.8t0.352-0.8 0.8-0.352h9.12q0.48 0 0.8 0.352t0.352 0.8z"></path>
</svg>
{{< /code >}}
These values can be stored in one object with `dict` and passed to the partial:
**Partial call**
The `fill`, `height` and `width` values can be stored in one object with `dict` and passed to the partial:
{{< code file="layouts/_default/list.html" >}}
{{ partial "svg/link-ext.svg" (dict "fill" "#01589B" "size" 10 "width" 20 ) }}
{{ partial "svgs/external-links.svg" (dict "fill" "#01589B" "width" 10 "height" 20 ) }}
{{< /code >}}

View file

@ -1,4 +1,5 @@
---
title: imageConfig
linktitle: imageConfig
description: Parses the image and returns the height, width, and color model.
godocref:

View file

@ -10,7 +10,7 @@ categories: [functions]
menu:
docs:
parent: "functions"
keywords: []
keywords: [collections,intersect,union,complement,symdiff]
signature: ["intersect SET1 SET2"]
workson: []
hugoversion:
@ -18,9 +18,10 @@ relatedfuncs: []
deprecated: false
aliases: []
---
An useful example is to use it as `AND` filters when combined with where:
## AND filter in where query
```
{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
{{ $pages := $pages | union (where .Site.RegularPages "Params.pinned" true) }}

View file

@ -29,17 +29,13 @@ As an example:
Will "fill in the gaps" in the current site with, from left to right, content from the French site, and lastly the English.
A more practical example is to fill in the missing translations for the "minority languages" with content from the main language:
A more practical example is to fill in the missing translations from the other languages:
```bash
{{ $pages := .Site.RegularPages }}
{{ .Scratch.Set "pages" $pages }}
{{ $mainSite := .Sites.First }}
{{ if ne $mainSite .Site }}
{{ .Scratch.Set "pages" ($pages | lang.Merge $mainSite.RegularPages) }}
{{ end }}
{{ $pages := .Scratch.Get "pages" }}
{{ $pages := .Site.RegularPages }}
{{ range .Site.Home.Translations }}
{{ $pages = $pages | lang.Merge .Site.RegularPages }}
{{ end }}
```
{{% note %}}

View file

@ -19,7 +19,12 @@ deprecated: false
aliases: []
---
The `partialCached` template function can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation. Here is the simplest usage:
The `partialCached` template function can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation.
**Note:** Each Site (or language) has its own `partialCached` cache, so each site will execute a partial once.
Here is the simplest usage:
```
{{ partialCached "footer.html" . }}

View file

@ -0,0 +1,31 @@
---
title: path.Base
description: Base returns the last element of a path.
godocref:
date: 2018-11-28
publishdate: 2018-11-28
lastmod: 2018-11-28
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [path, base]
signature: ["path.Base PATH"]
workson: []
hugoversion: "0.40"
relatedfuncs: [path.Dir, path.Ext, path.Split]
deprecated: false
---
`path.Base` returns the last element of `PATH`.
If `PATH` is empty, `.` is returned.
**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
```
{{ path.Base "a/news.html" }} → "news.html"
{{ path.Base "news.html" }} → "news.html"
{{ path.Base "a/b/c" }} → "c"
{{ path.Base "/x/y/z/" }} → "z"
```

View file

@ -0,0 +1,32 @@
---
title: path.Dir
description: Dir returns all but the last element of a path.
godocref:
date: 2018-11-28
publishdate: 2018-11-28
lastmod: 2018-11-28
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [path, dir]
signature: ["path.Dir PATH"]
workson: []
hugoversion: "0.40"
relatedfuncs: [path.Base, path.Ext, path.Split]
deprecated: false
---
`path.Dir` returns all but the last element of `PATH`, typically `PATH`'s directory.
The returned path will never end in a slash.
If `PATH` is empty, `.` is returned.
**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
```
{{ path.Dir "a/news.html" }} → "a"
{{ path.Dir "news.html" }} → "."
{{ path.Dir "a/b/c" }} → "a/b"
{{ path.Dir "/x/y/z" }} → "/x/y"
```

View file

@ -0,0 +1,29 @@
---
title: path.Ext
description: Ext returns the file name extension of a path.
godocref:
date: 2018-11-28
publishdate: 2018-11-28
lastmod: 2018-11-28
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [path, ext, extension]
signature: ["path.Ext PATH"]
workson: []
hugoversion: "0.40"
relatedfuncs: [path.Base, path.Dir, path.Split]
deprecated: false
---
`path.Ext` returns the file name extension `PATH`.
The extension is the suffix beginning at the final dot in the final slash-separated element `PATH`;
it is empty if there is no dot.
**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
```
{{ path.Ext "a/b/c/news.html" }} → ".html"
```

View file

@ -0,0 +1,29 @@
---
title: path.Join
description: Join path elements into a single path.
godocref:
date: 2018-11-28
publishdate: 2018-11-28
lastmod: 2018-11-28
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [path, join]
signature: ["path.Join ELEMENT..."]
workson: []
hugoversion: "0.39"
relatedfuncs: [path.Split]
deprecated: false
---
`path.Join` joins path elements into a single path, adding a separating slash if necessary.
All empty strings are ignored.
**Note:** All path elements on Windows are converted to slash ('/') separators.
```
{{ path.Join "partial" "news.html" }} → "partial/news.html"
{{ path.Join "partial/" "news.html" }} → "partial/news.html"
{{ path.Join "foo/baz" "bar" }} → "foo/baz/bar"
```

View file

@ -0,0 +1,31 @@
---
title: path.Split
description: Split path immediately following the final slash.
godocref:
date: 2018-11-28
publishdate: 2018-11-28
lastmod: 2018-11-28
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [path, split]
signature: ["path.Split PATH"]
workson: []
hugoversion: "0.39"
relatedfuncs: [path.Split]
deprecated: false
---
`path.Split` splits `PATH` immediately following the final slash, separating it into a directory and a base component.
The returned values have the property that `PATH` = `DIR`+`BASE`.
If there is no slash in `PATH`, it returns an empty directory and the base is set to `PATH`.
**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"
```

View file

@ -1,6 +1,5 @@
---
title: render
# linktitle: Render
title: .Render
description: Takes a view to apply when rendering content.
godocref:
date: 2017-02-01
@ -11,7 +10,7 @@ menu:
docs:
parent: "functions"
keywords: [views]
signature: ["render LAYOUT"]
signature: [".Render LAYOUT"]
workson: []
hugoversion:
relatedfuncs: []

View file

@ -0,0 +1,28 @@
---
title: "symdiff"
description: "`collections.SymDiff` (alias `symdiff`) returns the symmetric difference of two collections."
date: 2018-11-07
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [collections,intersect,union, complement]
signature: ["COLLECTION | symdiff COLLECTION" ]
hugoversion: "0.51"
aliases: []
---
Example:
```go-html-template
{{ slice 1 2 3 | symdiff (slice 3 4) }}
```
The above will print `[1 2 4]`.
Also see https://en.wikipedia.org/wiki/Symmetric_difference

View file

@ -0,0 +1,37 @@
---
title: templates.Exists
linktitle: ""
description: "Checks whether a template file exists under the given path relative to the `layouts` directory."
godocref: ""
date: 2018-11-01
publishdate: 2018-11-01
lastmod: 2018-11-01
categories: [functions]
tags: []
menu:
docs:
parent: "functions"
ns: ""
keywords: ["templates", "template", "layouts"]
signature: ["templates.Exists PATH"]
workson: []
hugoversion: "0.46"
aliases: []
relatedfuncs: []
toc: false
deprecated: false
---
A template file is any file living below the `layouts` directories of either the project or any of its theme components incudling partials and shortcodes.
The function is particulary handy with dynamic path. The following example ensures the build will not break on a `.Type` missing its dedicated `header` partial.
```go-html-template
{{ $partialPath := printf "headers/%s.html" .Type }}
{{ if templates.Exists ( printf "partials/%s" $partialPath ) }}
{{ partial $partialPath . }}
{{ else }}
{{ partial "headers/default.html" . }}
{{ end }}
```

View file

@ -35,6 +35,7 @@ Given two arrays (or slices) A and B, this function will return a new array that
<!-- returns an error because both arrays/slices have to be of the same type -->
```
## OR filter in where query
This is also very useful to use as `OR` filters when combined with where:

View file

@ -62,6 +62,9 @@ buildExpired (false)
buildFuture (false)
: Include content with publishdate in the future.
caches
: See [Configure File Caches](#configure-file-caches)
canonifyURLs (false)
: Enable to turn relative URLs into absolute.
@ -95,6 +98,9 @@ enableEmoji (false)
enableGitInfo (false)
: Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file.
enableInlineShortcodes
: Enable inline shortcode support. See [Inline Shortcodes](/templates/shortcode-templates/#inline-shortcodes).
enableMissingTranslationPlaceholders (false)
: Show a placeholder instead of the default value or an empty string if a translation is missing.
@ -403,6 +409,47 @@ However, if you have specific needs with respect to Markdown, Hugo exposes some
Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats][] for information on how to add these values to your Hugo project's configuration file.
## Configure File Caches
Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
```toml
[caches]
[caches.getjson]
dir = ":cacheDir/:project"
maxAge = -1
[caches.getcsv]
dir = ":cacheDir/:project"
maxAge = -1
[caches.images]
dir = ":resourceDir/_gen"
maxAge = -1
[caches.assets]
dir = ":resourceDir/_gen"
maxAge = -1
```
You can override any of these cache setting in your own `config.toml`.
### The keywords explained
:cacheDir
: This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml).
`:project`
The base directory name of the current Hugo project. This means that, in its default setting, every project will have separated file caches, which means that when you do `hugo --gc` you will not touch files related to other Hugo projects running on the same PC.
`:resourceDir`
: This is the value of the `resourceDir` config option.
maxAge
: This is the duration before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. Uses Go's `time.Duration`, so valid values are `"10s"` (10 seconds), `"10m"` (10 minutes) and `"10h"` (10 hours).
dir
: The absolute path to where the files for this cache will be stored. Allowed starting placeholders are `:cacheDir` and `:resourceDir` (see above).
## Configuration Format Specs
* [TOML Spec][toml]

View file

@ -128,6 +128,12 @@ You can checkout a specific version as follows:
git checkout tags/<version-name>
```
You can update a theme to the latest version by executing the following command in the *root* directory of your project:
```
git submodule update --rebase --remote
```
## Next Steps
You now have a live website served over https, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation:

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

View file

@ -0,0 +1,150 @@
---
date: 2018-10-29
title: "Hugo 0.50: Errors so Good, Youll Want to Fail!"
description: "Errors with full filename and line and column number, shown in browser. And improved Fast Render Mode …"
categories: ["Releases"]
---
Hugo `0.50` brings **greatly improved error messages**, and we now also show them in the browser. Having error messages with filename, line- and column number greatly simplify troubleshooting. Many editors (like VS Code) even let you click and navigate directly to the problematic line. If your editor requires a different log format, you can set it via the `HUGO_FILE_LOG_FORMAT` OS environment variable:
```bash
env HUGO_FILE_LOG_FORMAT="\":file::line::col\"" hugo server
```
But this release isn't all about error handling. Getting line- and column number into "every" error also meant that we had to consolidate and simplify some code paths, which, as a nice side effect, made Hugo a little bit faster. Benchmarks show it running **about 5% faster and consume about 8% less memory**.
Also, we have now implemented **"render on demand"** in Hugo's Fast Render Mode (default when running `hugo server`). This means that you should now always see updated content when navigating around the site after a change.
This release represents **88 contributions by 14 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), [@anthonyfok](https://github.com/anthonyfok), and [@GregorioMartinez](https://github.com/GregorioMartinez) for their ongoing contributions.
And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **14 contributions by 9 contributors**. A special thanks to [@bep](https://github.com/bep), [@NotWoods](https://github.com/NotWoods), [@Nick-Rivera](https://github.com/Nick-Rivera), and [@tomanistor](https://github.com/tomanistor) for their work on the documentation site.
Hugo now has:
* 29842+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 441+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 275+ [themes](http://themes.gohugo.io/)
## Notes
* You should not get stale content in Fast Render Mode anymore.
* Errors will now show up in the browser by default, turn it off by running `hugo server --disableBrowserError`
* `jsonify` will now produce pretty/indented output
## Enhancements
### Templates
* Handle truncated identifiers in Go template errors [2d7709d1](https://github.com/gohugoio/hugo/commit/2d7709d15584e4c11138cd7fe92717a2a58e4585) [@bep](https://github.com/bep) [#5346](https://github.com/gohugoio/hugo/issues/5346)
* Update Jsonify to return pretty-print output [5a52cd5f](https://github.com/gohugoio/hugo/commit/5a52cd5f920bb3d067ab1682adece9f813c67ba1) [@SeanPrashad](https://github.com/SeanPrashad) [#5040](https://github.com/gohugoio/hugo/issues/5040)
* Improve the Execute panic error message [0fe4ff18](https://github.com/gohugoio/hugo/commit/0fe4ff18751156fa072e1f83077e49a8597e7dcd) [@bep](https://github.com/bep) [#5327](https://github.com/gohugoio/hugo/issues/5327)
* Use .Lastmod in embedded schema template [c21e5179](https://github.com/gohugoio/hugo/commit/c21e5179ce9a370c416c01fbe9472be1fb5c6650) [@akshaybabloo](https://github.com/akshaybabloo) [#5320](https://github.com/gohugoio/hugo/issues/5320)
* Cast IsSet key to int for indexed types [0d5110d0](https://github.com/gohugoio/hugo/commit/0d5110d03324380cb4a288d3fa08c1b86ba227da) [@moorereason](https://github.com/moorereason) [#3681](https://github.com/gohugoio/hugo/issues/3681)
* Add a delimiter parameter to lang.NumFmt [ce264b93](https://github.com/gohugoio/hugo/commit/ce264b936ce9f589bd889e18762881cff8bc9cd0) [@moorereason](https://github.com/moorereason) [#5260](https://github.com/gohugoio/hugo/issues/5260)
### Core
* Adjust error test to make it pass on Go tip [acc14b46](https://github.com/gohugoio/hugo/commit/acc14b4646d849e09e8da37552d4f4f777d0fce2) [@bep](https://github.com/bep)
* Rename some page_* files [e3ed4a83](https://github.com/gohugoio/hugo/commit/e3ed4a83b8e92ce9bf070f7b41780798b006e848) [@bep](https://github.com/bep)
* Get file context in "config parse failed" errors [ed7b3e26](https://github.com/gohugoio/hugo/commit/ed7b3e261909fe425ef64216f12806840c45b205) [@bep](https://github.com/bep) [#5325](https://github.com/gohugoio/hugo/issues/5325)
* Improve errors in /i18n handlling [2bf686ee](https://github.com/gohugoio/hugo/commit/2bf686ee217808186385bfcf6156f15bbdb33651) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Improve errors in /data handlling [9f74dc2a](https://github.com/gohugoio/hugo/commit/9f74dc2a52b6f568b5a060b7a4be47196804b01f) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Continue the file context/line number errors work [d1661b82](https://github.com/gohugoio/hugo/commit/d1661b823af25c50d3bbe5366ea40a3cdd52e237) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Remove the now superflous Source struct [7930d213](https://github.com/gohugoio/hugo/commit/7930d2132a3c36c1aaca20f16f56978c84656b0a) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Redo the summary delimiter logic [44da60d8](https://github.com/gohugoio/hugo/commit/44da60d869578423dea529db62ed613588a2a560) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Integrate new page parser [1e3e3400](https://github.com/gohugoio/hugo/commit/1e3e34002dae3d4a980141efcc86886e7de5bef8) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Use []byte in shortcode parsing [1b7ecfc2](https://github.com/gohugoio/hugo/commit/1b7ecfc2e176315b69914756c70b46306561e4d1) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Use stdlib context package [4b4af2c5](https://github.com/gohugoio/hugo/commit/4b4af2c52e658d516dd4bfaf59fef4f054dabec3) [@GregorioMartinez](https://github.com/GregorioMartinez)
* Normalize permalink path segments [fae48d74](https://github.com/gohugoio/hugo/commit/fae48d7457de96969ec53349194dcbfa45adc269) [@moorereason](https://github.com/moorereason) [#5223](https://github.com/gohugoio/hugo/issues/5223)[#4926](https://github.com/gohugoio/hugo/issues/4926)
* Improve error message for bad taxonomy weights [d3b81ee5](https://github.com/gohugoio/hugo/commit/d3b81ee58e8fd3a0ab8265a2898d66cbcdf6a7c1) [@moorereason](https://github.com/moorereason)
* Cast taxonomy weight parameters to int [1fd30d46](https://github.com/gohugoio/hugo/commit/1fd30d462ee7f67fde6f29d170af1d225258322b) [@moorereason](https://github.com/moorereason) [#4628](https://github.com/gohugoio/hugo/issues/4628)
* Allow nil to be unwrapped as *Page [498d6299](https://github.com/gohugoio/hugo/commit/498d6299581bead0f582431b8133d8b5f8760618) [@moorereason](https://github.com/moorereason) [#5043](https://github.com/gohugoio/hugo/issues/5043)
* Be a litle more specific in NextPage TODO [fb732d53](https://github.com/gohugoio/hugo/commit/fb732d5322381ee7f3a849258419cef7bbf1487b) [@bep](https://github.com/bep)
* Introduce Page.NextPage and Page.PrevPage [ad705aac](https://github.com/gohugoio/hugo/commit/ad705aac0649fa3102f7639bc4db65d45e108ee2) [@felicianotech](https://github.com/felicianotech) [#1061](https://github.com/gohugoio/hugo/issues/1061)
### Other
* Update go.sum [7082a5d1](https://github.com/gohugoio/hugo/commit/7082a5d14382acfc300ae4f66d07a14100e2358c) [@bep](https://github.com/bep)
* Update minify [aa281b51](https://github.com/gohugoio/hugo/commit/aa281b5135db2e84b9e21b5f38a6cb63cf3ab158) [@bep](https://github.com/bep) [#5261](https://github.com/gohugoio/hugo/issues/5261)
* Regenerate CLI docs [32501987](https://github.com/gohugoio/hugo/commit/325019872467ee152ea56329a796acf35dec6fb3) [@bep](https://github.com/bep)
* Make sure the global logger also gets colored labels [9c88a8a5](https://github.com/gohugoio/hugo/commit/9c88a8a55adf7779039504fa77d74ec80d658c40) [@bep](https://github.com/bep) [#4414](https://github.com/gohugoio/hugo/issues/4414)
* Avoid using the global logger [95e72f5e](https://github.com/gohugoio/hugo/commit/95e72f5e8e4634fbbb2ea7ece2156487230ad1d4) [@bep](https://github.com/bep) [#4414](https://github.com/gohugoio/hugo/issues/4414)
* Add color to ERROR and WARN [1c7b7b4e](https://github.com/gohugoio/hugo/commit/1c7b7b4ef293aa133e5b55f3ebb2d37d8839532f) [@bep](https://github.com/bep) [#4414](https://github.com/gohugoio/hugo/issues/4414)
* Make the file error log format configurable [1ad117cb](https://github.com/gohugoio/hugo/commit/1ad117cbe2903aa9d029f90750acf633eb2a51a2) [@bep](https://github.com/bep) [#5352](https://github.com/gohugoio/hugo/issues/5352)
* Allow a mix of slice types in append/Scratch.Add [dac7092a](https://github.com/gohugoio/hugo/commit/dac7092a9cb22d59db28fb15af15f7b14ff47588) [@bep](https://github.com/bep) [#5361](https://github.com/gohugoio/hugo/issues/5361)
* Allow .Data.Integrity to be accessed on its own [b27ccf34](https://github.com/gohugoio/hugo/commit/b27ccf34bf4e5ee618a66fa11c68a9690e395034) [@bep](https://github.com/bep) [#5296](https://github.com/gohugoio/hugo/issues/5296)
* Update minify [83c873ff](https://github.com/gohugoio/hugo/commit/83c873ff37ddd379181540021232f026e7678486) [@bep](https://github.com/bep) [#5261](https://github.com/gohugoio/hugo/issues/5261)
* Update cast [a2440dc0](https://github.com/gohugoio/hugo/commit/a2440dc0e2d46ef774305cd5e4fea5ff2bdd5f11) [@bep](https://github.com/bep) [#5340](https://github.com/gohugoio/hugo/issues/5340)
* Truncate the error log on repeated config errors [1e9ac3dc](https://github.com/gohugoio/hugo/commit/1e9ac3dcc21e8f78d3f0a0ba4f35f6c142dfa6bc) [@bep](https://github.com/bep)
* Regenerate CLI docs [40e99672](https://github.com/gohugoio/hugo/commit/40e99672b6f697a614485aace07ca84268f6c787) [@bep](https://github.com/bep) [#5354](https://github.com/gohugoio/hugo/issues/5354)
* Serialize image processing [3a3badfd](https://github.com/gohugoio/hugo/commit/3a3badfd1d4b1d4c9863ecaf029512d36136fa0f) [@bep](https://github.com/bep) [#5220](https://github.com/gohugoio/hugo/issues/5220)
* Only show Ansi escape codes if in a terminal [df021317](https://github.com/gohugoio/hugo/commit/df021317a964a482cd1cd579de5a12d50faf0d08) [@bep](https://github.com/bep)
* Read disableFastRender from flag even if it's not changed [78a4c2e3](https://github.com/gohugoio/hugo/commit/78a4c2e32ef9ea8e92bb7bb3586e4c22b02eb494) [@bep](https://github.com/bep) [#5353](https://github.com/gohugoio/hugo/issues/5353)
* Use overflow-x: auto; for browser errors [d4ebfea1](https://github.com/gohugoio/hugo/commit/d4ebfea1fffdc35059f42a46387e0aaf0ea877d2) [@bep](https://github.com/bep)
* Remove the ANSI color for the browser error version [93aa6261](https://github.com/gohugoio/hugo/commit/93aa6261b4fc8caa74afef97b6304ea35dfd7d0e) [@bep](https://github.com/bep)
* Add some color to the relevant filenames in terminal log [deff9e15](https://github.com/gohugoio/hugo/commit/deff9e154bc0371af56741ddb22cb1f9e392838a) [@bep](https://github.com/bep) [#5344](https://github.com/gohugoio/hugo/issues/5344)
* Run gofmt -s [889aca05](https://github.com/gohugoio/hugo/commit/889aca054a267506a1c7cfaa3992d324764d6358) [@bep](https://github.com/bep)
* Resolve error handling/parser related TODOs [6636cf1b](https://github.com/gohugoio/hugo/commit/6636cf1bea77d20ef2a72a45fae59ac402fb133b) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Improve handling of JSON errors [f669ef6b](https://github.com/gohugoio/hugo/commit/f669ef6bec25155d015b6ab231c53caef4fa5cdc) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Convert the rest to new page parser code paths [eb038cfa](https://github.com/gohugoio/hugo/commit/eb038cfa0a8ada29dfcba1204ec5c432da9ed7e0) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Consolidate the metadata decoders [129c27ee](https://github.com/gohugoio/hugo/commit/129c27ee6e9fed98dbfebeaa272fd52757b475b2) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Use []byte in page lexer [27f5a906](https://github.com/gohugoio/hugo/commit/27f5a906a2a34e3b8348c8baeea48355352b5bbb) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Add front matter etc. support [2fdc4a24](https://github.com/gohugoio/hugo/commit/2fdc4a24d5450a98cf38a4456e8e0e8e97a3343d) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* File renames and splitting [f6863e1e](https://github.com/gohugoio/hugo/commit/f6863e1ef725f654a4c869ef4955f9add6908a46) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Move the shortcode parser to the new pageparser package [d6c16afd](https://github.com/gohugoio/hugo/commit/d6c16afde0ce62cfea73447f30d6ed2b8ef4b411) [@bep](https://github.com/bep) [#5324](https://github.com/gohugoio/hugo/issues/5324)
* Avoid panic in error handler on config errors [6f3716dc](https://github.com/gohugoio/hugo/commit/6f3716dc22e373097a38d053f5415feca602f330) [@bep](https://github.com/bep)
* Prevent stale content in Fast Render Mode [4a366fcf](https://github.com/gohugoio/hugo/commit/4a366fcfee24b3a5a5045b16c3b87b76147adf5e) [@bep](https://github.com/bep) [#5281](https://github.com/gohugoio/hugo/issues/5281)
* Allow date and slug from filename for leaf bundles [1f42e47e](https://github.com/gohugoio/hugo/commit/1f42e47e475c0cd684426dd230de411d4c385a3c) [@Japanuspus](https://github.com/Japanuspus) [#4558](https://github.com/gohugoio/hugo/issues/4558)
* Show server error info in browser [35fbfb19](https://github.com/gohugoio/hugo/commit/35fbfb19a173b01bc881f2bbc5d104136633a7ec) [@bep](https://github.com/bep) [#5284](https://github.com/gohugoio/hugo/issues/5284)[#5290](https://github.com/gohugoio/hugo/issues/5290)[#5325](https://github.com/gohugoio/hugo/issues/5325)[#5324](https://github.com/gohugoio/hugo/issues/5324)
* Add .gitignore "hugo new site" [92979d92](https://github.com/gohugoio/hugo/commit/92979d92889ff8991acfadd42982c2e55d01b163) [@napei](https://github.com/napei)
* Optimize integrity string generation [0a3340e9](https://github.com/gohugoio/hugo/commit/0a3340e95254597bc8a9feb250f2733b7d51edf8) [@moorereason](https://github.com/moorereason)
* Add help text to "hugo new" [6b21ac3e](https://github.com/gohugoio/hugo/commit/6b21ac3e67cb101255e8c3d9dbf076391a9eed8d) [@elliotforbes](https://github.com/elliotforbes)
* Set "extended" tag based on build_url on Launchpad [d1442053](https://github.com/gohugoio/hugo/commit/d14420539ac04d31dde2252eee66d7e4c7749780) [@anthonyfok](https://github.com/anthonyfok)
* Call rst2html directly on *nix [3d4a9882](https://github.com/gohugoio/hugo/commit/3d4a9882bfc81215fb4f9eba8859324958747d4a) [@shreyanshk](https://github.com/shreyanshk)
* Update URLs to stop 301 redirects [bdca9727](https://github.com/gohugoio/hugo/commit/bdca9727944e4cbb5a9372a8404e948ffea7c31c) [@benabbottnz](https://github.com/benabbottnz)
* Merge branch 'release-0.49.2' [604ddb90](https://github.com/gohugoio/hugo/commit/604ddb90c5d6f1ca5583be1ec0ea8e48f014741a) [@bep](https://github.com/bep)
* Release 0.49.2 [c397f2c0](https://github.com/gohugoio/hugo/commit/c397f2c08087cf4cda3abe2d146e30f58d6d3216) [@bep](https://github.com/bep)
* Merge branch 'release-0.49.1' [3583dd6d](https://github.com/gohugoio/hugo/commit/3583dd6d713c243808b5e8724b32565ceaf66104) [@bep](https://github.com/bep)
* Relase 0.49.1 [235acf22](https://github.com/gohugoio/hugo/commit/235acf22321475895442ce49ca5d16be273c1e1f) [@bep](https://github.com/bep)
* Improve append in Scratch [23f48c30](https://github.com/gohugoio/hugo/commit/23f48c300cb5ffe0fe43c88464f38c68831a17ad) [@bep](https://github.com/bep) [#5275](https://github.com/gohugoio/hugo/issues/5275)
* Add GOPATH Hugo building tip [b5e17f7c](https://github.com/gohugoio/hugo/commit/b5e17f7c837ce796e1094c8033fa7084510402fb) [@bep](https://github.com/bep)
* Consolidate MakeSegment vs MakePathSanitized [e421696d](https://github.com/gohugoio/hugo/commit/e421696d02bfb8764ae57238e211ce0e85e9782e) [@bep](https://github.com/bep) [#4926](https://github.com/gohugoio/hugo/issues/4926)
* Render Markdown in figure shortcode "caption" and "attr" params [68181703](https://github.com/gohugoio/hugo/commit/6818170308994b5f01dec7a559f92d6c7c5ca100) [@kaushalmodi](https://github.com/kaushalmodi)
* Re-organize the figure shortcode for better readability [c5279064](https://github.com/gohugoio/hugo/commit/c5279064df9664d6b2ad277e2fba1e4bb3b0f4be) [@kaushalmodi](https://github.com/kaushalmodi)
* Update README & CONTRIBUTING [152cffb1](https://github.com/gohugoio/hugo/commit/152cffb13a237651c2277dc6c2c9e4172d58b3df) [@GregorioMartinez](https://github.com/GregorioMartinez)
* Add custom x-nodejs plugin to support ppc64el and s390x [91f49c07](https://github.com/gohugoio/hugo/commit/91f49c0700dde13e16f42c745584a0bef60c6fe2) [@anthonyfok](https://github.com/anthonyfok)
* Fetch mage with GO111MODULE=off [a475bf12](https://github.com/gohugoio/hugo/commit/a475bf125cd76dacc1bf7ccbcc263a7b59efc510) [@anthonyfok](https://github.com/anthonyfok)
* Use build-snaps instead of building go from source [fa873a6c](https://github.com/gohugoio/hugo/commit/fa873a6cb3f0fa81002fcd725ecd52fc4b9df48f) [@anthonyfok](https://github.com/anthonyfok)
* Skip "mage -v test" due to build failure on Launchpad [52ac85fb](https://github.com/gohugoio/hugo/commit/52ac85fbc4d4066b5e13df454593597df0166262) [@anthonyfok](https://github.com/anthonyfok)
* Move snapcraft.yaml to snap/snapcraft.yaml [27d42111](https://github.com/gohugoio/hugo/commit/27d4211187d4617f4b3afa970f91349567886748) [@anthonyfok](https://github.com/anthonyfok)
* Update the temp docker script [48413d76](https://github.com/gohugoio/hugo/commit/48413d76f44ecfc9b90f9df63974080f6b285667) [@bep](https://github.com/bep)
## Fixes
### Templates
* Fix baseof.html in error message [646a52a5](https://github.com/gohugoio/hugo/commit/646a52a5c5f52890f2d0270b68ba0f863047484a) [@bep](https://github.com/bep) [#5288](https://github.com/gohugoio/hugo/issues/5288)
* Fix handling of different interface types in Slice [10ac2ec4](https://github.com/gohugoio/hugo/commit/10ac2ec4466090957e1f6897906ddeb1e0b13673) [@bep](https://github.com/bep) [#5269](https://github.com/gohugoio/hugo/issues/5269)
### Core
* Fix test on Windows [083311d0](https://github.com/gohugoio/hugo/commit/083311d0336ced35909b3375950f7817ecf95ed0) [@bep](https://github.com/bep)
* Fix FuzzyWordCount test error message [06d28a46](https://github.com/gohugoio/hugo/commit/06d28a464d086880f52dd850f91e668ab957b31f) [@GregorioMartinez](https://github.com/GregorioMartinez)
### Other
* Fix archetype handling of directories in theme [78578632](https://github.com/gohugoio/hugo/commit/78578632f545283741a01f024a6ccedc0b695a30) [@bep](https://github.com/bep) [#5318](https://github.com/gohugoio/hugo/issues/5318)
* Simple doc fix in CONTRIBUTING.md [3a308912](https://github.com/gohugoio/hugo/commit/3a3089121b852332b5744d1f566959c8cf93cef4) [@krisbudhram](https://github.com/krisbudhram)
* Fix type checking in Append [2159d77f](https://github.com/gohugoio/hugo/commit/2159d77f368eb1f78e51dd94133554f88052d85f) [@bep](https://github.com/bep) [#5303](https://github.com/gohugoio/hugo/issues/5303)
* Fix go plugin build failure by renaming go.mod [3033a9a3](https://github.com/gohugoio/hugo/commit/3033a9a37eb66c08e60f9fe977f29d22bd646857) [@anthonyfok](https://github.com/anthonyfok)

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View file

@ -0,0 +1,102 @@
---
date: 2018-11-07
title: "Hugo 0.51: The 30K Stars Edition!"
description: "Bug fixes, new template functions and more error improvements."
categories: ["Releases"]
---
Hugo reached [30 000 stars on GitHub](https://github.com/gohugoio/hugo/stargazers) this week, which is a good occasion to do a follow-up release of the great Hugo `0.50`. This is mostly a bug fix release, but it also adds some useful new functionality, two examples are the new template funcs [complement](https://gohugo.io/functions/complement/) and [symdiff](https://gohugo.io/functions/symdiff/). This release also continues the work on improving Hugo's error messages. And with `.Position` now available on shortcodes, you can also improve your own error messages inside your custom shortcodes:
```bash
{{ with .Get "name" }}
{{ else }}
{{ errorf "missing value for param 'name': %s" .Position }}
{{ end }}
```
When the above fails, you will see an `ERROR` log similar to the below:
```bash
ERROR 2018/11/07 10:05:55 missing value for param name: "/sites/hugoDocs/content/en/variables/shortcodes.md:32:1"
```
This release represents **31 contributions by 5 contributors** to the main Hugo code base.
[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@krisbudhram](https://github.com/krisbudhram), [@LorenzCK](https://github.com/LorenzCK), and [@coliff](https://github.com/coliff) for their ongoing contributions.
And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **6 contributions by 5 contributors**. A special thanks to [@ikemo3](https://github.com/ikemo3), [@maiki](https://github.com/maiki), [@morya](https://github.com/morya), and [@regisphilibert](https://github.com/regisphilibert) for their work on the documentation site.
Hugo now has:
* 30095+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 441+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 276+ [themes](http://themes.gohugo.io/)
## Notes
* Remove deprecated useModTimeAsFallback [0bc4b024](https://github.com/gohugoio/hugo/commit/0bc4b0246dd6b7d71f8676a52644077a4f70ec8f) [@bep](https://github.com/bep)
* Bump to ERROR for the deprecated Pages.Sort [faeb55c1](https://github.com/gohugoio/hugo/commit/faeb55c1d827f0ea994551a103ff4f7448786d39) [@bep](https://github.com/bep)
* Deprecate .Site.Ref and .Site.RelRef [6c6a6c87](https://github.com/gohugoio/hugo/commit/6c6a6c87ec2b5ac7342e268ab47861429230f7f4) [@bep](https://github.com/bep) [#5386](https://github.com/gohugoio/hugo/issues/5386)
## Enhancements
### Templates
* Properly handle pointer types in complement/symdiff [79a06aa4](https://github.com/gohugoio/hugo/commit/79a06aa4b64b526c242dfa41f2c7bc24e1352d5b) [@bep](https://github.com/bep)
* Add collections.SymDiff [488776b6](https://github.com/gohugoio/hugo/commit/488776b6498d1377718133d42daa87ce1236215d) [@bep](https://github.com/bep) [#5410](https://github.com/gohugoio/hugo/issues/5410)
* Add collections.Complement [42d8dfc8](https://github.com/gohugoio/hugo/commit/42d8dfc8c88af03ea926a59bc2332acc70cca5f6) [@bep](https://github.com/bep) [#5400](https://github.com/gohugoio/hugo/issues/5400)
### Core
* Improve error message on duplicate menu items [3a44920e](https://github.com/gohugoio/hugo/commit/3a44920e79ef86003555d8a4860c29257b2914f0) [@bep](https://github.com/bep)
* Add .Position to shortcode [33a7b36f](https://github.com/gohugoio/hugo/commit/33a7b36fd42ee31dd79115ec6639bed24247332f) [@bep](https://github.com/bep) [#5371](https://github.com/gohugoio/hugo/issues/5371)
### Other
* Document shortcode error handling [e456e34b](https://github.com/gohugoio/hugo/commit/e456e34bdbde058243eb0a5d3c0017748639e08e) [@bep](https://github.com/bep)
* Document symdiff [5d14d04a](https://github.com/gohugoio/hugo/commit/5d14d04ac678ad24e4946ed2a581ab71b3834def) [@bep](https://github.com/bep)
* Document complement [ddcb4028](https://github.com/gohugoio/hugo/commit/ddcb402859b50193bfd6d8b752b568d26d14f603) [@bep](https://github.com/bep)
* Update minify [d212f609](https://github.com/gohugoio/hugo/commit/d212f60949b6afefbe5aa79394f98dbddf7be068) [@bep](https://github.com/bep)
* Re-generate CLI docs [2998fa0c](https://github.com/gohugoio/hugo/commit/2998fa0cd5bad161b9c802d2409d8c9c81155011) [@bep](https://github.com/bep)
* Add --minify to hugo server [5b1edd28](https://github.com/gohugoio/hugo/commit/5b1edd281a493bdb27af4dc3c8fae7e10dd54830) [@bep](https://github.com/bep)
* Make WARN the new default log log level [4b7d3e57](https://github.com/gohugoio/hugo/commit/4b7d3e57a40214a1269eda59731aa22a8f4463dd) [@bep](https://github.com/bep) [#5203](https://github.com/gohugoio/hugo/issues/5203)
* Regenerate the docs helper [486bc46a](https://github.com/gohugoio/hugo/commit/486bc46a5217a9d70fe0d14ab9261d7b4eb026d6) [@bep](https://github.com/bep)
* Skip watcher event files if matched in ignoreFiles [f8446188](https://github.com/gohugoio/hugo/commit/f8446188dbec8378f34f0fea39161a49fcc46083) [@krisbudhram](https://github.com/krisbudhram)
* Update Chroma [d523aa4b](https://github.com/gohugoio/hugo/commit/d523aa4bb03e913f55c2f89544e6112e320c975a) [@bep](https://github.com/bep) [#5392](https://github.com/gohugoio/hugo/issues/5392)
* Add file (line/col) info to ref/relref errors [1d18eb05](https://github.com/gohugoio/hugo/commit/1d18eb0574a57c3e9f468659d076a666a3dd76f2) [@bep](https://github.com/bep) [#5371](https://github.com/gohugoio/hugo/issues/5371)
* Improve log color regexp [d3a98325](https://github.com/gohugoio/hugo/commit/d3a98325c31d7f02f0762e589a4986e55b2a0da2) [@bep](https://github.com/bep)
* Correct minor typo (#5372) [e65268f2](https://github.com/gohugoio/hugo/commit/e65268f2c2dd5ac54681d3266564901d99ed3ea3) [@coliff](https://github.com/coliff)
## Fixes
### Templates
* Fix the docshelper [61f210dd](https://github.com/gohugoio/hugo/commit/61f210dd7abe5de77c27dc6a6995a3ad5e77afa1) [@bep](https://github.com/bep)
* Fix BOM issue in templates [3a786a24](https://github.com/gohugoio/hugo/commit/3a786a248d3eff6e732aa94e87d6e88196e5147a) [@bep](https://github.com/bep) [#4895](https://github.com/gohugoio/hugo/issues/4895)
### Output
* Fix ANSI character output regression on Windows [b8725f51](https://github.com/gohugoio/hugo/commit/b8725f5181f6a2709274a82c1c3fdfd8f2e3e28c) [@LorenzCK](https://github.com/LorenzCK) [#5377](https://github.com/gohugoio/hugo/issues/5377)
### Core
* Fix changing paginators in lazy render [b8b8436f](https://github.com/gohugoio/hugo/commit/b8b8436fcca17c152e94cae2a1acad32efc3946c) [@bep](https://github.com/bep) [#5406](https://github.com/gohugoio/hugo/issues/5406)
* Fix REF_NOT_FOUND logging to include page path [6180c85f](https://github.com/gohugoio/hugo/commit/6180c85fb8f95e01446b74c50cab3f0480305fe4) [@bep](https://github.com/bep) [#5371](https://github.com/gohugoio/hugo/issues/5371)
* Fix broken manual summary handling [b2a676f5](https://github.com/gohugoio/hugo/commit/b2a676f5f09a3eea360887b099b9d5fc25a88492) [@bep](https://github.com/bep) [#5381](https://github.com/gohugoio/hugo/issues/5381)
* Fix deadlock when content building times out [729593c8](https://github.com/gohugoio/hugo/commit/729593c842794eaf7127050953a5c2256d332051) [@bep](https://github.com/bep) [#5375](https://github.com/gohugoio/hugo/issues/5375)
### Other
* Fix spelling [47506d16](https://github.com/gohugoio/hugo/commit/47506d164467eb7ddbcada81b767d8df5f9c8786) [@qeesung](https://github.com/qeesung)
* Fix shortcode directly following a shortcode delimiter [d16a7a33](https://github.com/gohugoio/hugo/commit/d16a7a33ff1f22b9fa357189a901a4f1de4e65e7) [@bep](https://github.com/bep) [#5402](https://github.com/gohugoio/hugo/issues/5402)
* Fix recently broken error template [2bd9d909](https://github.com/gohugoio/hugo/commit/2bd9d9099db267831731ed2d2200eb09305df9fc) [@bep](https://github.com/bep)

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

View file

@ -0,0 +1,79 @@
---
date: 2018-11-28
title: "And Now: Hugo 0.52"
description: "Configurable file caches, inline shortcodes, and more ..."
categories: ["Releases"]
---
The two big new items in this release is [Inline Shortcodes](https://gohugo.io//templates/shortcode-templates/#inline-shortcodes) and [Consolidated File Caches](https://gohugo.io/getting-started/configuration/#configure-file-caches). In Hugo we really care about build speed, and caching is important. With this release, you get much better control over your cache configuration, which is especially useful when building on a Continous Integration server (Netlify, CircleCI or similar). Inline Shortcodes was implemented to help the Bootstrap project [move their documentation site](https://github.com/twbs/bootstrap/issues/24475#issuecomment-441238128) to Hugo. Note that this feature is disabled by default. To enable, set `enableInlineShortcodes = true` in your site config. Worth mentioning is also the new `param` shortcode, which looks up the param in page front matter with the site's parameter as a fall back.
This release represents **33 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 [@moorereason](https://github.com/moorereason), [@emirb](https://github.com/emirb), and [@allizad](https://github.com/allizad) for their ongoing contributions.
And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **10 contributions by 4 contributors**. A special thanks to [@budparr](https://github.com/budparr), [@bep](https://github.com/bep), [@allizad](https://github.com/allizad), and [@funkydan2](https://github.com/funkydan2) for their work on the documentation site.
Hugo now has:
* 30595+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 441+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 270+ [themes](http://themes.gohugo.io/)
## Enhancements
### Templates
* Add tests [ed698e94](https://github.com/gohugoio/hugo/commit/ed698e94c12c05bfc392eaca4f0c8442eac64906) [@moorereason](https://github.com/moorereason)
* Regenerate templates [89e2716d](https://github.com/gohugoio/hugo/commit/89e2716d290708ccde0a6f65504c1650c2f41b3d) [@bep](https://github.com/bep)
* Add "param" shortcode [f37c5a25](https://github.com/gohugoio/hugo/commit/f37c5a25676db89c0e804ccaac69bb392758192b) [@bep](https://github.com/bep) [#4010](https://github.com/gohugoio/hugo/issues/4010)
* Add float64 support to where [112461fd](https://github.com/gohugoio/hugo/commit/112461fded0d7970817ce7bf476c4763922ad314) [@moorereason](https://github.com/moorereason) [#5466](https://github.com/gohugoio/hugo/issues/5466)
### Core
* Fall back to title in ByLinkTitle sort [a9a93d08](https://github.com/gohugoio/hugo/commit/a9a93d082d8640684b7fd0076c64ea808ea7f762) [@bep](https://github.com/bep) [#4953](https://github.com/gohugoio/hugo/issues/4953)
* Improve nil handling in IsDescendant and IsAncestor [b09a4033](https://github.com/gohugoio/hugo/commit/b09a40333f382cc1034d2eda856230258ab6b8cc) [@bep](https://github.com/bep) [#5461](https://github.com/gohugoio/hugo/issues/5461)
### Other
* Remove duplicate mapstructure depdendency [7e75aeca](https://github.com/gohugoio/hugo/commit/7e75aeca80aead50d64902d2ff47e4ad4d013352) [@bep](https://github.com/bep)
* Add dependency list to README [e14e0b19](https://github.com/gohugoio/hugo/commit/e14e0b192f39812e3c3d5202d34ee907021412bb) [@bep](https://github.com/bep)
* Document inline shortcodes [aded0f25](https://github.com/gohugoio/hugo/commit/aded0f25fd23a78804b10e127aebe0e4b6fed2ac) [@bep](https://github.com/bep) [#4011](https://github.com/gohugoio/hugo/issues/4011)
* Add inline shortcode support [bc337e6a](https://github.com/gohugoio/hugo/commit/bc337e6ab5a75f1f1bfe3a83f3786d0afdb6346c) [@bep](https://github.com/bep) [#4011](https://github.com/gohugoio/hugo/issues/4011)
* Include drafts in convert command [dcfeed35](https://github.com/gohugoio/hugo/commit/dcfeed35c6e14c1ce593d23be9d2b89c66ce9bee) [@bep](https://github.com/bep) [#5457](https://github.com/gohugoio/hugo/issues/5457)
* Handle themes in the new file cache (for images, assets) [f9b4eb4f](https://github.com/gohugoio/hugo/commit/f9b4eb4f3968d32f45e0168c854e6b0c7f3a90b0) [@bep](https://github.com/bep) [#5460](https://github.com/gohugoio/hugo/issues/5460)
* Add tests for permalink on Resource with baseURL with path [12742bac](https://github.com/gohugoio/hugo/commit/12742bac71c65d65dc56548b643debda94757aee) [@bep](https://github.com/bep) [#5226](https://github.com/gohugoio/hugo/issues/5226)
* Add a comment about file mode for new files [fabf026f](https://github.com/gohugoio/hugo/commit/fabf026f4937bf6fbbb944aa7d6e721839ae4c92) [@bep](https://github.com/bep) [#5434](https://github.com/gohugoio/hugo/issues/5434)
* Add a :project placeholder [94f0f7e5](https://github.com/gohugoio/hugo/commit/94f0f7e59788e802e706a55cac0d52a9e70ff745) [@bep](https://github.com/bep) [#5439](https://github.com/gohugoio/hugo/issues/5439)
* Add a cache prune func [3c29c5af](https://github.com/gohugoio/hugo/commit/3c29c5af8ee865ef20741f576088e031e940c3d2) [@bep](https://github.com/bep) [#5439](https://github.com/gohugoio/hugo/issues/5439)
* Add a filecache root dir [33502667](https://github.com/gohugoio/hugo/commit/33502667fbacf57167ede66df8f13e308a4a9aec) [@bep](https://github.com/bep)
* Use time.Duration for maxAge [d3489eba](https://github.com/gohugoio/hugo/commit/d3489eba5dfc0ecdc032016d9db0746213dd5f0e) [@bep](https://github.com/bep) [#5438](https://github.com/gohugoio/hugo/issues/5438)
* Split implementation and config into separate files [17d7ecde](https://github.com/gohugoio/hugo/commit/17d7ecde2b261d2ab29049d12361b66504e3f995) [@bep](https://github.com/bep)
* Update to LibSASS 3.5.5 [e4b25728](https://github.com/gohugoio/hugo/commit/e4b2572880550a997d51dab3b198dac1fd642690) [@bep](https://github.com/bep) [#5432](https://github.com/gohugoio/hugo/issues/5432)[#5435](https://github.com/gohugoio/hugo/issues/5435)
* More spelling corrections [782dd158](https://github.com/gohugoio/hugo/commit/782dd15858128d8dfe78970c86e543b6590a004c) [@bep](https://github.com/bep)
* Spelling corrections [aff9c091](https://github.com/gohugoio/hugo/commit/aff9c091669a022b59f493c9dccf72be29511299) [@bep](https://github.com/bep)
* Remove appveyor [fdd4a768](https://github.com/gohugoio/hugo/commit/fdd4a768f053b21271d4520bf0d43baf62d516da) [@bep](https://github.com/bep)
* Document the new file cache [abeeff13](https://github.com/gohugoio/hugo/commit/abeeff1325267f8d8f1f66f0ec4ed175ffc140ad) [@bep](https://github.com/bep) [#5404](https://github.com/gohugoio/hugo/issues/5404)
* Add a consolidated file cache [f7aeaa61](https://github.com/gohugoio/hugo/commit/f7aeaa61291dd75f92901bcbeecc7fce07a28dec) [@bep](https://github.com/bep) [#5404](https://github.com/gohugoio/hugo/issues/5404)
* Add Windows build config to Travis [7d78a2af](https://github.com/gohugoio/hugo/commit/7d78a2afd3c4a6c4af77a4ddcbd2a82f15986048) [@emirb](https://github.com/emirb)
* Add Elasticsearch/bonsai.io to services doc. [c0b3a1af](https://github.com/gohugoio/hugo/commit/c0b3a1af0354e3aa9979cc00ae8630d7f0be63dc) [@allizad](https://github.com/allizad)
## Fixes
### Templates
* Fix whitespace issue [aba2647c](https://github.com/gohugoio/hugo/commit/aba2647c152ffff927f42523b77ee6651630cd67) [@max-arnold](https://github.com/max-arnold)
* Fix test to pass with gccgo [a8cb1b07](https://github.com/gohugoio/hugo/commit/a8cb1b07b4cf7fcf0e949657cb03c1a4838f975e) [@ianlancetaylor](https://github.com/ianlancetaylor)
### Other
* Fix handling of commented out front matter [7540a628](https://github.com/gohugoio/hugo/commit/7540a62834d4465af8936967e430a9e05a1e1359) [@bep](https://github.com/bep) [#5478](https://github.com/gohugoio/hugo/issues/5478)
* Fix when only shortcode and then summary [94ab125b](https://github.com/gohugoio/hugo/commit/94ab125b27a29a65e5ea45efd99dd247084b4c37) [@bep](https://github.com/bep) [#5464](https://github.com/gohugoio/hugo/issues/5464)
* Fix ignored --config flag with 'new' command [e82b2dc8](https://github.com/gohugoio/hugo/commit/e82b2dc8c1628f2da33e5fb0bae1b03e0594ad2c) [@krisbudhram](https://github.com/krisbudhram)
* Fix Permalink for resource, baseURL with path and canonifyURLs set [5df2b79d](https://github.com/gohugoio/hugo/commit/5df2b79dd2734e9a00ed1692328f58c385676468) [@bep](https://github.com/bep) [#5226](https://github.com/gohugoio/hugo/issues/5226)

View file

@ -48,7 +48,7 @@ You can then call the shortcode as follows inside of your content's markup:
The above shortcode [is part of the code for the Hugo docs][dirindex]. Here it lists this site's CSS files:
{{< directoryindex path="/themes/gohugoioTheme/static/dist" pathURL="/css" >}}
{{< directoryindex path="/themes/gohugoioTheme/static" pathURL="/css" >}}
{{% note "Slashes are Important" %}}
The initial slash `/` in `pathURL` is important in the `directoryindex` shortcode. Otherwise, `pathURL` becomes relative to the current web page.

View file

@ -60,6 +60,10 @@ All partials are called within your templates using the following pattern:
One of the most common mistakes with new Hugo users is failing to pass a context to the partial call. In the pattern above, note how "the dot" (`.`) is required as the second argument to give the partial context. You can read more about "the dot" in the [Hugo templating introduction](/templates/introduction/).
{{% /note %}}
{{% note %}}
`<PARTIAL>` including `baseof` is reserved. ([#5373](https://github.com/gohugoio/hugo/issues/5373))
{{% /note %}}
As shown in the above example directory structure, you can nest your directories within `partials` for better source organization. You only need to call the nested partial's path relative to the `partials` directory:
```

View file

@ -30,7 +30,7 @@ Hugo's built-in shortcodes cover many common, but not all, use cases. Luckily, H
{{< youtube Eu4zSaKOY4A >}}
### File Placement
### File Location
To create a shortcode, place an HTML template in the `layouts/shortcodes` directory of your [source organization][]. Consider the file name carefully since the shortcode name will mirror that of the file but without the `.html` extension. For example, `layouts/shortcodes/myshortcode.html` will be called with either `{{</* myshortcode /*/>}}` or `{{%/* myshortcode /*/%}}` depending on the type of parameters you choose.
@ -346,10 +346,60 @@ This will output the following HTML. Note how the first two `img` shortcodes inh
<img src="/images/three.jpg">
```
## Error Handling in Shortcodes
Use the [errorf](/functions/errorf) template func and [.Position](/variables/shortcodes/) variable to get useful error messages in shortcodes:
```bash
{{ with .Get "name" }}
{{ else }}
{{ errorf "missing value for param 'name': %s" .Position }}
{{ end }}
```
When the above fails, you will see an `ERROR` log similar to the below:
```bash
ERROR 2018/11/07 10:05:55 missing value for param name: "/Users/bep/dev/go/gohugoio/hugo/docs/content/en/variables/shortcodes.md:32:1"
```
## More Shortcode Examples
More shortcode examples can be found in the [shortcodes directory for spf13.com][spfscs] and the [shortcodes directory for the Hugo docs][docsshortcodes].
## Inline Shortcodes
Since Hugo 0.52, you can implement your shortcodes inline -- e.g. where you use them in the content file. This can be useful for scripting that you only need in one place.
This feature is disabled by default, but can be enabled in your site config:
{{< code-toggle file="config">}}
enableInlineShortcodes = true
{{< /code-toggle >}}
It is disabled by default for security reasons. The security model used by Hugo's template handling assumes that template authors are trusted, but that the content files are not, so the templates are injection-safe from malformed input data. But in most situations you have full control over the content, too, and then `enableInlineShortcodes = true` would be considered safe. But it's something to be aware of: It allows ad-hoc [Go Text templates](https://golang.org/pkg/text/template/) to be executed from the content files.
And once enabled, you can do this in your content files:
```go-text-template
{{</* time.inline */>}}{{ now }}{{</* /time.inline */>}}
```
The above will print the current date and time.
Note that an inline shortcode's inner content is parsed and executed as a Go text template with the same context as a regular shortcode template.
This means that the current page can be accessed via `.Page.Title` etc. This also means that there are no concept of "nested inline shortcodes".
The same inline shortcode can be reused later in the same content file, with different params if needed, using the self-closing syntax:
```go-text-template
{{</* time.inline /*/>}}
```
[basic content files]: /content-management/formats/ "See how Hugo leverages markdown--and other supported formats--to create content for your website."
[built-in shortcode]: /content-management/shortcodes/
[config]: /getting-started/configuration/ "Learn more about Hugo's built-in configuration variables as well as how to us your site's configuration file to include global key-values that can be used throughout your rendered website."

View file

@ -19,8 +19,8 @@ toc: true
wip: true
---
{{% warning "Use Relative Links" %}}
If you're creating a theme with plans to share it with the community, use relative URLs since users of your theme may not publish from the root of their website. See [relURL](/functions/relurl) and [absURL](/functions/absurl).
{{% warning "Use Absolute Links" %}}
If you're creating a theme with plans to share it on the [Hugo Themes website](https://themes.gohugo.io/) please note that your theme's demo will be available in a sub-directory of website and for the theme's assets to load properly you will need to create absolute paths in the templates by using either the [absURL](/functions/absurl) function or `.Permalink`. Also make sure not to use a forward slash `/` in the beginning of a `PATH`, because Hugo will turn it into a relative URL and the `absURL` function will have no effect.
{{% /warning %}}
Hugo can initialize a new blank theme directory within your existing `themes` using the `hugo new` command:

View file

@ -30,3 +30,4 @@ A static website with a dynamic search function? Yes. As alternatives to embedda
## Commercial Search Services
* [Algolia](https://www.algolia.com/)'s Search API makes it easy to deliver a great search experience in your apps and websites. Algolia Search provides hosted full-text, numerical, faceted, and geolocalized search.
* [Bonsai](https://www.bonsai.io) is a fully-managed hosted Elasticsearch service that is fast, reliable, and simple to set up. Easily ingest your docs from Hugo into Elasticsearch following [this guide from the docs](https://docs.bonsai.io/docs/hugo).

View file

@ -33,9 +33,13 @@ The `.File` object contains the following fields:
.File.TranslationBaseName
: the filename without extension or optional language identifier (e.g., `foo`)
.File.ContentBaseName
: is a either TranslationBaseName or name of containing folder if file is a leaf bundle.
.File.BaseFileName
: the filename without extension (e.g., `foo.en`)
.File.Ext
: the file extension of the content file (e.g., `md`); this can also be called using `.File.Extension` as well. Note that it is *only* the extension without `.`.
@ -45,4 +49,4 @@ The `.File` object contains the following fields:
.File.Dir
: given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned (e.g., `posts/dir1/dir2/`)
[Multilingual]: /content-management/multilingual/
[Multilingual]: /content-management/multilingual/

View file

@ -156,6 +156,12 @@ http://remarkjs.com)
.Site
: see [Site Variables](/variables/site/).
.Sites
: returns all sites (languages). A typical use case would be to link back to the main language: `<a href="{{ .Sites.First.Home.RelPermalink }}">...</a>`.
.Sites.First
: returns the site for the first language. If this is not a multilingual setup, it will return itself.
.Summary
: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <code>&lt;!&#x2d;&#x2d;more&#x2d;&#x2d;&gt;</code> at the appropriate place in the content page. See [Content Summaries](/content-management/summaries/) for more details.

View file

@ -26,6 +26,12 @@ toc: false
.Parent
: provides access to the parent shortcode context in nested shortcodes. This can be very useful for inheritance of common shortcode parameters from the root.
.Position
: Contains [filename and position](https://godoc.org/github.com/gohugoio/hugo/common/text#Position) for the shortcode in a page. Note that this can be relatively expensive to calculate, and is meant for error reporting. See [Error Handling in Shortcodes](/templates/shortcode-templates/#error-handling-in-shortcodes).
.IsNamedParams
: boolean that returns `true` when the shortcode in question uses [named rather than positional parameters][shortcodes]

View file

@ -81,6 +81,13 @@
"bnf"
]
},
{
"Name": "Ballerina",
"Aliases": [
"bal",
"ballerina"
]
},
{
"Name": "Base Makefile",
"Aliases": [
@ -208,6 +215,13 @@
"capnp"
]
},
{
"Name": "Cassandra CQL",
"Aliases": [
"cassandra",
"cql"
]
},
{
"Name": "Ceylon",
"Aliases": [
@ -525,6 +539,7 @@
"Aliases": [
"cfg",
"dosini",
"gitconfig",
"inf",
"ini"
]
@ -576,6 +591,12 @@
"julia"
]
},
{
"Name": "Jungle",
"Aliases": [
"jungle"
]
},
{
"Name": "Kotlin",
"Aliases": [
@ -651,6 +672,13 @@
"modula2"
]
},
{
"Name": "MonkeyC",
"Aliases": [
"mc",
"monkeyc"
]
},
{
"Name": "MorrowindScript",
"Aliases": [
@ -736,6 +764,20 @@
"octave"
]
},
{
"Name": "OpenSCAD",
"Aliases": [
"openscad",
"scad"
]
},
{
"Name": "Org Mode",
"Aliases": [
"org",
"orgmode"
]
},
{
"Name": "PHP",
"Aliases": [
@ -940,6 +982,13 @@
"sql"
]
},
{
"Name": "SYSTEMD",
"Aliases": [
"service",
"systemd"
]
},
{
"Name": "Sass",
"Aliases": [
@ -1076,6 +1125,13 @@
"thrift"
]
},
{
"Name": "TradingView",
"Aliases": [
"tradingview",
"tv"
]
},
{
"Name": "Transact-SQL",
"Aliases": [
@ -1232,90 +1288,148 @@
"types": [
{
"type": "application/javascript",
"string": "application/javascript+js",
"string": "application/javascript",
"mainType": "application",
"subType": "javascript",
"suffix": "js",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"js"
]
},
{
"type": "application/json",
"string": "application/json+json",
"string": "application/json",
"mainType": "application",
"subType": "json",
"suffix": "json",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"json"
]
},
{
"type": "application/rss",
"type": "application/octet-stream",
"string": "application/octet-stream",
"mainType": "application",
"subType": "octet-stream",
"delimiter": "",
"suffixes": null
},
{
"type": "application/rss+xml",
"string": "application/rss+xml",
"mainType": "application",
"subType": "rss",
"suffix": "xml",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"xml"
]
},
{
"type": "application/xml",
"string": "application/xml+xml",
"string": "application/xml",
"mainType": "application",
"subType": "xml",
"suffix": "xml",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"xml"
]
},
{
"type": "image/svg+xml",
"string": "image/svg+xml",
"mainType": "image",
"subType": "svg",
"delimiter": ".",
"suffixes": [
"svg"
]
},
{
"type": "text/calendar",
"string": "text/calendar+ics",
"string": "text/calendar",
"mainType": "text",
"subType": "calendar",
"suffix": "ics",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"ics"
]
},
{
"type": "text/css",
"string": "text/css+css",
"string": "text/css",
"mainType": "text",
"subType": "css",
"suffix": "css",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"css"
]
},
{
"type": "text/csv",
"string": "text/csv+csv",
"string": "text/csv",
"mainType": "text",
"subType": "csv",
"suffix": "csv",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"csv"
]
},
{
"type": "text/html",
"string": "text/html+html",
"string": "text/html",
"mainType": "text",
"subType": "html",
"suffix": "html",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"html"
]
},
{
"type": "text/plain",
"string": "text/plain+txt",
"string": "text/plain",
"mainType": "text",
"subType": "plain",
"suffix": "txt",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"txt"
]
},
{
"type": "text/x-sass",
"string": "text/x-sass",
"mainType": "text",
"subType": "x-sass",
"delimiter": ".",
"suffixes": [
"sass"
]
},
{
"type": "text/x-scss",
"string": "text/x-scss",
"mainType": "text",
"subType": "x-scss",
"delimiter": ".",
"suffixes": [
"scss"
]
}
]
},
"output": {
"formats": [
{
"MediaType": "text/html+html",
"MediaType": "text/html",
"name": "AMP",
"mediaType": {
"type": "text/html",
"string": "text/html+html",
"string": "text/html",
"mainType": "text",
"subType": "html",
"suffix": "html",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"html"
]
},
"path": "amp",
"baseName": "index",
@ -1327,15 +1441,17 @@
"notAlternative": false
},
{
"MediaType": "text/css+css",
"MediaType": "text/css",
"name": "CSS",
"mediaType": {
"type": "text/css",
"string": "text/css+css",
"string": "text/css",
"mainType": "text",
"subType": "css",
"suffix": "css",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"css"
]
},
"path": "",
"baseName": "styles",
@ -1347,15 +1463,17 @@
"notAlternative": true
},
{
"MediaType": "text/csv+csv",
"MediaType": "text/csv",
"name": "CSV",
"mediaType": {
"type": "text/csv",
"string": "text/csv+csv",
"string": "text/csv",
"mainType": "text",
"subType": "csv",
"suffix": "csv",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"csv"
]
},
"path": "",
"baseName": "index",
@ -1367,15 +1485,17 @@
"notAlternative": false
},
{
"MediaType": "text/calendar+ics",
"MediaType": "text/calendar",
"name": "Calendar",
"mediaType": {
"type": "text/calendar",
"string": "text/calendar+ics",
"string": "text/calendar",
"mainType": "text",
"subType": "calendar",
"suffix": "ics",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"ics"
]
},
"path": "",
"baseName": "index",
@ -1387,15 +1507,17 @@
"notAlternative": false
},
{
"MediaType": "text/html+html",
"MediaType": "text/html",
"name": "HTML",
"mediaType": {
"type": "text/html",
"string": "text/html+html",
"string": "text/html",
"mainType": "text",
"subType": "html",
"suffix": "html",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"html"
]
},
"path": "",
"baseName": "index",
@ -1407,15 +1529,17 @@
"notAlternative": false
},
{
"MediaType": "application/json+json",
"MediaType": "application/json",
"name": "JSON",
"mediaType": {
"type": "application/json",
"string": "application/json+json",
"string": "application/json",
"mainType": "application",
"subType": "json",
"suffix": "json",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"json"
]
},
"path": "",
"baseName": "index",
@ -1427,15 +1551,17 @@
"notAlternative": false
},
{
"MediaType": "text/plain+txt",
"MediaType": "text/plain",
"name": "ROBOTS",
"mediaType": {
"type": "text/plain",
"string": "text/plain+txt",
"string": "text/plain",
"mainType": "text",
"subType": "plain",
"suffix": "txt",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"txt"
]
},
"path": "",
"baseName": "robots",
@ -1450,12 +1576,14 @@
"MediaType": "application/rss+xml",
"name": "RSS",
"mediaType": {
"type": "application/rss",
"type": "application/rss+xml",
"string": "application/rss+xml",
"mainType": "application",
"subType": "rss",
"suffix": "xml",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"xml"
]
},
"path": "",
"baseName": "index",
@ -1467,15 +1595,17 @@
"notAlternative": false
},
{
"MediaType": "application/xml+xml",
"MediaType": "application/xml",
"name": "Sitemap",
"mediaType": {
"type": "application/xml",
"string": "application/xml+xml",
"string": "application/xml",
"mainType": "application",
"subType": "xml",
"suffix": "xml",
"delimiter": "."
"delimiter": ".",
"suffixes": [
"xml"
]
},
"path": "",
"baseName": "sitemap",
@ -2119,6 +2249,16 @@
],
"Examples": []
},
"Append": {
"Description": "Append appends the arguments up to the last one to the slice in the last argument.\nThis construct allows template constructs like this:\n {{ $pages = $pages | append $p2 $p1 }}\nNote that with 2 arguments where both are slices of the same type,\nthe first slice will be appended to the second:\n {{ $pages = $pages | append .Site.RegularPages }}",
"Args": [
"args"
],
"Aliases": [
"append"
],
"Examples": []
},
"Apply": {
"Description": "Apply takes a map, array, or slice and returns a new slice with the function fname applied over it.",
"Args": [
@ -2185,6 +2325,17 @@
],
"Examples": []
},
"Group": {
"Description": "Group groups a set of elements by the given key.\nThis is currently only supported for Pages.",
"Args": [
"key",
"items"
],
"Aliases": [
"group"
],
"Examples": []
},
"In": {
"Description": "In returns whether v is in the set l. l may be an array or slice.",
"Args": [
@ -2262,6 +2413,19 @@
],
"Examples": []
},
"NewScratch": {
"Description": "NewScratch creates a new Scratch which can be used to store values in a\nthread safe way.",
"Args": null,
"Aliases": [
"newScratch"
],
"Examples": [
[
"{{ $scratch := newScratch }}{{ $scratch.Add \"b\" 2 }}{{ $scratch.Add \"b\" 2 }}{{ $scratch.Get \"b\" }}",
"4"
]
]
},
"Querify": {
"Description": "Querify encodes the given parameters in URL-encoded form (\"bar=baz\u0026foo=quux\") sorted by key.",
"Args": [
@ -2486,7 +2650,7 @@
]
},
"Jsonify": {
"Description": "Jsonify encodes a given object to JSON.",
"Description": "Jsonify encodes a given object to JSON, returning pretty printed output.",
"Args": [
"v"
],
@ -2496,14 +2660,14 @@
"Examples": [
[
"{{ (slice \"A\" \"B\" \"C\") | jsonify }}",
"[\"A\",\"B\",\"C\"]"
"[\n \"A\",\n \"B\",\n \"C\"\n]"
]
]
}
},
"fmt": {
"Errorf": {
"Description": "",
"Description": "Errorf formats according to a format specifier and returns the string as a\nvalue that satisfies error.",
"Args": [
"format",
"a"
@ -2675,7 +2839,7 @@
]
},
"Translate": {
"Description": "Translate ...",
"Description": "Translate returns a translated string for id.",
"Args": [
"id",
"args"
@ -2838,19 +3002,6 @@
}
},
"os": {
"Stat": {
"Description": "Stat returns a file infomation under the given path.",
"Args": [
"i"
],
"Aliases": null,
"Examples": [
[
"{{ (os.Stat \"foo.txt\").Name }}",
"foo.txt"
]
]
},
"FileExists": {
"Description": "FileExists checks whether a file exists under the given path.",
"Args": [
@ -2886,7 +3037,7 @@
],
"Examples": [
[
"{{ range (readDir \".\") }}{{ .Name }}{{ end }}",
"{{ range (readDir \"files\") }}{{ .Name }}{{ end }}",
"README.txt"
]
]
@ -2901,10 +3052,16 @@
],
"Examples": [
[
"{{ readFile \"README.txt\" }}",
"{{ readFile \"files/README.txt\" }}",
"Hugo Rocks!"
]
]
},
"Stat": {
"Description": "",
"Args": null,
"Aliases": null,
"Examples": null
}
},
"partials": {
@ -3003,6 +3160,74 @@
]
}
},
"resources": {
"Concat": {
"Description": "",
"Args": null,
"Aliases": null,
"Examples": null
},
"ExecuteAsTemplate": {
"Description": "",
"Args": null,
"Aliases": null,
"Examples": null
},
"Fingerprint": {
"Description": "Fingerprint transforms the given Resource with a MD5 hash of the content in\nthe RelPermalink and Permalink.",
"Args": [
"args"
],
"Aliases": [
"fingerprint"
],
"Examples": []
},
"FromString": {
"Description": "",
"Args": null,
"Aliases": null,
"Examples": null
},
"Get": {
"Description": "Get locates the filename given in Hugo's filesystems: static, assets and content (in that order)\nand creates a Resource object that can be used for further transformations.",
"Args": [
"filename"
],
"Aliases": null,
"Examples": []
},
"Minify": {
"Description": "Minify minifies the given Resource using the MediaType to pick the correct\nminifier.",
"Args": [
"r"
],
"Aliases": [
"minify"
],
"Examples": []
},
"PostCSS": {
"Description": "PostCSS processes the given Resource with PostCSS",
"Args": [
"args"
],
"Aliases": [
"postCSS"
],
"Examples": []
},
"ToCSS": {
"Description": "ToCSS converts the given Resource to CSS. You can optional provide an Options\nobject or a target path (string) as first argument.",
"Args": [
"args"
],
"Aliases": [
"toCSS"
],
"Examples": []
}
},
"safe": {
"CSS": {
"Description": "CSS returns a given string as html/template CSS content.",
@ -3165,6 +3390,19 @@
]
]
},
"FirstUpper": {
"Description": "FirstUpper returns a string with the first character as upper case.",
"Args": [
"s"
],
"Aliases": null,
"Examples": [
[
"{{ \"hugo rocks!\" | strings.FirstUpper }}",
"Hugo rocks!"
]
]
},
"HasPrefix": {
"Description": "HasPrefix tests whether the input s begins with prefix.",
"Args": [
@ -3443,6 +3681,25 @@
]
}
},
"templates": {
"Exists": {
"Description": "Exists returns whether the template with the given name exists.\nNote that this is the Unix-styled relative path including filename suffix,\ne.g. partials/header.html",
"Args": [
"name"
],
"Aliases": null,
"Examples": [
[
"{{ if (templates.Exists \"partials/header.html\") }}Yes!{{ end }}",
"Yes!"
],
[
"{{ if not (templates.Exists \"partials/doesnotexist.html\") }}No!{{ end }}",
"No!"
]
]
}
},
"time": {
"AsTime": {
"Description": "AsTime converts the textual representation of the datetime string into\na time.Time interface.",
@ -3680,7 +3937,7 @@
"Description": "Ref returns the absolute URL path to a given content item.",
"Args": [
"in",
"refs"
"args"
],
"Aliases": [
"ref"
@ -3701,7 +3958,7 @@
"Description": "RelRef returns the relative URL path to a given content item.",
"Args": [
"in",
"refs"
"args"
],
"Aliases": [
"relref"

View file

@ -1,30 +1,30 @@
[build]
publish = "public"
command = "hugo"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.49.2"
HUGO_VERSION = "0.52"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.split1]
command = "hugo --enableGitInfo"
command = "hugo --gc --minify --enableGitInfo"
[context.split1.environment]
HUGO_VERSION = "0.49.2"
HUGO_VERSION = "0.52"
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --buildFuture -b $DEPLOY_PRIME_URL"
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.49.2"
HUGO_VERSION = "0.52"
[context.branch-deploy]
command = "hugo -b $DEPLOY_PRIME_URL"
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
HUGO_VERSION = "0.49.2"
HUGO_VERSION = "0.52"
[context.next.environment]
HUGO_ENABLEGITINFO = "true"

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"Target":"output/css/app.min.3d04cd530b6fbca129e24fb79af6692fa64cad11185196c7a800e58b4b3e2f97.css","MediaType":"text/css","Data":{"Integrity":"sha256-PQTNUwtvvKEp4k+3mvZpL6ZMrREYUZbHqADli0s+L5c="}}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"Target":"output/js/app.09ca7921ca2b6e15c2dc516eccf642c08861fe5c249cc9073fb370c0a8a9022c.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-Ccp5IcorbhXC3FFuzPZCwIhh/lwknMkHP7NwwKipAiw="}}

View file

@ -4,4 +4,40 @@ Theme for gohugo.io sites:
* [https://gohugo.io/](https://gohugo.io/)
* [https://themes.gohugo.io/](https://themes.gohugo.io/)
More info to come.
## Tools
### NPM
We use [NPM](https://www.npmjs.com/) for package management The theme's `.gitignore` file should be kept intact to make sure that all files in the `node_modules` folder are not pushed to the repository.
### Webpack 4+
We use Webpack to manage our asset pipeline. Arguably, Webpack is overkill for this use-case, but we're using it here because once it's set up (which we've done for you), it's really easy to use. If you want to use an external script, just add it via Yarn, and reference it in main.js. You'll find instructions in the js/main.js file.
### PostCSS
PostCSS is just CSS. You'll find `postcss.config.js` in the Webpack.config.js file. There you'll find that we're using [`postcss-import`](https://github.com/postcss/postcss-import) which allows us import css files directly from the node_modules folder, [`postcss-cssnext`](http://cssnext.io/features/) which gives us the power to use upcoming CSS features today. If you miss Sass you can find PostCss modules for those capabilities, too.
### Tachyons
This theme uses the [Tachyons CSS Library](http://tachyons.io/). It's about 15kb gzipped, highly modular, and each class is atomic so you never have to worry about overwriting your styles. It's a great library for themes because you can make most all the style changes you need right in your layouts.
## How to Use
You'll find the commands to run in `package.json`.
For development, you'll need Node with NPM installed:
```
$ npm install
$ npm start
```
This will process both postcss, fonts, and scripts.
For production, instead of `npm start`, run `npm run build,` which will output smaller versions of your files.

View file

@ -1,15 +1,10 @@
/*Base Styles*/
@import '_tachyons';
/*type*/
@import 'font/_muli-200';
@import 'font/_muli-400';
@import 'font/_muli-800';
/* purgecss start ignore */
@import '_anchorforid';
@import '_animation';
@import '_documentation-styles';
@import '_algolia';
@import '_carousel';
@import '_code';
@ -21,7 +16,6 @@
@import '_definition-lists';
@import '_fluid-type';
@import '_font-family';
/*@import '_hljs';*/
@import '_hugo-internal-template-styling';
@import '_no-js';
@import '_social-icons';
@ -41,3 +35,4 @@
.mw-90 {
max-width:90%;
}
/* purgecss end ignore */

Some files were not shown because too many files have changed in this diff Show more