$page.RenderString` (see 6703) finally supports shortcodes, and shortcode improvements is the main theme in Hugo 0.100.0.
**Indentation fixes for shortcode blocks:** We now record the indentation before the opening shortcode tag when parsing the source. This allow us to fix a couple of annoying issues in Hugo:
1. We have added a new `.InnerIndent` method to the shortcode context to prevent the `highlight` shortcode from including in the indentation as part of the code block. See 4717.
2. Hugo now preserves the indentation for shortcode blocks. See more below.
A shortcode block is when the shortcode is included as the first non-whitespace content on a line. Note that this does not touch shortcodes with inner content, where the user is in control of the indentation. See issue 9946 for more information. An example, say that I have this in `layouts/shortcodes/mylist.md`:
md
* Culpa enim incididunt fugiat id dolore velit laboris veniam minim.
* Tempor ex nisi labore ad elit laborum ex ullamco aute labore eu occaecat.
* Deserunt mollit aliqua est laboris et irure eu non.
* Consectetur nulla minim non reprehenderit Lorem elit dolore quis.
And then use that shortcode in a content file:
md
* My List
{{% mylist %}}
In earlier versions of Hugo the above would render as:
<img width="582" alt="image" src="https://user-images.githubusercontent.com/394382/170958104-36a4673f-e51a-4b37-b0e8-6a0fda476929.png">
Now it renders as:
<img width="604" alt="image" src="https://user-images.githubusercontent.com/394382/170957864-028d1e64-b383-4681-b844-f9075e04d8ff.png">
Note that in the example above we use the `md` file suffix for the shortcode. In this release we also added `Markdown` as a built-in output format in Hugo, defined as a plain text format, meaning you get more lenient parsing compared to HTML. Using this if your shortcode produces Markdown has fewer quirks. See 9821.
Also noteworthy is the new template function [resources.Copy](https://gohugo.io/hugo-pipes/introduction/#copy-a-resource) which allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
htmlbars
{{ $resized := $image.Resize "400x400" | resources.Copy "images/mynewname.jpg" } }}
<img src="{{ $resized.RelPermalink }}">
This release represents **32 contributions by 4 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 [dependabot[bot]](https://github.com/apps/dependabot), [satotake](https://github.com/satotake), and [moorereason](https://github.com/moorereason) for their ongoing contributions.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **1 contributions by 1 contributors**.
Hugo now has:
* 59255+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 428+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 399+ [themes](http://themes.gohugo.io/)
Notes
* The methods on Page `IsDescendant` and `IsAncestor` now return false for itself, which is obviously the correct behaviour. We have fixed this before, but reverted it because it broke some theme's logic. Looking back, that reversion was a mistake. If you want the old logic you can get that by doing something ala `{{ if or (eq $p1 $p2) ($p1.IsAncestor $p2) }}{{ end }}` 9925
* We have removed Blackfriday as a Markdown option. It has been deprecated for a long time, its v1 version is not maintained anymore, and there are many known issues. Goldmark should be a mature replacement by now. 9944
Changes
* docs: Regen CLI docs 3fcbee26 bep
* docs: Regen docs helper db9d2742 bep
* Fix indentation in highlight shortcode 6f7bf3f2 bep 4717
* Make .RenderString render shortcodes 9e904d75 bep 6703
* Improve shortcode indentation handling d2cfaede bep 9946
* Add Markdown as an output format 322d19a8 bep 9821
* build(deps): bump github.com/evanw/esbuild from 0.14.39 to 0.14.42 7cb484e1 dependabot[bot]
* Run go mod tidy 0b395f0b bep
* Add a shortcode benchmark c1a83076 bep
* Remove Blackfriday markdown engine 0f8dc470 bep 9934
* Fix HasMenuCurrent and IsDescendant/IsAncestor when comparing to itself 3b478f50 bep 9846
* build(deps): bump github.com/sanity-io/litter from 1.5.4 to 1.5.5 f343b8eb dependabot[bot]
* deps: Update to github.com/tdewolff/minify/v2 v2.11.5 60ede146 bep
* Don't use the baseURL /path as part of the resource cache key dd9eaf19 bep 9787
* postcss: Make the resource cache key more stable 46a2ea6d bep 9787
* commands: Fix case where languages cannot be configured 653ab2cc bep
* github: Set HUGO_BUILD_TAGS: extended when running tests 52edea0f bep 9935
* metrics: Fix divide by zero error 6a5acd75 moorereason
* Fix error message when PostCSS config file is not found 805b2155 bep 9927
* server: Skip watching dirs in ignoreFiles 8ca70525 bep 9838
* resources: Improve error message on .Resize etc. on SVGs bb232a35 bep 9875
* Fix Plainify edge cases 3854a6fa bep 9199 9909 9410
* Add resources.Copy cd0112a0 bep 9313
* basefs: add `noBuildLock` flag 6f7fbe03 satotake 9780
* import: Fix importing jekyll site 2fc2e9c8 satotake 9817
* releaser: Prepare repository for 0.100.0-DEV e164834f bep
* releaser: Bump versions for release of 0.99.1 d5240673 bep
* releaser: Add release notes for 0.99.1 [ci skip] 31ce89f7 bep
* releaser: Fix version replacement ee55fde5 bep
* server: Fix multihost crash 2f9eac48 bep 9901
* Update stale.yml 3a8189ee bep
* common/hugo: Fix version logic 7bc3401e bep