From 09728efbfd0153dd0d7a11ae858437d75beeb2de Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Mon, 5 Feb 2018 14:06:29 -0500 Subject: [PATCH 1/4] Add "target" and "rel" parameters to figure shortcode Also: - Remove unnecessary space from `figure` tag if no class is specified. - Update related tests. - Add test cases for the changes made to the figure shortcode. - Document the newly added target and rel parameters - Add more detail to the documentation of all figure shortcode parameters. --- content/content-management/shortcodes.md | 44 +++++++++++++++++++----- content/templates/shortcode-templates.md | 2 +- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/content/content-management/shortcodes.md b/content/content-management/shortcodes.md index b6428f5a0..e5bc85265 100644 --- a/content/content-management/shortcodes.md +++ b/content/content-management/shortcodes.md @@ -80,15 +80,41 @@ Hugo ships with a set of predefined shortcodes that represent very common usage. The `figure` shortcode can use the following named parameters: -* `src` -* `link` -* `title` -* `caption` -* `class` -* `attr` (i.e., attribution) -* `attrlink` -* `alt` -* `width` +src +: URL of the image to be displayed. + +link +: If the image needs to be hyperlinked, URL of the destination. + +target +: Optional `target` attribute for the URL if `link` parameter is set. + +rel +: Optional `rel` attribute for the URL if `link` parameter is set. + +alt +: Alternate text for the image if the image cannot be displayed. + +title +: Image title. + +caption +: Image caption. + +class +: `class` attribute of the HTML `figure` tag. + +height +: `height` attribute of the image. + +width +: `width` attribute of the image. + +attr +: Image attribution text. + +attrlink +: If the attribution text needs to be hyperlinked, URL of the destination. #### Example `figure` Input diff --git a/content/templates/shortcode-templates.md b/content/templates/shortcode-templates.md index de1594281..08f1b4c80 100644 --- a/content/templates/shortcode-templates.md +++ b/content/templates/shortcode-templates.md @@ -218,7 +218,7 @@ You have created the shortcode at `/layouts/shortcodes/img.html`, which loads th Would be rendered as: {{< code file="img-output.html" copy="false" >}} -
+

Steve Francia

From 845b2cacb48a56f9d869b56a2d6e5b64472062e3 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 09:07:43 +0000 Subject: [PATCH 2/4] releaser: Bump versions for release of 0.36.1 [ci skip] --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index db8650a71..0147f8df8 100644 --- a/config.toml +++ b/config.toml @@ -71,7 +71,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.36" + release = "0.36.1" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) From 72534f9ec6dacd3d8a9c790c8165d706442cc6e3 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 09:07:43 +0000 Subject: [PATCH 3/4] releaser: Add release notes to /docs for release of 0.36.1 [ci skip] --- content/news/0.36.1-relnotes-ready.md | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 content/news/0.36.1-relnotes-ready.md diff --git a/content/news/0.36.1-relnotes-ready.md b/content/news/0.36.1-relnotes-ready.md new file mode 100644 index 000000000..68063489f --- /dev/null +++ b/content/news/0.36.1-relnotes-ready.md @@ -0,0 +1,45 @@ + +--- +date: 2018-02-15 +title: "0.36.1" +description: "0.36.1" +slug: "0.36.1" +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + + This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := $big.Resize "512x" }} +{{ end }} +``` + +There would be timing issues making Hugo in some cases trying to process the same image twice at the same time. + +You would experience errors of type: + +```bash +png: invalid format: not enough pixel data +``` + +This commit fixes that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work. + +The current workaround before this fix is to always operate on the original: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := .Fill "512x256 top" }} +{{ end }} +``` +This error was rare (no reports on GitHub or the discussion forum), but very hard to debug for the end user. + +* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) +* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) +* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) +* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) From dd7370fc4e12ba3627d5f40893153e59c3dbdfa1 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 15 Feb 2018 09:10:09 +0000 Subject: [PATCH 4/4] releaser: Prepare repository for 0.37-DEV [ci skip] --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 0147f8df8..53e4e9afa 100644 --- a/config.toml +++ b/config.toml @@ -71,7 +71,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.36.1" + release = "0.37-DEV" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash)