1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

100 Commits

Author SHA1 Message Date
0cb459a20a docs: Regen docshelper 2022-06-16 07:23:38 +02:00
db9d274275 docs: Regen docs helper 2022-05-31 10:23:20 +02:00
a4fff5753f docs: Regen docs helper 2022-04-28 11:53:03 +02:00
3117e58595 deps: Update github.com/tdewolff/minify/v2 v2.10.0 => v2.11.0
Fixes #9713
Fixes #9740

Adds support for minify.tdewolff.svg.keepComments (bool)
2022-04-08 21:44:29 +02:00
db1562e134 docs: Regen docshelper 2022-03-26 11:06:04 +02:00
a4ac188c19 docs: Regenerate docshelper 2022-03-10 10:08:04 +01:00
cdb8b0842b docs: Regenerate docshelper 2022-03-09 11:33:53 +01:00
1f8cd2614d docs: Regenerate docshelper 2022-03-08 19:40:07 +01:00
12d00d288c docs: Regenerate docs helper 2022-02-28 08:59:57 +01:00
ea54a99ca5 deps: Update github.com/alecthomas/chroma v0.9.4 => v0.10.0 2022-02-15 10:37:14 +01:00
f2bc13dd9e docs: Regenerate docshelper 2022-01-12 08:17:03 +01:00
4a0b55330c docs: Regenerate docshelper 2022-01-04 17:11:17 +01:00
623dda7174 Revert "config/security: Add HOME to default exec env var whitelist"
There have been one report in the wild suggesting that this needs to be tested better before doing:

https://discourse.gohugo.io/t/hugo-mod-failing-in-v0-91-1-but-works-in-v0-91-0/36180/5

This reverts commit fca266ebbb81af3d4479873a7a79759033c7ce25.
2021-12-23 16:23:15 +01:00
fca266ebbb config/security: Add HOME to default exec env var whitelist
See #9309
2021-12-22 11:33:59 +01:00
6df2f080c9 docs: Regen docs helper 2021-12-17 10:31:08 +01:00
f4389e48ce Add some basic security policies with sensible defaults
This ommmit contains some security hardening measures for the Hugo build runtime.

There are some rarely used features in Hugo that would be good to have disabled by default. One example would be the "external helpers".

For `asciidoctor` and some others we use Go's `os/exec` package to start a new process.

These are a predefined set of binary names, all loaded from `PATH` and with a predefined set of arguments. Still, if you don't use `asciidoctor` in your project, you might as well have it turned off.

You can configure your own in the new `security` configuration section, but the defaults are configured to create a minimal amount of site breakage. And if that do happen, you will get clear instructions in the loa about what to do.

The default configuration is listed below. Note that almost all of these options are regular expression _whitelists_ (a string or a slice); the value `none` will block all.

```toml
[security]
  enableInlineShortcodes = false
  [security.exec]
    allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']

  [security.funcs]
    getenv = ['^HUGO_']

  [security.http]
    methods = ['(?i)GET|POST']
    urls = ['.*']
```
2021-12-16 09:40:22 +01:00
e86b331138 docs: Regenerate docs helper 2021-12-08 08:56:16 +01:00
04a3b45db4 Fix description of lang.FormatNumberCustom
It currently refers to itself as a simple alternative, when it should
refer to lang.FormatNumber.
2021-11-01 18:54:43 +01:00
4b36498a85 Merge commit 'aa5ac36a3eb68b86c803caec703869efefc8447e' 2021-10-31 13:53:55 +01:00
8d19850e2d docs: Regen docs helper 2021-08-03 11:53:34 +02:00
7907d24ba1 tpl/lang: Add new localized versions of lang.FormatNumber etc.
Fixes #8820
2021-07-29 16:40:06 +02:00
be6b901cf7 docs: Regenerate docs helper 2021-06-18 13:21:10 +02:00
402da3f8f3 docs: Regenerate docshelper 2021-06-18 12:58:07 +02:00
d392893cd7 Misc config loading fixes
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster:

```
BenchmarkDefaultConfigProvider/Viper-16         	  252418	      4546 ns/op	    2720 B/op	      30 allocs/op
BenchmarkDefaultConfigProvider/Custom-16        	  450756	      2651 ns/op	    1008 B/op	       6 allocs/op
```

Fixes #8633
Fixes #8618
Fixes #8630
Updates #8591
Closes #6680
Closes #5192
2021-06-14 17:00:32 +02:00
a91cd7652f docs: Regenerate docs helper 2021-06-08 18:52:38 +02:00
a9b52b4175 docs: Regenerate docs helper 2021-05-01 12:06:24 +02:00
fd96f65a3d docs: Regen docs helper 2021-04-20 20:23:36 +02:00
8f7891e70c Merge commit '07b8d9466dfb59c429c1b470a0443337bc0aeefe' 2021-04-20 20:22:53 +02:00
86b4fd35e7 docs: Regenerate docs helper 2021-03-21 13:33:26 +01:00
1b364b003f docs: Regen docs helper 2021-02-18 17:54:25 +01:00
2681633db8 markup/goldmark: Add attributes support for blocks (tables etc.)
E.g.:

```
> foo
> bar
{.myclass}
```

There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.:

```
* Fruit
  * Apple
  * Orange
  * Banana
  {.fruits}
* Dairy
  * Milk
  * Cheese
  {.dairies}
{.list}
```

Fixes #7548
2021-02-08 19:52:55 +01:00
fd70bdafe7 docs: Regen docshelper 2020-11-24 13:49:01 +01:00
20a35374a3 Revert "docs: Regenerate docshelper"
This reverts commit caf16c20853947138883f6460682e19733895f52.

Closes #7972
2020-11-21 12:48:48 +01:00
caf16c2085 docs: Regenerate docshelper 2020-11-20 09:32:16 +01:00
332b65e4cc docs: Regen docs helper 2020-10-30 09:52:32 +01:00
b9318e4315 docs: Regen docshelper 2020-10-06 16:25:23 +02:00
8e553dcdef markup/asciidocext: Add preserveTOC option 2020-09-17 10:50:25 +02:00
be2404c8b1 docs: Regen docs helper 2020-09-13 21:58:38 +02:00
e6cd9da42d docs: Regen docs helper 2020-09-07 21:45:16 +02:00
25e3da3343 docs: Regenerate docs helper 2020-07-13 11:01:38 +02:00
fc045e12a9 Rename taxonomy kinds from taxonomy to term, taxonomyTerm to taxonomy
And we have taken great measures to limit potential site breakage:

* For `disableKinds` and `outputs` we try to map from old to new values if possible, if not we print an ERROR that can be toggled off if not relevant.
* The layout lookup is mostly compatible with more options for the new `term` kind.

That leaves:

* Where queries in site.Pages using taxonomy/taxonomyTerm Kind values as filter.
* Other places where these kind value are used in the templates (classes etc.)

Fixes #6911
Fixes #7395
2020-06-18 09:09:56 +02:00
0a9172672a Merge commit 'efa74c5c6e6ff1daddeb5834ea7c69bed2acf171' 2020-06-16 14:19:31 +02:00
7eeebe1e5a tpl/crypto: Add hmac 2020-06-05 20:04:11 +02:00
b7ff4dc23e docs: Regen docs helper 2020-04-10 09:07:41 +02:00
7204b354a9 Some minify configuration adjustments 2020-03-20 20:35:57 +01:00
574c2959b8 Add minify config
Fixes #6750
Updates #6892
2020-03-20 20:35:57 +01:00
cafb1d53c0 docs, output: Add base template lookup variant to docs.json 2020-01-23 11:59:52 +01:00
4f466db666 docs: Regen docs helper 2020-01-23 11:55:08 +01:00
81b7e48a55 docs: Regenerate docshelper
See #6707
See #6616
2020-01-05 11:57:49 +01:00
1773d71d5b tpl: Add a warnf template func
Fixes #6628
2019-12-21 10:23:00 +01:00