Commit Graph

153 Commits

Author SHA1 Message Date
Bjørn Erik Pedersen db782ea467 deps: Update github.com/alecthomas/chroma v0.9.4 => v0.10.0 2022-02-15 10:37:14 +01:00
Bjørn Erik Pedersen cdb0683468 docs: Regenerate docshelper 2022-01-12 08:17:03 +01:00
Bjørn Erik Pedersen 70156962aa docs: Regenerate docshelper 2022-01-04 17:11:17 +01:00
Bjørn Erik Pedersen af2970180d 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 fca266ebbb.
2021-12-23 16:23:15 +01:00
Bjørn Erik Pedersen b343bfd7aa config/security: Add HOME to default exec env var whitelist
See #9309
2021-12-22 11:33:59 +01:00
Bjørn Erik Pedersen 467256ad5a docs: Regen docs helper 2021-12-17 10:31:08 +01:00
Bjørn Erik Pedersen 68554cf77c 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
Bjørn Erik Pedersen e2b6f990b8 docs: Regenerate docs helper 2021-12-08 08:56:16 +01:00
Joe Mooring 9cbd1c15af 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
Joe Mooring e33d29b02e Fix broken links (#1538)
There are still several broken links in old release notes, but I'm not
not going to worry about those right now...

- /news/0.7-relnotes/
- /news/0.10-relnotes/
- /news/0.11-relnotes/
- /news/0.12-relnotes/
- /news/0.13-relnotes/
2021-10-12 06:13:13 -07:00
Bjørn Erik Pedersen 0009c51c35 Update docs helper 2021-08-03 16:57:00 +02:00
Bjørn Erik Pedersen 1b4682cd84 docs: Regen docs helper 2021-08-03 11:53:34 +02:00
Bjørn Erik Pedersen 198cdf8f04 tpl/lang: Add new localized versions of lang.FormatNumber etc.
Fixes #8820
2021-07-29 16:40:06 +02:00
Bjørn Erik Pedersen 6bb8800f76 docs: Regenerate docs helper 2021-06-18 13:21:10 +02:00
Bjørn Erik Pedersen 00a522e6ad docs: Regenerate docshelper 2021-06-18 12:58:07 +02:00
Bjørn Erik Pedersen ef73ffc3bc 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
Bjørn Erik Pedersen 0b4117f7f6 docs: Regenerate docs helper 2021-06-08 18:52:38 +02:00
Bjørn Erik Pedersen e789c879ab docs: Regenerate docs helper 2021-05-01 12:06:24 +02:00
Bjørn Erik Pedersen a6bf3f7d95 docs: Regen docs helper 2021-04-20 20:23:36 +02:00
Bjørn Erik Pedersen 698f15466b Regenerate the docshelper
See https://github.com/gohugoio/hugo/issues/8379
2021-04-01 19:04:26 +02:00
Bjørn Erik Pedersen 32efaed78b docs: Regenerate docs helper 2021-03-21 13:33:26 +01:00
Bjørn Erik Pedersen 8c3e8b2701 docs: Regen docs helper 2021-02-18 17:54:25 +01:00
Bjørn Erik Pedersen 2631df94ea 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
Bjørn Erik Pedersen 0f76cf66c5 docs: Regen docshelper 2020-11-24 13:49:01 +01:00
Bjørn Erik Pedersen 1c120aef01 Revert "docs: Regenerate docshelper"
This reverts commit caf16c2085.

Closes #7972
2020-11-21 12:48:48 +01:00
Bjørn Erik Pedersen 7b60b56247 docs: Regenerate docshelper 2020-11-20 09:32:16 +01:00
Bjørn Erik Pedersen 09a2a31990 docs: Regen docs helper 2020-10-30 09:52:32 +01:00
Bjørn Erik Pedersen 7fa1cd9126 docs: Regen docshelper 2020-10-06 16:25:23 +02:00
Helder Pereira 0c70c47b2c markup/asciidocext: Add preserveTOC option 2020-09-17 10:50:25 +02:00
Bjørn Erik Pedersen e3525de23c docs: Regen docs helper 2020-09-13 21:58:38 +02:00
Bjørn Erik Pedersen c7bac967d0 docs: Regen docs helper 2020-09-07 21:45:16 +02:00
Bjørn Erik Pedersen 4b7054be50 docs: Regenerate docs helper 2020-07-13 11:01:38 +02:00
Bjørn Erik Pedersen bc0b484d1b 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
Bjørn Erik Pedersen b877781659 Merge commit 'efa74c5c6e6ff1daddeb5834ea7c69bed2acf171' 2020-06-16 14:19:31 +02:00
Christian Oliff d04196bbdd Minor spelling and capitalization fixes 2020-06-10 12:50:40 +02:00
Edouard c7cdebed38 tpl/crypto: Add hmac 2020-06-05 20:04:11 +02:00
Bjørn Erik Pedersen 9737b34e9d docs: Regen docs helper 2020-04-10 09:07:41 +02:00
Bjørn Erik Pedersen 0f98184b09 Some minify configuration adjustments 2020-03-20 20:35:57 +01:00
SatowTakeshi 02219f7877 Add minify config
Fixes #6750
Updates #6892
2020-03-20 20:35:57 +01:00
Bjørn Erik Pedersen 90feaac39b docs, output: Add base template lookup variant to docs.json 2020-01-23 11:59:52 +01:00
Bjørn Erik Pedersen 1f7466a765 docs: Regen docs helper 2020-01-23 11:55:08 +01:00
Bjørn Erik Pedersen 406a8a9a65 docs: Regenerate docshelper
See #6707
See #6616
2020-01-05 11:57:49 +01:00
Bjørn Erik Pedersen 98c8c8638e tpl: Add a warnf template func
Fixes #6628
2019-12-21 10:23:00 +01:00
Bjørn Erik Pedersen 4a9d76cead docs: Regen docshelper 2019-12-19 23:48:01 +01:00
John Zaitseff 626e53b550 Fix incorrect MIME type from image/jpg to image/jpeg
According to multiple sources, both official ([IANA] and [RFC2046]) and
otherwise (eg, [Mozilla] and [Wikipedia]), the official MIME type for
JPEG images is `image/jpeg`, not `image/jpg`.  Change Hugo to match.

[IANA]: https://www.iana.org/assignments/media-types/media-types.xhtml#image
[RFC2046]: https://tools.ietf.org/html/rfc2046
[Mozilla]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types
[Wikipedia]: https://en.wikipedia.org/wiki/JPEG
2019-12-19 18:02:11 +01:00
Bjørn Erik Pedersen 0ea6b2012a Update homepagetweets.toml 2019-11-27 18:25:40 +01:00
Bjørn Erik Pedersen ded74f0982 Add Goldmark as the new default markdown handler
This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo.

If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration:

```toml
[markup]
defaultMarkdownHandler="blackfriday"
```

Fixes #5963
Fixes #1778
Fixes #6355
2019-11-23 14:12:24 +01:00
Liam OBrien 806102d10d Remove homepage Tweet (Account no longer exists)
@carriecoxwell does not exist. Flagged in #953
2019-10-25 21:45:05 +02:00
Bjørn Erik Pedersen fdea5430f8 Merge branch 'temp59_' into next 2019-10-21 10:18:56 +02:00
Jamie Tanna 8c6e4a071e deps: Upgrade to latest version of emoji dependency
To add support for new emojis in Hugo, we need to upgrade our internal
dependency on the emoji package.

Note that we also need to update our tests, as the underlying emoji that
is rendered has changed.

Follow-up to #6391. (170f18d935 and
2df5d202c6)
2019-10-05 22:58:53 +02:00