Squashed 'docs/' changes from 54f0e8776..bd0e15bb6
bd0e15bb6 Optimised images with calibre/image-actions 59830ea44 Remove comments from quickstart code samples 348821b5d Remove image-actions 1cbbd26a9 Update index.md bcf3de764 Update index.md fcf17e6ef Release 0.62.1 0956bde21 Merge branch 'temp621' 28d604756 releaser: Add release notes to /docs for release of 0.62.1 c895f12e7 Fix statement about version installed with apt-get (#854) e96928e38 Updated quickstart to split theme download and theme config add into separate blocks (#967) e099c1ad6 changed ".Title" to ".URL" (#972) bea71280d Fix small typing error (#1001) 9c28c422e Correct hyperlink for 'markdownify' function cf3844a06 Corrected small conjugation mistake (#996) 8b9c1d4f2 Added remarks about additional parameters in ref/relref (#995) ca06c9a56 Fix illegal character in render-link.html example 7a85c789b Update RenderString.md 69df3b17e Update configuration-markup.md 43e9222a2 Revert "Add shortcodes to note comparing with `markdownify`" 2bd5bc2d7 Add shortcodes to note comparing with `markdownify` ddfee60b7 Update configuration-markup.md f87c35fe2 docs: Remove extra double quotation 5ca5cc15f Update index.md 6e457f5ec Update configuration-markup.md 12df3c0fc Update configuration-markup.md 91977fd96 Update configuration-markup.md 377b8954a Update configuration-markup.md 99d691b5e Update hosting-on-render.md ccf855b22 Update index.md a945acc42 Update index.md 7d4f308d6 Fix Netlify config f4caa07f5 Release 0.62.0 79d18276f releaser: Add release notes to /docs for release of 0.62.0 9db1a08d1 Merge commit '8a4005cf2b0ef34265ff8051a6b76226685fc226' 79e556223 docs: More on hooks 5088c54df tpl: Do not return any value in errorf 98c8c8638 tpl: Add a warnf template func 4a9d76cea docs: Regen docshelper 626e53b55 Fix incorrect MIME type from image/jpg to image/jpeg f92f77c5d Preserve HTML Text for link render hooks 6db9c52b1 docs: Footnote 16801db3b Add render template hooks for links and images 0facb823c Merge commit '2e711a28c71e8667258e5ab824f9b9a71c261b0a' 79bf8ed4c markup/tableofcontents: Add config option for ordered list git-subtree-dir: docs git-subtree-split: bd0e15bb6063f7ad4f0c47eb33c8c0c23c962d13
3
.github/calibre/image-actions.yml
vendored
|
@ -1,3 +0,0 @@
|
|||
ignorePaths:
|
||||
- "resources/**"
|
||||
- "_vendor/**"
|
|
@ -16,7 +16,7 @@ menu:
|
|||
|
||||
## The Image Page Resource
|
||||
|
||||
The `image` is a [Page Resource]({{< relref "/content-management/page-resources" >}}), and the processing methods listed below does not work on images inside your `/static` folder.
|
||||
The `image` is a [Page Resource]({{< relref "/content-management/page-resources" >}}), and the processing methods listed below do not work on images inside your `/static` folder.
|
||||
|
||||
To get all images in a [Page Bundle]({{< relref "/content-management/organization#page-bundles" >}}):
|
||||
|
||||
|
@ -88,7 +88,7 @@ Sometimes it can be useful to create the filter chain once and then reuse it:
|
|||
|
||||
Provides an [Exif](https://en.wikipedia.org/wiki/Exif) object with metadata about the image.
|
||||
|
||||
Note that this is only suported for JPG and TIFF images, so it's recommended to wrap the access with a `with`, e.g.:
|
||||
Note that this is only suported for JPEG and TIFF images, so it's recommended to wrap the access with a `with`, e.g.:
|
||||
|
||||
```go-html-template
|
||||
{{ with $img.Exif }}
|
||||
|
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 34 KiB |
|
@ -17,7 +17,7 @@ menu:
|
|||
## Properties
|
||||
|
||||
ResourceType
|
||||
: The main type of the resource. For example, a file of MIME type `image/jpg` has the ResourceType `image`.
|
||||
: The main type of the resource. For example, a file of MIME type `image/jpeg` has the ResourceType `image`.
|
||||
|
||||
Name
|
||||
: Default value is the filename (relative to the owning page). Can be set in front matter.
|
||||
|
@ -35,7 +35,7 @@ Content
|
|||
: The content of the resource itself. For most resources, this returns a string with the contents of the file. This can be used to inline some resources, such as `<script>{{ (.Resources.GetMatch "myscript.js").Content | safeJS }}</script>` or `<img src="{{ (.Resources.GetMatch "mylogo.png").Content | base64Encode }}">`.
|
||||
|
||||
MediaType
|
||||
: The MIME type of the resource, such as `image/jpg`.
|
||||
: The MIME type of the resource, such as `image/jpeg`.
|
||||
|
||||
MediaType.MainType
|
||||
: The main type of the resource's MIME type. For example, a file of MIME type `application/pdf` has for MainType `application`.
|
||||
|
|
39
content/en/functions/RenderString.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: .RenderString
|
||||
description: "Renders markup to HTML."
|
||||
godocref:
|
||||
date: 2019-12-18
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [markdown,goldmark,render]
|
||||
signature: [".RenderString MARKUP"]
|
||||
---
|
||||
|
||||
{{< new-in "0.62.0" >}}
|
||||
|
||||
`.RenderString` is a method on `Page` that renders some markup to HTML using the content renderer defined for that page (if not set in the options).
|
||||
|
||||
*Note* that this method does not parse and render shortcodes.
|
||||
|
||||
The method takes an optional map argument with these options:
|
||||
|
||||
display ("inline")
|
||||
: `inline` or `block`. If `inline` (default), surrounding ´<p></p>` on short snippets will be trimmed.
|
||||
|
||||
markup (defaults to the Page's markup)
|
||||
: See identifiers in [List of content formats](/content-management/formats/#list-of-content-formats).
|
||||
|
||||
Some examples:
|
||||
|
||||
```go-html-template
|
||||
{{ $optBlock := dict "display" "block" }}
|
||||
{{ $optOrg := dict "markup" "org" }}
|
||||
{{ "**Bold Markdown**" | $p.RenderString }}
|
||||
{{ "**Bold Block Markdown**" | $p.RenderString $optBlock }}
|
||||
{{ "/italic org mode/" | $p.RenderString $optOrg }}:REND
|
||||
```
|
||||
|
||||
|
||||
**Note** that this method is more powerful than the similar [markdownify](/functions/markdownify/) function as it also supports [Render Hooks](/getting-started/configuration-markup/#markdown-render-hooks) and it has options to render other markup formats.
|
|
@ -1,7 +1,6 @@
|
|||
---
|
||||
title: errorf
|
||||
linktitle: errorf
|
||||
description: Log ERROR and fail the build from the templates.
|
||||
title: errorf and warnf
|
||||
description: Log ERROR or WARNING from the templates.
|
||||
date: 2017-09-30
|
||||
publishdate: 2017-09-30
|
||||
lastmod: 2017-09-30
|
||||
|
@ -15,15 +14,21 @@ workson: []
|
|||
hugoversion:
|
||||
relatedfuncs: [printf]
|
||||
deprecated: false
|
||||
aliases: []
|
||||
aliases: [/functions/errorf]
|
||||
---
|
||||
|
||||
`errorf` will evaluate a format string, then output the result to the ERROR log (and only once per error message to avoid flooding the log).
|
||||
`errorf` or `warnf` will evaluate a format string, then output the result to the ERROR or WARNING log (and only once per error message to avoid flooding the log).
|
||||
|
||||
This will also cause the build to fail (the `hugo` command will `exit -1`).
|
||||
Any ERROR will also cause the build to fail (the `hugo` command will `exit -1`).
|
||||
|
||||
Both functions return an empty string, so the messages are only printed to the console.
|
||||
|
||||
```
|
||||
{{ errorf "Failed to handle page %q" .Path }}
|
||||
```
|
||||
|
||||
Note that `errorf` supports all the formatting verbs of the [fmt](https://golang.org/pkg/fmt/) package.
|
||||
```
|
||||
{{ warnf "You should update the shortcodes in %q" .Path }}
|
||||
```
|
||||
|
||||
Note that `errorf` and `warnf` support all the formatting verbs of the [fmt](https://golang.org/pkg/fmt/) package.
|
||||
|
|
|
@ -5,7 +5,7 @@ description: Looks up a content page by logical name.
|
|||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
lastmod: 2019-12-28
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
|
@ -29,6 +29,12 @@ aliases: []
|
|||
`ref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
|
||||
{{% /note %}}
|
||||
|
||||
It is also possible to pass additional arguments to link to another language or an alternative output format. Therefore, pass a map of arguments instead of just the path.
|
||||
|
||||
```
|
||||
{{ ref . (dict "path" "about.md" "lang" "ja" "outputFormat" "rss") }}
|
||||
```
|
||||
|
||||
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
|
||||
|
||||
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).
|
||||
|
|
|
@ -5,7 +5,7 @@ description: Looks up a content page by relative path.
|
|||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
lastmod: 2019-12-28
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
|
@ -29,6 +29,12 @@ aliases: []
|
|||
`relref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
|
||||
{{% /note %}}
|
||||
|
||||
It is also possible to pass additional arguments to link to another language or an alternative output format. Therefore, pass a map of arguments instead of just the path.
|
||||
|
||||
```
|
||||
{{ relref . (dict "path" "about.md" "lang" "ja" "outputFormat" "rss") }}
|
||||
```
|
||||
|
||||
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
|
||||
|
||||
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).
|
||||
|
|
|
@ -50,7 +50,7 @@ This partial would produce the following HTML output:
|
|||
</ul>
|
||||
{{< /output >}}
|
||||
|
||||
The odd output can be remedied by adding ` | safeURL` to our `.Title` page variable:
|
||||
The odd output can be remedied by adding ` | safeURL` to our `.URL` page variable:
|
||||
|
||||
{{< code file="layouts/partials/correct-url-sidebar-menu.html" copy="false" >}}
|
||||
<!-- This unordered list may be part of a sidebar menu -->
|
||||
|
|
|
@ -71,3 +71,68 @@ startLevel
|
|||
|
||||
endLevel
|
||||
: The heading level, inclusive, to stop render the table of contents.
|
||||
|
||||
ordered
|
||||
: Whether or not to generate an ordered list instead of an unordered list.
|
||||
|
||||
|
||||
## Markdown Render Hooks
|
||||
|
||||
{{< new-in "0.62.0" >}}
|
||||
|
||||
Note that this is only supported with the [Goldmark](#goldmark) renderer.
|
||||
|
||||
These Render Hooks allow custom templates to render links and images from markdown.
|
||||
|
||||
You can do this by creating templates with base names `render-link` and/or `render-image` inside `layouts/_default/_markup`.
|
||||
|
||||
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:
|
||||
|
||||
```bash
|
||||
layouts
|
||||
└── _default
|
||||
└── _markup
|
||||
├── render-image.html
|
||||
├── render-image.rss.xml
|
||||
└── render-link.html
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
### Render Hook Templates
|
||||
|
||||
Both `render-link` and `render-image` templates will receive this context:
|
||||
|
||||
Page
|
||||
: The [Page](/variables/page/) being rendered.
|
||||
|
||||
Destination
|
||||
: The URL.
|
||||
|
||||
Title
|
||||
: The title attribute.
|
||||
|
||||
Text
|
||||
: The rendered (HTML) link text.
|
||||
|
||||
PlainText
|
||||
: The plain variant of the above.
|
||||
|
||||
A Markdown example for an inline-style link with title:
|
||||
|
||||
```md
|
||||
[Text](https://www.gohugo.io "Title")
|
||||
```
|
||||
|
||||
A very simple template example given the above:
|
||||
|
||||
{{< code file="layouts/_default/_markup/render-link.html" >}}
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text }}</a>
|
||||
{{< /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.
|
||||
|
||||
|
|
Before Width: | Height: | Size: 223 KiB After Width: | Height: | Size: 65 KiB |
|
@ -461,7 +461,7 @@ Hugo installed via Snap can write only inside the user’s `$HOME` directory---a
|
|||
|
||||
sudo apt-get install hugo
|
||||
|
||||
This installs the "extended" Sass/SCSS version.
|
||||
What this installs depends on your Debian/Ubuntu version. On Ubuntu bionic (18.04), this installs the non-extended version without Sass/SCSS support. On Ubuntu disco (19.04), this installs the extended version with Sass/SCSS support.
|
||||
|
||||
This option is not recommended because the Hugo in Linux package managers for Debian and Ubuntu is usually a few versions behind as described [here](https://github.com/gcushen/hugo-academic/issues/703)
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@ It is recommended to have [Git installed](https://git-scm.com/downloads) to run
|
|||
For other approaches learning Hugo like book or a video tutorial refer to the [external learning resources](/getting-started/external-learning-resources/) page.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
|
||||
## Step 1: Install Hugo
|
||||
|
||||
{{% note %}}
|
||||
|
@ -44,10 +42,8 @@ To verify your new install:
|
|||
hugo version
|
||||
```
|
||||
|
||||
|
||||
{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}}
|
||||
|
||||
|
||||
## Step 2: Create a New Site
|
||||
|
||||
```bash
|
||||
|
@ -58,34 +54,33 @@ The above will create a new Hugo site in a folder named `quickstart`.
|
|||
|
||||
{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}}
|
||||
|
||||
|
||||
## Step 3: Add a Theme
|
||||
|
||||
See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
|
||||
|
||||
First, download the theme from Github and add it to your site's `theme` directory:
|
||||
|
||||
```bash
|
||||
cd quickstart
|
||||
|
||||
# Download the theme
|
||||
git init
|
||||
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
|
||||
# Note for non-git users:
|
||||
# - If you do not have git installed, you can download the archive of the latest
|
||||
# version of this theme from:
|
||||
# https://github.com/budparr/gohugo-theme-ananke/archive/master.zip
|
||||
# - Extract that .zip file to get a "gohugo-theme-ananke-master" directory.
|
||||
# - Rename that directory to "ananke", and move it into the "themes/" directory.
|
||||
# End of note for non-git users.
|
||||
```
|
||||
|
||||
# Edit your config.toml configuration file
|
||||
# and add the Ananke theme.
|
||||
*Note for non-git users:*
|
||||
- If you do not have git installed, you can download the archive of the latest
|
||||
version of this theme from:
|
||||
https://github.com/budparr/gohugo-theme-ananke/archive/master.zip
|
||||
- Extract that .zip file to get a "gohugo-theme-ananke-master" directory.
|
||||
- Rename that directory to "ananke", and move it into the "themes/" directory.
|
||||
|
||||
Then, add the theme to the site configuration:
|
||||
|
||||
```bash
|
||||
echo 'theme = "ananke"' >> config.toml
|
||||
```
|
||||
|
||||
|
||||
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}
|
||||
|
||||
|
||||
## Step 4: Add Some Content
|
||||
|
||||
You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do few things for you (like add title and date):
|
||||
|
@ -107,15 +102,12 @@ draft: true
|
|||
|
||||
```
|
||||
|
||||
|
||||
## Step 5: Start the Hugo server
|
||||
|
||||
Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled:
|
||||
|
||||
{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}}
|
||||
|
||||
|
||||
|
||||
```
|
||||
▶ hugo server -D
|
||||
|
||||
|
@ -140,12 +132,10 @@ Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
|
|||
Press Ctrl+C to stop
|
||||
```
|
||||
|
||||
|
||||
**Navigate to your new site at [http://localhost:1313/](http://localhost:1313/).**
|
||||
|
||||
Feel free to edit or add new content and simply refresh in browser to see changes quickly (You might need to force refresh in webbrowser, something like Ctrl-R usually works).
|
||||
|
||||
|
||||
## Step 6: Customize the Theme
|
||||
|
||||
Your new site already looks great, but you will want to tweak it a little before you release it to the public.
|
||||
|
@ -167,12 +157,10 @@ Replace the `title` above with something more personal. Also, if you already hav
|
|||
**Tip:** Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away, though you may need to [clear your cache](https://kb.iu.edu/d/ahic).
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
For theme specific configuration options, see the [theme site](https://github.com/budparr/gohugo-theme-ananke).
|
||||
|
||||
**For further theme customization, see [Customize a Theme](/themes/customizing/).**
|
||||
|
||||
|
||||
### Step 7: Build static pages
|
||||
|
||||
It is simple. Just call:
|
||||
|
|
|
@ -4,7 +4,7 @@ linktitle: Host on Render
|
|||
description: Host your Hugo site for free with Render's global CDN, fully-managed SSL and auto deploys from GitHub.
|
||||
date: 2019-06-06
|
||||
publishdate: 2019-06-06
|
||||
lastmod: 2019-06-21
|
||||
lastmod: 2020-01-01
|
||||
categories: [hosting and deployment]
|
||||
keywords: [render,hosting,deployment]
|
||||
authors: [Anurag Goel]
|
||||
|
@ -25,7 +25,7 @@ toc: true
|
|||
|
||||
Static sites are **completely free** on Render and include the following:
|
||||
|
||||
- Continuous, automatic builds & deploys from GitHub.
|
||||
- Continuous, automatic builds & deploys from [GitHub](https://render.com/docs/github) and [GitLab](https://render.com/docs/gitlab).
|
||||
- Automatic SSL certificates through [Let's Encrypt](https://letsencrypt.org).
|
||||
- Instant cache invalidation with a lightning fast, global CDN.
|
||||
- Unlimited collaborators.
|
||||
|
@ -38,7 +38,7 @@ Static sites are **completely free** on Render and include the following:
|
|||
|
||||
## Assumptions
|
||||
|
||||
* You have an account with GitHub.
|
||||
* You have an account with GitHub or GitLab.
|
||||
* You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world.
|
||||
* You have a Render account. You can sign up at https://render.com/register.
|
||||
|
||||
|
@ -46,20 +46,20 @@ Static sites are **completely free** on Render and include the following:
|
|||
|
||||
You can set up a Hugo site on Render in two quick steps:
|
||||
|
||||
1. Create a new **Web Service** on Render, and give Render permission to access your GitHub repo.
|
||||
1. Create a new **Web Service** on Render, and give Render permission to access your GitHub/Gitlab repo.
|
||||
2. Use the following values during creation:
|
||||
|
||||
Field | Value
|
||||
------------------- | -------------------
|
||||
**Environment** | `Static Site`
|
||||
**Build Command** | `hugo --gc --minify` (or our own build command)
|
||||
**Build Command** | `hugo --gc --minify` (or your own build command)
|
||||
**Publish Directory** | `public` (or your own output directory)
|
||||
|
||||
That's it! Your site will be live on your Render URL (which looks like `yoursite.onrender.com`) as soon as the build is done.
|
||||
|
||||
## Continuous Deploys
|
||||
|
||||
Now that Render is connected to your repo, it will **automatically build and publish your site** any time you push to GitHub.
|
||||
Now that Render is connected to your repo, it will **automatically build and publish your site** any time you push to your GitHub/Gitlab.
|
||||
|
||||
You can choose to disable auto deploys under the **Settings** section for your site and deploy it manually from the Render dashboard.
|
||||
|
||||
|
|
BIN
content/en/news/0.62.0-relnotes/hugo-62-poster-featured.png
Normal file
After Width: | Height: | Size: 103 KiB |
83
content/en/news/0.62.0-relnotes/index.md
Normal file
|
@ -0,0 +1,83 @@
|
|||
|
||||
---
|
||||
date: 2019-12-23
|
||||
title: "Hugo Christmas Edition!"
|
||||
description: "Hugo 0.62 brings Markdown Render Hooks. And it's faster!"
|
||||
categories: ["Releases"]
|
||||
---
|
||||
|
||||
From all of us to all of you, a **very Merry Christmas** -- and Hugo `0.62.0`! This version brings [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-markup/#markdown-render-hooks). This gives you full control over how links and images in Markdown are rendered without using any shortcodes. With this, you can get Markdown links that work on both GitHub and Hugo, resize images etc. It is a very long sought after feature, that has been hard to tackle until we got [Goldmark](https://github.com/yuin/goldmark/), the new Markdown engine, by [@yuin](https://github.com/yuin). When you read up on this new feature in the documentation, also note the new [.RenderString](https://gohugo.io/functions/renderstring/) method on `Page`.
|
||||
|
||||
Adding these render hooks also had the nice side effect of making Hugo **faster and more memory effective**. We could have just added this feature on top of what we got, getting it to work. But you like Hugo's fast builds, you love instant browser-refreshes on change. So we had to take a step back and redesign how we detect "what changed?" for templates referenced from content files, either directly or indirectly. And by doing that we greatly simplified how we handle all the templates. Which accidentally makes this version **the fastest to date**. It's not an "every site will be much faster" statement. This depends. Sites with many languages and/or many templates will benefit more from this. We have benchmarks with site-building showing about 15% improvement in build speed and memory efficiency.
|
||||
|
||||
This release represents **25 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 [@gavinhoward](https://github.com/gavinhoward), [@niklasfasching](https://github.com/niklasfasching), and [@zaitseff](https://github.com/zaitseff) 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 **8 contributions by 5 contributors**. A special thanks to [@bep](https://github.com/bep), [@DirtyF](https://github.com/DirtyF), [@pfhawkins](https://github.com/pfhawkins), and [@bubelov](https://github.com/bubelov) for their work on the documentation site.
|
||||
|
||||
Also a big shoutout and thanks to the very active and helpful moderators on the [Hugo Discourse](https://discourse.gohugo.io/), making it a first class forum for Hugo questions and discussions.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 40362+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 440+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 284+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Notes
|
||||
|
||||
* Ace and Amber support is now removed from Hugo. See [#6609](https://github.com/gohugoio/hugo/issues/6609) for more information.
|
||||
* The `markdownify` template function does not, yet, support render hooks. We recommend you look at the new and more powerful [.RenderString](https://gohugo.io/functions/renderstring/) method on `Page`.
|
||||
* If you have output format specific behaviour in a template used from a content file, you must create a output format specific template, e.g. `myshortcode.amp.html`. This also applies to the new rendering hooks introduced in this release. This has been the intended behaviour all the time, but a failing test (now fixed) shows that the implementation of this has not been as strict as specified, hence this note.
|
||||
* The `errorf` does not return any value anymore. This means that the ERROR will just be printed to the console. We have also added a `warnf` template func.
|
||||
|
||||
|
||||
## Enhancements
|
||||
|
||||
### Templates
|
||||
|
||||
* Do not return any value in errorf [50cc7fe5](https://github.com/gohugoio/hugo/commit/50cc7fe54580018239ea95aafe67f6a158cdcc9f) [@bep](https://github.com/bep) [#6653](https://github.com/gohugoio/hugo/issues/6653)
|
||||
* Add a warnf template func [1773d71d](https://github.com/gohugoio/hugo/commit/1773d71d5b40f5a6a14edca417d2818607a499f1) [@bep](https://github.com/bep) [#6628](https://github.com/gohugoio/hugo/issues/6628)
|
||||
* Some more params merge adjustments [ccb1bf1a](https://github.com/gohugoio/hugo/commit/ccb1bf1abb7341fa1be23a90b66c14ae89790f49) [@bep](https://github.com/bep) [#6633](https://github.com/gohugoio/hugo/issues/6633)
|
||||
* Get rid of the custom template truth logic [d20ca370](https://github.com/gohugoio/hugo/commit/d20ca3700512d661247b44d953515b9455e57ed6) [@bep](https://github.com/bep) [#6615](https://github.com/gohugoio/hugo/issues/6615)
|
||||
* Add some comments [92c7f7ab](https://github.com/gohugoio/hugo/commit/92c7f7ab85a40cae8f36f2348d86f3e47d811eb5) [@bep](https://github.com/bep)
|
||||
|
||||
### Core
|
||||
|
||||
* Improve error and reload handling of hook templates in server mode [8a58ebb3](https://github.com/gohugoio/hugo/commit/8a58ebb311fd079f65068e7e37725e4d43f17ab5) [@bep](https://github.com/bep) [#6635](https://github.com/gohugoio/hugo/issues/6635)
|
||||
|
||||
### Other
|
||||
|
||||
* Update Goldmark to v1.1.18 [1fb17be9](https://github.com/gohugoio/hugo/commit/1fb17be9a008b549d11b622849adbaad01d4023d) [@bep](https://github.com/bep) [#6649](https://github.com/gohugoio/hugo/issues/6649)
|
||||
* Update go-org [51d89dab](https://github.com/gohugoio/hugo/commit/51d89dab1827ae80f9d865f5c38cb5f6a3a11f68) [@niklasfasching](https://github.com/niklasfasching)
|
||||
* More on hooks [c8bfe47c](https://github.com/gohugoio/hugo/commit/c8bfe47c6a740c5fedfdb5b7465d7ae1db44cb65) [@bep](https://github.com/bep)
|
||||
* Update to Goldmark v1.1.17 [04536838](https://github.com/gohugoio/hugo/commit/0453683816cfbc94e1e19c644f5f84213bb8cf35) [@bep](https://github.com/bep) [#6641](https://github.com/gohugoio/hugo/issues/6641)
|
||||
* Regen docshelper [55c29d4d](https://github.com/gohugoio/hugo/commit/55c29d4de38df67dd116f1845f7cc69ca7e35843) [@bep](https://github.com/bep)
|
||||
* Preserve HTML Text for image render hooks [a67d95fe](https://github.com/gohugoio/hugo/commit/a67d95fe1a033ca4934957b5a98b12ecc8a9edbd) [@bep](https://github.com/bep) [#6639](https://github.com/gohugoio/hugo/issues/6639)
|
||||
* Update Goldmark [eef934ae](https://github.com/gohugoio/hugo/commit/eef934ae7eabc38eeba386831de6013eec0285f2) [@bep](https://github.com/bep) [#6626](https://github.com/gohugoio/hugo/issues/6626)
|
||||
* Preserve HTML Text for link render hooks [00954c5d](https://github.com/gohugoio/hugo/commit/00954c5d1fda0b18cd1b847ee580d5f4caa76c70) [@bep](https://github.com/bep) [#6629](https://github.com/gohugoio/hugo/issues/6629)
|
||||
* Footnote [3e316155](https://github.com/gohugoio/hugo/commit/3e316155c5d4fbf166d38e997a41101b6aa501d5) [@bep](https://github.com/bep)
|
||||
* Add render template hooks for links and images [e625088e](https://github.com/gohugoio/hugo/commit/e625088ef5a970388ad50e464e87db56b358dac4) [@bep](https://github.com/bep) [#6545](https://github.com/gohugoio/hugo/issues/6545)[#4663](https://github.com/gohugoio/hugo/issues/4663)[#6043](https://github.com/gohugoio/hugo/issues/6043)
|
||||
* Enhance accessibility to issues [0947cf95](https://github.com/gohugoio/hugo/commit/0947cf958358e5a45b4f605e2a5b2504896fa360) [@peaceiris](https://github.com/peaceiris) [#6233](https://github.com/gohugoio/hugo/issues/6233)
|
||||
* Re-introduce the correct version of Goldmark [03d6960a](https://github.com/gohugoio/hugo/commit/03d6960a15dcc8efc164e5ed310b12bd1ffdd930) [@bep](https://github.com/bep)
|
||||
* Rework template handling for function and map lookups [a03c631c](https://github.com/gohugoio/hugo/commit/a03c631c420a03f9d90699abdf9be7e4fca0ff61) [@bep](https://github.com/bep) [#6594](https://github.com/gohugoio/hugo/issues/6594)
|
||||
* Create lightweight forks of text/template and html/template [167c0153](https://github.com/gohugoio/hugo/commit/167c01530bb295c8b8d35921eb27ffa5bee76dfe) [@bep](https://github.com/bep) [#6594](https://github.com/gohugoio/hugo/issues/6594)
|
||||
* Add config option for ordered list [4c804319](https://github.com/gohugoio/hugo/commit/4c804319f6db0b8459cc9b5df4a904fd2c55dedd) [@gavinhoward](https://github.com/gavinhoward)
|
||||
|
||||
## Fixes
|
||||
|
||||
### Templates
|
||||
|
||||
* Fix merge vs Params [1b785a7a](https://github.com/gohugoio/hugo/commit/1b785a7a6d3c264e39e4976c59b618c0ac1ba5f9) [@bep](https://github.com/bep) [#6633](https://github.com/gohugoio/hugo/issues/6633)
|
||||
|
||||
### Core
|
||||
|
||||
* Fix test [3c24ae03](https://github.com/gohugoio/hugo/commit/3c24ae030fe08ba259dd3de7ffea6c927c01e070) [@bep](https://github.com/bep)
|
||||
|
||||
### Other
|
||||
|
||||
* Fix abs path handling in module mounts [ad6504e6](https://github.com/gohugoio/hugo/commit/ad6504e6b504277bbc7b60d093cdccd4f3baaa4f) [@bep](https://github.com/bep) [#6622](https://github.com/gohugoio/hugo/issues/6622)
|
||||
* Fix incorrect MIME type from image/jpg to image/jpeg [158e7ec2](https://github.com/gohugoio/hugo/commit/158e7ec204e5149d77893d353cac9f55946d3e9a) [@zaitseff](https://github.com/zaitseff)
|
||||
|
||||
|
||||
|
||||
|
||||
|
17
content/en/news/0.62.1-relnotes/index.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
date: 2020-01-01
|
||||
title: "Hugo 0.62.1: A couple of Bug Fixes"
|
||||
description: "This version fixes a couple of bugs introduced in 0.62.0."
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
---
|
||||
|
||||
This release is mainly motivated by getting [this demo site](https://github.com/bep/portable-hugo-links) up and running. It demonstrates truly portable Markdown links and images, whether browsed on GitHub or deployed as a Hugo site.
|
||||
|
||||
* Support files in content mounts [ff6253bc](https://github.com/gohugoio/hugo/commit/ff6253bc7cf745e9c0127ddc9006da3c2c00c738) [@bep](https://github.com/bep) [#6684](https://github.com/gohugoio/hugo/issues/6684)[#6696](https://github.com/gohugoio/hugo/issues/6696)
|
||||
* Update alpine base image in Dockerfile to 3.11 [aa4ccb8a](https://github.com/gohugoio/hugo/commit/aa4ccb8a1e9b8aa17397acf34049a2aa16b0b6cb) [@RemcodM](https://github.com/RemcodM)
|
||||
* hugolib: Fix inline shortcode regression [5509954c](https://github.com/gohugoio/hugo/commit/5509954c7e8b0ce8d5ea903b0ab639ea14b69acb) [@bep](https://github.com/bep) [#6677](https://github.com/gohugoio/hugo/issues/6677)
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 378 KiB After Width: | Height: | Size: 350 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 791 KiB After Width: | Height: | Size: 752 KiB |
Before Width: | Height: | Size: 227 KiB After Width: | Height: | Size: 140 KiB |
|
@ -1383,11 +1383,13 @@
|
|||
"lineNumbersInTable": true,
|
||||
"lineNoStart": 1,
|
||||
"hl_Lines": "",
|
||||
"tabWidth": 4
|
||||
"tabWidth": 4,
|
||||
"guessSyntax": false
|
||||
},
|
||||
"tableOfContents": {
|
||||
"startLevel": 2,
|
||||
"endLevel": 3
|
||||
"endLevel": 3,
|
||||
"ordered": false
|
||||
},
|
||||
"goldmark": {
|
||||
"renderer": {
|
||||
|
@ -1501,10 +1503,10 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"type": "image/jpg",
|
||||
"string": "image/jpg",
|
||||
"type": "image/jpeg",
|
||||
"string": "image/jpeg",
|
||||
"mainType": "image",
|
||||
"subType": "jpg",
|
||||
"subType": "jpeg",
|
||||
"delimiter": ".",
|
||||
"suffixes": [
|
||||
"jpg",
|
||||
|
@ -2390,17 +2392,6 @@
|
|||
}
|
||||
},
|
||||
"compare": {
|
||||
"And": {
|
||||
"Description": "And computes the Boolean AND of its arguments, returning\nthe first false argument it encounters, or the last argument.",
|
||||
"Args": [
|
||||
"arg0",
|
||||
"args"
|
||||
],
|
||||
"Aliases": [
|
||||
"and"
|
||||
],
|
||||
"Examples": []
|
||||
},
|
||||
"Conditional": {
|
||||
"Description": "Conditional can be used as a ternary operator.\nIt returns a if condition, else b.",
|
||||
"Args": [
|
||||
|
@ -2513,27 +2504,6 @@
|
|||
"ne"
|
||||
],
|
||||
"Examples": []
|
||||
},
|
||||
"Not": {
|
||||
"Description": "Not returns the Boolean negation of its argument.",
|
||||
"Args": [
|
||||
"arg"
|
||||
],
|
||||
"Aliases": [
|
||||
"not"
|
||||
],
|
||||
"Examples": []
|
||||
},
|
||||
"Or": {
|
||||
"Description": "Or computes the Boolean OR of its arguments, returning\nthe first true argument it encounters, or the last argument.",
|
||||
"Args": [
|
||||
"arg0",
|
||||
"args"
|
||||
],
|
||||
"Aliases": [
|
||||
"or"
|
||||
],
|
||||
"Examples": []
|
||||
}
|
||||
},
|
||||
"collections": {
|
||||
|
@ -3083,6 +3053,22 @@
|
|||
"works!\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
"Warnf": {
|
||||
"Description": "Warnf formats according to a format specifier and logs a WARNING.\nIt returns an empty string.",
|
||||
"Args": [
|
||||
"format",
|
||||
"a"
|
||||
],
|
||||
"Aliases": [
|
||||
"warnf"
|
||||
],
|
||||
"Examples": [
|
||||
[
|
||||
"{{ warnf \"%s.\" \"warning\" }}",
|
||||
""
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"hugo": {
|
||||
|
@ -3542,11 +3528,11 @@
|
|||
]
|
||||
},
|
||||
"IncludeCached": {
|
||||
"Description": "IncludeCached executes and caches partial templates. An optional variant\nstring parameter (a string slice actually, but be only use a variadic\nargument to make it optional) can be passed so that a given partial can have\nmultiple uses. The cache is created with name+variant as the key.",
|
||||
"Description": "IncludeCached executes and caches partial templates. The cache is created with name+variants as the key.",
|
||||
"Args": [
|
||||
"name",
|
||||
"context",
|
||||
"variant"
|
||||
"variants"
|
||||
],
|
||||
"Aliases": [
|
||||
"partialCached"
|
||||
|
|
|
@ -3,7 +3,7 @@ publish = "public"
|
|||
command = "hugo --gc --minify"
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.61.0"
|
||||
HUGO_VERSION = "0.62.1"
|
||||
HUGO_ENV = "production"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
||||
|
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
|
|||
command = "hugo --gc --minify --enableGitInfo"
|
||||
|
||||
[context.split1.environment]
|
||||
HUGO_VERSION = "0.61.0"
|
||||
HUGO_VERSION = "0.62.1"
|
||||
HUGO_ENV = "production"
|
||||
|
||||
[context.deploy-preview]
|
||||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
||||
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.61.0"
|
||||
HUGO_VERSION = "0.62.1"
|
||||
|
||||
[context.branch-deploy]
|
||||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
||||
|
||||
[context.branch-deploy.environment]
|
||||
HUGO_VERSION = "0.61.0"
|
||||
HUGO_VERSION = "0.62.1"
|
||||
|
||||
[context.next.environment]
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
|
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.8 KiB |