summaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-05-31 12:43:33 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-05-31 12:43:33 +0200
commit626b16e0240f9f106ba89af58bfd15b48e4e644f (patch)
tree702ccf24300127cd24e0916db2bfa2037bb74b1a /docs/content
parent2919a6a503f7b369154d6eb787023a1fe58a9ad4 (diff)
parent9e1dcefc5f559944b70d2fa520f6acd5c56a69f2 (diff)
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/en/content-management/comments.md2
-rw-r--r--docs/content/en/content-management/image-processing/index.md5
-rw-r--r--docs/content/en/content-management/syntax-highlighting.md7
-rw-r--r--docs/content/en/content-management/urls.md7
-rw-r--r--docs/content/en/getting-started/configuration-markup.md51
-rw-r--r--docs/content/en/hugo-modules/use-modules.md13
-rw-r--r--docs/content/en/news/0.71.0-relnotes/hugo-71-featured.pngbin0 -> 209832 bytes
-rw-r--r--docs/content/en/news/0.71.0-relnotes/index.md9
-rw-r--r--docs/content/en/news/0.71.1-relnotes/index.md2
-rw-r--r--docs/content/en/readfiles/pages-vs-site-pages.md6
-rw-r--r--docs/content/en/templates/rss.md2
-rw-r--r--docs/content/en/tools/migrations.md2
-rw-r--r--docs/content/en/tools/search.md1
-rw-r--r--docs/content/en/variables/site.md4
14 files changed, 91 insertions, 20 deletions
diff --git a/docs/content/en/content-management/comments.md b/docs/content/en/content-management/comments.md
index a64108072..d7a467d10 100644
--- a/docs/content/en/content-management/comments.md
+++ b/docs/content/en/content-management/comments.md
@@ -61,7 +61,7 @@ There are a few alternatives to commenting on static sites for those who do not
* [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues)
* [Remark](https://github.com/umputun/remark) (Open source, Golang, Easy to run docker)
* [Commento](https://commento.io/) (Open Source, available as a service, local install, or docker image)
-* [JustComments](https://just-comments.com) (Open Source, available as a service, can be self-hosted)
+* [Hyvor Talk](https://talk.hyvor.com/) (Available as a service)
[configuration]: /getting-started/configuration/
diff --git a/docs/content/en/content-management/image-processing/index.md b/docs/content/en/content-management/image-processing/index.md
index e0e0c77cb..075953093 100644
--- a/docs/content/en/content-management/image-processing/index.md
+++ b/docs/content/en/content-management/image-processing/index.md
@@ -180,7 +180,10 @@ Rotates an image by the given angle counter-clockwise. The rotation will be perf
### Anchor
Only relevant for the `Fill` method. This is useful for thumbnail generation where the main motive is located in, say, the left corner.
-Valid are `Center`, `TopLeft`, `Top`, `TopRight`, `Left`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`.
+
+Valid values are `Smart`, `Center`, `TopLeft`, `Top`, `TopRight`, `Left`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`.
+
+Default value is `Smart`, which uses [Smartcrop](https://github.com/muesli/smartcrop) to determine the best crop.
```go
{{ $image.Fill "300x200 BottomLeft" }}
diff --git a/docs/content/en/content-management/syntax-highlighting.md b/docs/content/en/content-management/syntax-highlighting.md
index 1220a06c8..c53a6d65e 100644
--- a/docs/content/en/content-management/syntax-highlighting.md
+++ b/docs/content/en/content-management/syntax-highlighting.md
@@ -43,10 +43,9 @@ Highlighting is carried out via the [built-in shortcode](/content-management/sho
Options:
-* `linenos`: Valid values are `true`, `false`, `table`, `inline`. `table` will give copy-and-paste friendly code blocks) turns on line numbers.
-* Setting `linenos` to `false` will turn off linenumbers if it's configured to be on in site config.{{< new-in "0.60.0" >}}
-* `hl_lines` lists a set of line numbers or line number ranges to be highlighted.
-* `linenostart=199` starts the line number count from 199.
+* `linenos`: configure line numbers. Valid values are `true`, `false`, `table`, or `inline`. `false` will turn off line numbers if it's configured to be on in site config. {{< new-in "0.60.0" >}} `table` will give copy-and-paste friendly code blocks.
+* `hl_lines`: lists a set of line numbers or line number ranges to be highlighted.
+* `linenostart=199`: starts the line number count from 199.
### Example: Highlight Shortcode
diff --git a/docs/content/en/content-management/urls.md b/docs/content/en/content-management/urls.md
index 14971af43..c4afbe0b7 100644
--- a/docs/content/en/content-management/urls.md
+++ b/docs/content/en/content-management/urls.md
@@ -38,6 +38,13 @@ permalinks:
Only the content under `posts/` will have the new URL structure. For example, the file `content/posts/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2017/02/sample-entry/`.
+To configure the `permalinks` option for pages in the "root" section, use **/** as the key:
+
+{{< code-toggle file="config" copy="false" >}}
+permalinks:
+ /: /:year/:month/:filename/
+{{< /code-toggle >}}
+
If the standard date-based permalink configuration does not meet your needs, you can also format URL segments using [Go time formatting directives](https://golang.org/pkg/time/#Time.Format). For example, a URL structure with two digit years and month and day digits without zero padding can be accomplished with:
{{< code-toggle file="config" copy="false" >}}
diff --git a/docs/content/en/getting-started/configuration-markup.md b/docs/content/en/getting-started/configuration-markup.md
index 337fe00ef..df4449bbf 100644
--- a/docs/content/en/getting-started/configuration-markup.md
+++ b/docs/content/en/getting-started/configuration-markup.md
@@ -85,9 +85,13 @@ ordered
Note that this is only supported with the [Goldmark](#goldmark) renderer.
-These Render Hooks allow custom templates to render links and images from markdown.
+Render Hooks allow custom templates to override markdown rendering functionality. You can do this by creating templates with base names `render-{feature}` in `layouts/_default/_markup`.
-You can do this by creating templates with base names `render-link` and/or `render-image` inside `layouts/_default/_markup`.
+The features currently supported are:
+
+* `image`
+* `link`
+* `heading` {{< new-in "0.71.0" >}}
You can define [Output-Format-](/templates/output-formats) and [language-](/content-management/multilingual/)specific templates if needed.[^hooktemplate] Your `layouts` folder may look like this:
@@ -105,10 +109,11 @@ Some use cases for the above:
* Resolve link references using `.GetPage`. This would make links portable as you could translate `./my-post.md` (and similar constructs that would work on GitHub) into `/blog/2019/01/01/my-post/` etc.
* Add `target=_blank` to external links.
* Resolve and [process](/content-management/image-processing/) images.
+* Add [header links](https://remysharp.com/2014/08/08/automatic-permalinks-for-blog-posts).
### Render Hook Templates
-Both `render-link` and `render-image` templates will receive this context:
+The `render-link` and `render-image` templates will receive this context:
Page
: The [Page](/variables/page/) being rendered.
@@ -125,7 +130,24 @@ Text
PlainText
: The plain variant of the above.
-#### Link with title Markdown example :
+The `render-heading` template will receive this context:
+
+Page
+: The [Page](/variables/page/) being rendered.
+
+Level
+: The header level (1--6)
+
+Anchor
+: An auto-generated html id unique to the header within the page
+
+Text
+: The rendered (HTML) text.
+
+PlainText
+: The plain variant of the above.
+
+#### Link with title Markdown example:
```md
[Text](https://www.gohugo.io "Title")
@@ -151,5 +173,24 @@ Here is a code example for how the render-image.html template could look:
</p>
{{< /code >}}
-[^hooktemplate]: It's currently only possible to have one set of render hook templates, e.g. not per `Type` or `Section`. We may consider that in a future version.
+#### Heading link example
+
+Given this template file
+
+{{< code file="layouts/_default/_markup/render-heading.html" >}}
+<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}">¶</a></h{{ .Level }}>
+{{< /code >}}
+
+And this markdown
+
+```md
+### Section A
+```
+
+The rendered html will be
+```html
+<h3 id="section-a">Section A <a href="#section-a">¶</a></h3>
+```
+
+[^hooktemplate]: It's currently only possible to have one set of render hook templates, e.g. not per `Type` or `Section`. We may consider that in a future version.
diff --git a/docs/content/en/hugo-modules/use-modules.md b/docs/content/en/hugo-modules/use-modules.md
index 85417b5bf..baf68d21b 100644
--- a/docs/content/en/hugo-modules/use-modules.md
+++ b/docs/content/en/hugo-modules/use-modules.md
@@ -30,9 +30,20 @@ Use `hugo mod init` to initialize a new Hugo Module. If it fails to guess the mo
hugo mod init github.com/gohugoio/myShortcodes
```
-
Also see the [CLI Doc](/commands/hugo_mod_init/).
+## Use a Module for a Theme
+The easiest way to use a for a theme is to import it in the config.
+
+1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
+2. Import the theme in your `config.toml`:
+
+```toml
+[module]
+ [[module.imports]]
+ path = "github.com/spf13/hyde/"
+```
+
## Update Modules
Modules will be downloaded and added when you add them as imports to your configuration, see [Module Imports](/hugo-modules/configuration/#module-config-imports).
diff --git a/docs/content/en/news/0.71.0-relnotes/hugo-71-featured.png b/docs/content/en/news/0.71.0-relnotes/hugo-71-featured.png
new file mode 100644
index 000000000..081581df8
--- /dev/null
+++ b/docs/content/en/news/0.71.0-relnotes/hugo-71-featured.png
Binary files differ
diff --git a/docs/content/en/news/0.71.0-relnotes/index.md b/docs/content/en/news/0.71.0-relnotes/index.md
index 486c28542..07d951bf3 100644
--- a/docs/content/en/news/0.71.0-relnotes/index.md
+++ b/docs/content/en/news/0.71.0-relnotes/index.md
@@ -1,14 +1,15 @@
---
date: 2020-05-18
-title: "0.71.0"
-description: "0.71.0"
+title: "Markdown Render Hooks for Headings"
+description: "Render hooks for headings, update to Go 1.14.3, several bug fixes etc."
categories: ["Releases"]
---
- Hugo 0.71 brings Markdown render hooks for headings, but the main reason why this release comes sooner rather than later is to get out a release built on Go 1.14.3 which comes with a fix for [this bug](https://github.com/golang/go/issues/37833) that caused Hugo to sometimes spin up with 100% CPU on MacOS.
+Hugo 0.71 brings [Markdown render hooks for headings](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks), a set of bug fixes and more.
+
+This release represents **12 contributions by 7 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@anthonyfok](https://github.com/anthonyfok), [@apexskier](https://github.com/apexskier), and [@johnweldon](https://github.com/johnweldon) for their ongoing contributions.
-This release represents **12 contributions by 7 contributors** to the main Hugo code base.[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@anthonyfok](https://github.com/anthonyfok), [@apexskier](https://github.com/apexskier), and [@johnweldon](https://github.com/johnweldon) 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 [@davidsneighbour](https://github.com/davidsneighbour) and [@kaushalmodi](https://github.com/kaushalmodi) for all the great work on the documentation site.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
diff --git a/docs/content/en/news/0.71.1-relnotes/index.md b/docs/content/en/news/0.71.1-relnotes/index.md
index 56b265302..7fbd01dd3 100644
--- a/docs/content/en/news/0.71.1-relnotes/index.md
+++ b/docs/content/en/news/0.71.1-relnotes/index.md
@@ -2,7 +2,7 @@
---
date: 2020-05-25
title: "Hugo 0.71.1: A couple of Bug Fixes"
-description: "This version fixes a couple of bugs introduced in 0.71.0."
+description: "This version fixes a couple of bugs."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
diff --git a/docs/content/en/readfiles/pages-vs-site-pages.md b/docs/content/en/readfiles/pages-vs-site-pages.md
index 8cf67d3c0..437ec1c22 100644
--- a/docs/content/en/readfiles/pages-vs-site-pages.md
+++ b/docs/content/en/readfiles/pages-vs-site-pages.md
@@ -24,8 +24,12 @@ the current _list_ page:
`.RegularPages`
: Collection of only _regular_ pages under the
- current _list_ page.
+ current _list_ page. This **excludes** regular pages in nested sections/_list_ pages (those are subdirectories with an `_index.md` file.
+`.RegularPagesRecursive`
+: Collection of **all** _regular_ pages under a _list_ page. This **includes** regular pages in nested sections/_list_ pages.
+
+This feature was added in Hugo version 0.68.0
Note
: From the scope of _regular_ pages, `.Pages` and
diff --git a/docs/content/en/templates/rss.md b/docs/content/en/templates/rss.md
index d6edc31c9..ee179787f 100644
--- a/docs/content/en/templates/rss.md
+++ b/docs/content/en/templates/rss.md
@@ -29,7 +29,7 @@ RSS pages are of the type `Page` and have all the [page variables](/variables/pa
### Section RSS
-A [section’s][section] RSS will be rendered at `/<SECTION>/index.xml` (e.g., https://spf13.com/project/index.xml).
+A [section’s][section] RSS will be rendered at `/<SECTION>/index.xml` (e.g., [https://spf13.com/project/index.xml](https://spf13.com/project/index.xml)).
Hugo provides the ability for you to define any RSS type you wish and can have different RSS files for each section and taxonomy.
diff --git a/docs/content/en/tools/migrations.md b/docs/content/en/tools/migrations.md
index 3959d1d21..3dd334bef 100644
--- a/docs/content/en/tools/migrations.md
+++ b/docs/content/en/tools/migrations.md
@@ -20,7 +20,7 @@ toc: true
This section highlights some projects around Hugo that are independently developed. These tools try to extend the functionality of our static site generator or help you to get started.
{{% note %}}
-Do you know or maintain a similar project around Hugo? Feel free to open a [pull request](https://github.com/gohugoio/hugo/pulls) on GitHub if you think it should be added.
+Do you know or maintain a similar project around Hugo? Feel free to open a [pull request](https://github.com/gohugoio/hugoDocs/pulls) on GitHub if you think it should be added.
{{% /note %}}
Take a look at this list of migration tools if you currently use other blogging tools like Jekyll or WordPress but intend to switch to Hugo instead. They'll take care to export your content into Hugo-friendly formats.
diff --git a/docs/content/en/tools/search.md b/docs/content/en/tools/search.md
index f81083710..f51498b1f 100644
--- a/docs/content/en/tools/search.md
+++ b/docs/content/en/tools/search.md
@@ -26,6 +26,7 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati
* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords.
* [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo!
* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files.
+* [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "Github Gist for Fuse.js integration" — global, keyboard-optimized search.
## Commercial Search Services
diff --git a/docs/content/en/variables/site.md b/docs/content/en/variables/site.md
index 7d663b96b..9fc6c49a0 100644
--- a/docs/content/en/variables/site.md
+++ b/docs/content/en/variables/site.md
@@ -20,6 +20,10 @@ toc: true
The following is a list of site-level (aka "global") variables. Many of these variables are defined in your site's [configuration file][config], whereas others are built into Hugo's core for convenient usage in your templates.
+## Get the Site object from a partial
+
+All the methods below, e.g. `.Site.RegularPages` can also be reached via the global `site` function, e.g. `site.RegularPages`, which can be handy in partials where the `Page` object isn't easily available. {{< new-in "0.53.0" >}}.
+
## Site Variables List
.Site.AllPages