diff --git a/.cspell.json b/.cspell.json index 1fcd48fa0..e544b2649 100644 --- a/.cspell.json +++ b/.cspell.json @@ -114,6 +114,7 @@ "govendor", "Gowans", "Grayscale", + "Gregor", "Gruber", "gtag", "gvfs", diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 918607f4d..3f4cf44c7 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -18,7 +18,6 @@ MD034: false MD036: false MD037: false MD038: false -MD040: false MD041: false MD046: false MD049: false diff --git a/.markdownlintignore b/.markdownlintignore index 43e5b1b1b..4ac45b395 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,4 +1,5 @@ **/commands/** +**/functions/** **/news/** **/showcase/** **/zh/** diff --git a/content/en/about/security-model/index.md b/content/en/about/security-model/index.md index 497685cb4..c46c57eae 100644 --- a/content/en/about/security-model/index.md +++ b/content/en/about/security-model/index.md @@ -10,7 +10,6 @@ menu: weight: 4 weight: 5 sections_weight: 5 -draft: false aliases: [/security/] toc: true --- @@ -40,7 +39,7 @@ The default configuration is listed below. Any build using features not in the a Note that these and other config settings in Hugo can be overridden by the OS environment. If you want to block all remote HTTP fetching of data: -``` +```txt HUGO_SECURITY_HTTP_URLS=none hugo ``` diff --git a/content/en/content-management/comments.md b/content/en/content-management/comments.md index 46d30b140..ee8081d01 100644 --- a/content/en/content-management/comments.md +++ b/content/en/content-management/comments.md @@ -42,7 +42,7 @@ For many websites, this is enough configuration. However, you also have the opti Disqus has its own [internal template](https://gohugo.io/templates/internal/#disqus) available, to render it add the following code where you want comments to appear: -``` +```go-html-template {{ template "_internal/disqus.html" . }} ``` diff --git a/content/en/content-management/diagrams.md b/content/en/content-management/diagrams.md index 5c247e569..18ee92f6e 100644 --- a/content/en/content-management/diagrams.md +++ b/content/en/content-management/diagrams.md @@ -19,7 +19,7 @@ toc: true Hugo! supports [GoAT](https://github.com/bep/goat) natively. This means that this code block: -```` +````txt ```goat . . . .--- 1 .-- 1 / 1 / \ | | .---+ .-+ + diff --git a/content/en/content-management/formats.md b/content/en/content-management/formats.md index 89c209a61..7440f90b3 100644 --- a/content/en/content-management/formats.md +++ b/content/en/content-management/formats.md @@ -100,7 +100,7 @@ Notice that for security concerns only extensions that do not have path separato Example of how to set extensions and attributes: -``` +```yml [markup.asciidocExt] extensions = ["asciidoctor-html5s", "asciidoctor-diagram"] workingFolderCurrent = true @@ -112,7 +112,7 @@ Example of how to set extensions and attributes: In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all parameters. Run Hugo with `-v`. You will get an output like -``` +```txt INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ... ``` diff --git a/content/en/content-management/organization/index.md b/content/en/content-management/organization/index.md index 10e22c2d3..796472ce7 100644 --- a/content/en/content-management/organization/index.md +++ b/content/en/content-management/organization/index.md @@ -4,7 +4,6 @@ linktitle: Organization description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-01 categories: [content management,fundamentals] keywords: [sections,content,organization,bundle,resources] menu: @@ -12,7 +11,6 @@ menu: parent: "content-management" weight: 10 weight: 10 #rem -draft: false aliases: [/content/sections/] toc: true --- @@ -35,14 +33,13 @@ The bundle documentation is a **work in progress**. We will publish more compreh ## Organization of Content Source - In Hugo, your content should be organized in a manner that reflects the rendered website. While Hugo supports content nested at any level, the top levels (i.e. `content/`) are special in Hugo and are considered the content type used to determine layouts etc. To read more about sections, including how to nest them, see [sections][]. Without any additional configuration, the following will automatically work: -``` +```txt . └── content └── about @@ -73,7 +70,7 @@ The following demonstrates the relationships between your content organization a You can create one `_index.md` for your homepage and one in each of your content sections, taxonomies, and taxonomy terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website: -``` +```txt . url . ⊢--^-⊣ . path slug @@ -85,7 +82,7 @@ content/posts/_index.md At build, this will output to the following destination with the associated values: -``` +```txt url ("/posts/") ⊢-^-⊣ @@ -104,7 +101,7 @@ The [sections] can be nested as deeply as you want. The important thing to under Single content files in each of your sections will be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`: -``` +```txt path ("posts/my-first-hugo-post.md") . ⊢-----------^------------⊣ . section slug @@ -114,7 +111,7 @@ content/posts/my-first-hugo-post.md When Hugo builds your site, the content will be output to the following destination: -``` +```txt url ("/posts/my-first-hugo-post/") ⊢------------^----------⊣ @@ -180,7 +177,7 @@ slug: "new-post" This will render to the following destination according to Hugo's default behavior: -``` +```txt example.com/posts/new-post/ ``` @@ -217,7 +214,7 @@ url: /blog/new-url/ Assuming your `baseURL` is [configured][config] to `https://example.com`, the addition of `url` to the front matter will make `old-url.md` render to the following destination: -``` +```txt https://example.com/blog/new-url/ ``` diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md index c694fc409..fe2a3d469 100644 --- a/content/en/content-management/page-resources.md +++ b/content/en/content-management/page-resources.md @@ -94,13 +94,13 @@ MediaType.Suffixes ByType : Returns the page resources of the given type. -```go +```go-html-template {{ .Resources.ByType "image" }} ``` Match : Returns all the page resources (as a slice) whose `Name` matches the given Glob pattern ([examples](https://github.com/gobwas/glob/blob/master/readme.md)). The matching is case-insensitive. -```go +```go-html-template {{ .Resources.Match "images/*" }} ``` diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index 10dc50336..08e3560bc 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -40,7 +40,7 @@ Here is the list of "Related" methods available on a page collection such `.Regu Returns a collection of pages related the given one. -``` +```go-html-template {{ $related := site.RegularPages.Related . }} ``` @@ -48,7 +48,7 @@ Returns a collection of pages related the given one. Returns a collection of pages related to a given one restricted to a list of indices. -``` +```go-html-template {{ $related := site.RegularPages.RelatedIndices . "tags" "date" }} ``` @@ -58,7 +58,7 @@ Returns a collection of pages related together by a set of indices and their mat In order to build those set and pass them as argument, one must use the `keyVals` function where the first argument would be the `indice` and the consecutive ones its potential `matches`. -``` +```go-html-template {{ $related := site.RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }} ``` diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index 88d6c3a0e..6b8a1e9ce 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -40,11 +40,11 @@ Some shortcodes use or require closing shortcodes. Again like HTML, the opening Here are two examples of paired shortcodes: -``` +```go-html-template {{%/* mdshortcode */%}}Stuff to `process` in the *center*.{{%/* /mdshortcode */%}} ``` -``` +```go-html-template {{}} A bunch of code here {{}} ``` @@ -56,7 +56,7 @@ The examples above use two different delimiters, the difference being the `%` ch You can pass multiple lines as parameters to a shortcode by using raw string literals: -``` +```go-html-template {{HTML, and a new line with a "quoted string".` */>}} ``` @@ -67,7 +67,7 @@ In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` If you want the old behavior, you can put the following line in the start of your shortcode template: -``` +```go-html-template {{ $_hugo_config := `{ "version": 1 }` }} ``` @@ -75,7 +75,7 @@ If you want the old behavior, you can put the following line in the start of you The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without Markdown include internal HTML: -``` +```go-html-template {{}}

Hello World!

{{}} ``` @@ -150,13 +150,13 @@ attrlink Bloggers often want to include GitHub gists when writing posts. Let's suppose we want to use the [gist at the following url][examplegist]: -``` +```txt https://gist.github.com/spf13/7896402 ``` We can embed the gist in our content via username and gist ID pulled from the URL: -``` +```go-html-template {{}} ``` @@ -222,7 +222,7 @@ To see even more options for adding syntax-highlighted code blocks to your websi If you'd like to embed a photo from [Instagram][], you only need the photo's ID. You can discern an Instagram photo ID from the URL: -``` +```txt https://www.instagram.com/p/BWNjjyYFxVx/ ``` @@ -289,7 +289,7 @@ Read a more extensive description of `ref` and `relref` in the [cross references #### Example `ref` and `relref` Input -``` +```go-html-template [Neat]({{}}) [Who]({{}}) ``` @@ -298,7 +298,7 @@ Read a more extensive description of `ref` and `relref` in the [cross references Assuming that standard Hugo pretty URLs are turned on. -``` +```html Neat Who ``` @@ -307,7 +307,7 @@ Assuming that standard Hugo pretty URLs are turned on. You want to include a single tweet into your blog post? Everything you need is the URL of the tweet: -``` +```txt https://twitter.com/SanDiegoZoo/status/1453110110599868418 ``` @@ -337,7 +337,7 @@ Using the preceding `tweet` example, the following simulates the displayed exper Adding a video from [Vimeo][] is equivalent to the [YouTube Input shortcode][]. -``` +```txt https://vimeo.com/channels/staffpicks/146022717 ``` @@ -360,7 +360,7 @@ Using the preceding `vimeo` example, the following HTML will be added to your re {{% tip %}} If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `
` that wraps the `