Commit graph

336 commits

Author SHA1 Message Date
hugoreleaser
41cc4e4ba3 releaser: Prepare repository for 0.98.0-DEV
[ci skip]
2022-04-18 18:01:38 +00:00
hugoreleaser
078053a43d releaser: Bump versions for release of 0.97.3
[ci skip]
2022-04-18 17:22:19 +00:00
hugoreleaser
5de6f8a02c releaser: Prepare repository for 0.98.0-DEV
[ci skip]
2022-04-17 09:16:40 +00:00
hugoreleaser
5099abe600 releaser: Bump versions for release of 0.97.2
[ci skip]
2022-04-17 08:39:27 +00:00
hugoreleaser
363bc907c0 releaser: Prepare repository for 0.98.0-DEV
[ci skip]
2022-04-16 17:35:04 +00:00
hugoreleaser
04efcb2a68 releaser: Bump versions for release of 0.97.1
[ci skip]
2022-04-16 16:57:30 +00:00
hugoreleaser
d0f731c039 releaser: Prepare repository for 0.98.0-DEV
[ci skip]
2022-04-14 09:24:30 +00:00
hugoreleaser
c07f3626e7 releaser: Bump versions for release of 0.97.0
[ci skip]
2022-04-14 08:45:07 +00:00
Bjørn Erik Pedersen
2dbdf38a54 resources: Add key to reources.GetRemote options map
If set, `key` will be used as the only cache key element for the resource.

The default behaviour is to calculate the key based on the URL and all the options.

This means that you can now do:

```
{{ $cacheKey := print $url (now.Format "2006-01-02") }}
{{ $resource := resource.GetRemote $url (dict "key" $cacheKey) }}
```

Fixes #9755
2022-04-13 09:18:17 +02:00
Bjørn Erik Pedersen
d070bdf10f
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
2022-04-08 13:26:17 +02:00
Bjørn Erik Pedersen
e58a540895 resources: Create a common ResourceFinder interface
And make both .Resources and resources implement it.

This gets us 2 new methods/functions, so you can now also do:

* .Resources.Get
* resources.ByType

Note that GetRemote is not covered by this interface, as that is only available as a global template function.

Fixes #8653
2022-04-05 18:00:44 +02:00
hugoreleaser
69c590080f releaser: Prepare repository for 0.97.0-DEV
[ci skip]
2022-03-26 09:53:13 +00:00
hugoreleaser
2fd4a7d3d6 releaser: Bump versions for release of 0.96.0
[ci skip]
2022-03-26 09:15:58 +00:00
Panagiotis Koursaris
a461e9d01a Fix typo 2022-03-22 00:39:33 -06:00
Bjørn Erik Pedersen
b80853de90
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
2022-03-17 22:03:27 +01:00
Bjørn Erik Pedersen
64afb7ca51 Use revision etc. from debug.BuildInfo
Fixes #9680
2022-03-17 17:14:38 +01:00
hugoreleaser
004bec2e9a releaser: Prepare repository for 0.96.0-DEV
[ci skip]
2022-03-16 15:00:05 +00:00
hugoreleaser
9f2e76af65 releaser: Bump versions for release of 0.95.0
[ci skip]
2022-03-16 14:20:17 +00:00
hugoreleaser
38f778cfcc releaser: Prepare repository for 0.95.0-DEV
[ci skip]
2022-03-12 11:02:38 +00:00
hugoreleaser
48fb9e4de3 releaser: Bump versions for release of 0.94.2
[ci skip]
2022-03-12 10:28:41 +00:00
hugoreleaser
04ccde3e94 releaser: Prepare repository for 0.95.0-DEV
[ci skip]
2022-03-11 14:30:03 +00:00
hugoreleaser
0fcd9a5d87 releaser: Bump versions for release of 0.94.1
[ci skip]
2022-03-11 13:53:32 +00:00
hugoreleaser
3bc34666c8 releaser: Prepare repository for 0.95.0-DEV
[ci skip]
2022-03-10 10:25:00 +00:00
hugoreleaser
63b236603e releaser: Bump versions for release of 0.94.0
[ci skip]
2022-03-10 09:46:35 +00:00
Bjørn Erik Pedersen
4e14cf7607
Fail with error when double-rendering text in markdownify/RenderString
This commit prevents the most commons case of infinite recursion in link render hooks when the `linkify` option is enabled (see below). This is always a user error, but getting a `stack overflow` (the current stack limit in Go is 1 GB on 64-bit, 250 MB on 32-bit) error isn't very helpful. This fix will not prevent all such errors, though, but we may do better once #9570 is in place.

So, these will fail:

```
<a href="{{ .Destination | safeURL }}" >{{ .Text | markdownify }}</a>
<a href="{{ .Destination | safeURL }}" >{{ .Text | .Page.RenderString }}</a>
```

`.Text` is already rendered to `HTML`. The above needs to be rewritten to:

```
<a href="{{ .Destination | safeURL }}" >{{ .Text | safeHTML }}</a>
<a href="{{ .Destination | safeURL }}" >{{ .Text | safeHTML }}</a>
```

Fixes #8959
2022-03-10 08:19:03 +01:00
Bjørn Erik Pedersen
4576c82ed4 Cache reflect.MethodByName
The isolated benchmark for the function is obviously much faster:

```bash
name                old time/op    new time/op    delta
GetMethodByName-10    1.21µs ± 7%    0.23µs ± 5%   -81.42%  (p=0.029 n=4+4)

name                old alloc/op   new alloc/op   delta
GetMethodByName-10      680B ± 0%        0B       -100.00%  (p=0.029 n=4+4)

name                old allocs/op  new allocs/op  delta
GetMethodByName-10      20.0 ± 0%       0.0       -100.00%  (p=0.029 n=4+4)
```

But more pleasing is the overall performance looking at the site benchmarks:

```bash
name                                      old time/op    new time/op    delta
SiteNew/Regular_Bundle_with_image-10        6.25ms ± 2%    6.10ms ± 2%     ~     (p=0.057 n=4+4)
SiteNew/Regular_Bundle_with_JSON_file-10    6.30ms ± 2%    5.66ms ±11%     ~     (p=0.057 n=4+4)
SiteNew/Regular_Tags_and_categories-10      22.2ms ± 2%    17.4ms ± 1%  -21.88%  (p=0.029 n=4+4)
SiteNew/Regular_Canonify_URLs-10             108ms ± 0%     107ms ± 0%   -1.20%  (p=0.029 n=4+4)
SiteNew/Regular_Deep_content_tree-10        36.1ms ± 1%    33.8ms ± 1%   -6.44%  (p=0.029 n=4+4)
SiteNew/Regular_TOML_front_matter-10        24.9ms ± 1%    22.6ms ± 1%   -9.30%  (p=0.029 n=4+4)
SiteNew/Regular_Many_HTML_templates-10      17.9ms ± 1%    16.7ms ± 1%   -6.43%  (p=0.029 n=4+4)
SiteNew/Regular_Page_collections-10         23.3ms ± 1%    22.0ms ± 0%   -5.58%  (p=0.029 n=4+4)
SiteNew/Regular_List_terms-10               8.00ms ± 1%    7.63ms ± 0%   -4.62%  (p=0.029 n=4+4)

name                                      old alloc/op   new alloc/op   delta
SiteNew/Regular_Bundle_with_image-10        2.10MB ± 0%    2.07MB ± 0%   -1.46%  (p=0.029 n=4+4)
SiteNew/Regular_Bundle_with_JSON_file-10    1.88MB ± 0%    1.85MB ± 0%   -1.76%  (p=0.029 n=4+4)
SiteNew/Regular_Tags_and_categories-10      13.5MB ± 0%    11.6MB ± 0%  -13.99%  (p=0.029 n=4+4)
SiteNew/Regular_Canonify_URLs-10            96.1MB ± 0%    95.8MB ± 0%   -0.40%  (p=0.029 n=4+4)
SiteNew/Regular_Deep_content_tree-10        28.4MB ± 0%    27.3MB ± 0%   -3.83%  (p=0.029 n=4+4)
SiteNew/Regular_TOML_front_matter-10        16.9MB ± 0%    15.1MB ± 0%  -10.58%  (p=0.029 n=4+4)
SiteNew/Regular_Many_HTML_templates-10      8.98MB ± 0%    8.44MB ± 0%   -6.04%  (p=0.029 n=4+4)
SiteNew/Regular_Page_collections-10         17.1MB ± 0%    16.5MB ± 0%   -3.91%  (p=0.029 n=4+4)
SiteNew/Regular_List_terms-10               3.92MB ± 0%    3.72MB ± 0%   -5.03%  (p=0.029 n=4+4)

name                                      old allocs/op  new allocs/op  delta
SiteNew/Regular_Bundle_with_image-10         25.8k ± 0%     24.9k ± 0%   -3.49%  (p=0.029 n=4+4)
SiteNew/Regular_Bundle_with_JSON_file-10     25.8k ± 0%     24.9k ± 0%   -3.49%  (p=0.029 n=4+4)
SiteNew/Regular_Tags_and_categories-10        288k ± 0%      233k ± 0%  -18.90%  (p=0.029 n=4+4)
SiteNew/Regular_Canonify_URLs-10              375k ± 0%      364k ± 0%   -2.80%  (p=0.029 n=4+4)
SiteNew/Regular_Deep_content_tree-10          314k ± 0%      283k ± 0%   -9.77%  (p=0.029 n=4+4)
SiteNew/Regular_TOML_front_matter-10          302k ± 0%      252k ± 0%  -16.55%  (p=0.029 n=4+4)
SiteNew/Regular_Many_HTML_templates-10        133k ± 0%      117k ± 0%  -11.81%  (p=0.029 n=4+4)
SiteNew/Regular_Page_collections-10           202k ± 0%      183k ± 0%   -9.55%  (p=0.029 n=4+4)
SiteNew/Regular_List_terms-10                55.6k ± 0%     49.8k ± 0%  -10.40%  (p=0.029 n=4+4)
```

Thanks to @quasilyte for the suggestion.

Fixes 9386
2022-03-08 19:36:55 +01:00
hugoreleaser
d86eca5bb2 releaser: Prepare repository for 0.94.0-DEV
[ci skip]
2022-03-08 10:50:30 +00:00
hugoreleaser
44e3c002a8 releaser: Bump versions for release of 0.93.3
[ci skip]
2022-03-08 10:15:27 +00:00
hugoreleaser
9e76507da2 releaser: Prepare repository for 0.94.0-DEV
[ci skip]
2022-03-04 12:57:53 +00:00
hugoreleaser
643b5ae9cf releaser: Bump versions for release of 0.93.2
[ci skip]
2022-03-04 12:21:48 +00:00
hugoreleaser
883e71c96a releaser: Prepare repository for 0.94.0-DEV
[ci skip]
2022-03-02 12:52:43 +00:00
hugoreleaser
e9669fed14 releaser: Bump versions for release of 0.93.1
[ci skip]
2022-03-02 12:16:06 +00:00
Bjørn Erik Pedersen
376704d382 tpl/collections: Fix apply when function have Context as first arg
As introduced in `partial` and `partialCached` in Hugo 0.93.0.

Fixes #9585
2022-03-01 13:18:02 +01:00
hugoreleaser
5a1b394f2a releaser: Prepare repository for 0.94.0-DEV
[ci skip]
2022-02-28 09:05:08 +00:00
hugoreleaser
0746908247 releaser: Bump versions for release of 0.93.0
[ci skip]
2022-02-28 08:30:42 +00:00
Bjørn Erik Pedersen
10928a4f78 Remove the trailing new line in .Code
Fixes #9572
2022-02-26 21:54:36 +01:00
Bjørn Erik Pedersen
08fdca9d93 Add Markdown diagrams and render hooks for code blocks
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`).

We also used this new hook to add support for diagrams in Hugo:

* Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams.
* Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information.

Updates #7765
Closes #9538
Fixes #9553
Fixes #8520
Fixes #6702
Fixes #9558
2022-02-24 18:59:50 +01:00
hugoreleaser
9433cc2562 releaser: Prepare repository for 0.93.0-DEV
[ci skip]
2022-02-11 14:54:18 +00:00
hugoreleaser
cdf6a0d622 releaser: Bump versions for release of 0.92.2
[ci skip]
2022-02-11 14:17:39 +00:00
Joe Mooring
4f4cec73be Add HUGO_ENV to the os/exec environment
Closes #9490
2022-02-11 08:30:26 +01:00
Joe Mooring
c05c99f0c5 Fix typo in panicOnWarning message 2022-01-27 17:50:34 +01:00
hugoreleaser
ff7689ce02 releaser: Prepare repository for 0.93.0-DEV
[ci skip]
2022-01-27 12:22:31 +00:00
hugoreleaser
85e2e86266 releaser: Bump versions for release of 0.92.1
[ci skip]
2022-01-27 11:44:40 +00:00
Bjørn Erik Pedersen
348d300a71 common: Remove unused code 2022-01-16 17:12:56 +01:00
Bjørn Erik Pedersen
6f07bdb152 common/paths: Remove unused code 2022-01-16 17:12:56 +01:00
hugoreleaser
ed04ed5745 releaser: Prepare repository for 0.93.0-DEV
[ci skip]
2022-01-12 08:58:07 +00:00
hugoreleaser
b354940369 releaser: Bump versions for release of 0.92.0
[ci skip]
2022-01-12 08:23:17 +00:00
Bjørn Erik Pedersen
7396aa945a Add hugo.Deps
Fixes #8949
2022-01-11 18:06:23 +01:00
Bjørn Erik Pedersen
c8b5ab75b7 Add --panicOnWarning flag
Fixes #9357
Fixes #9359
2022-01-06 12:27:04 +01:00
hugoreleaser
1dbfc0f930 releaser: Prepare repository for 0.92.0-DEV
[ci skip]
2021-12-23 16:10:18 +00:00