diff --git a/config.toml b/config.toml index efa1b0573..8c6480681 100644 --- a/config.toml +++ b/config.toml @@ -7,7 +7,7 @@ footnotereturnlinkcontents = "↩" languageCode = "en-us" title = "Hugo" - ignoreErrors = ["error-remote-getjson"] + ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] googleAnalytics = "UA-7131036-4" diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index 5b3dce57f..40af0d6ab 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -181,6 +181,8 @@ Only relevant for JPEG and WebP images, values 1 to 100 inclusive, higher is bet {{< new-in "0.83.0" >}} + {{< new-in "0.83.0" >}} + Hint about what type of image this is. Currently only used when encoding to WebP. Default value is `photo`. diff --git a/content/en/functions/errorf.md b/content/en/functions/errorf.md index 450e92679..a20ad4f44 100644 --- a/content/en/functions/errorf.md +++ b/content/en/functions/errorf.md @@ -31,3 +31,22 @@ Both functions return an empty string, so the messages are only printed to the c ``` Note that `errorf` and `warnf` support all the formatting verbs of the [fmt](https://golang.org/pkg/fmt/) package. + +## Suppress errors + +Some times it may make sense to let the user suppress an ERROR and make the build succeed. + +You can do this by using the `erroridf` function. This functions takes an error ID as the first arument. + + +`` +{{ erroridf "my-custom-error" "You should consider fixing this."}} +``` + +This will produce: + +``` +ERROR 2021/06/07 17:47:38 You should consider fixing this. +If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config: +ignoreErrors = ["my-custom-error"] +``` diff --git a/content/en/functions/math.md b/content/en/functions/math.md index 58cc5d5db..99b8cf34f 100644 --- a/content/en/functions/math.md +++ b/content/en/functions/math.md @@ -1,6 +1,6 @@ --- title: Math -description: Hugo provides nine mathematical operators in templates. +description: Hugo provides mathematical operators in templates. godocref: date: 2017-02-01 publishdate: 2017-02-01 @@ -35,7 +35,9 @@ aliases: [] | `modBool` | Boolean of modulus of two integers. Evaluates to `true` if result equals 0. | `{{modBool 15 3}}` → `true` | | `math.Ceil` | Returns the least integer value greater than or equal to the given number. | `{{math.Ceil 2.1}}` → `3` | | `math.Floor` | Returns the greatest integer value less than or equal to the given number. | `{{math.Floor 1.9}}` → `1` | -| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{math.Round 1.5}}` → `2` | | `math.Log` | Returns the natural logarithm of the given number. | `{{math.Log 42}}` → `3.737` | -| `math.Sqrt` | Returns the square root of the given number. | `{{math.Sqrt 81}}` → `9` | +| `math.Max` | Returns the greater of two numbers. | `{{math.Max 1 2}}` → `2` | +| `math.Min` | Returns the smaller of two numbers. | `{{math.Min 1 2}}` → `1` | | `math.Pow` | Returns the first number raised to the power of the second number. | `{{math.Pow 2 3}}` → `8` | +| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{math.Round 1.5}}` → `2` | +| `math.Sqrt` | Returns the square root of the given number. | `{{math.Sqrt 81}}` → `9` | diff --git a/content/en/functions/querify.md b/content/en/functions/querify.md index e90e07450..7c361f326 100644 --- a/content/en/functions/querify.md +++ b/content/en/functions/querify.md @@ -1,7 +1,7 @@ --- title: querify linktitle: querify -description: Takes a set of key-value pairs and returns a query string to be appended to URLs. +description: Takes a set or slice of key-value pairs and returns a query string to be appended to URLs. date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 @@ -11,7 +11,7 @@ menu: parent: "functions" keywords: [urls] godocref: -signature: ["querify KEY VALUE [KEY VALUE]..."] +signature: ["querify KEY VALUE [KEY VALUE]...", "querify COLLECTION"] hugoversion: deprecated: false workson: [] @@ -19,16 +19,19 @@ relatedfuncs: [] aliases: [] --- -`querify` takes a set of key-value pairs and returns a [query string](https://en.wikipedia.org/wiki/Query_string) that can be appended to a URL. E.g. +`querify` takes a set or slice of key-value pairs and returns a [query string](https://en.wikipedia.org/wiki/Query_string) that can be appended to a URL. -The following example creates a link to a search results page on Google. +The following examples create a link to a search results page on Google. -``` +```go-html-template Search + +{{ $qs := slice "q" "test" "page" 3 }} +Search ``` -This example renders the following HTML: +Both of these examples render the following HTML: -``` +```html Search ``` diff --git a/content/en/functions/scratch.md b/content/en/functions/scratch.md index cadff5aa0..5b155aff9 100644 --- a/content/en/functions/scratch.md +++ b/content/en/functions/scratch.md @@ -114,6 +114,18 @@ Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to th {{ $scratch.Get "greetings" }} > map[french:Bonjour english:Hello] ``` +#### .DeleteInMap +Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`. + +```go-html-template +{{ .Scratch.SetInMap "greetings" "english" "Hello" }} +{{ .Scratch.SetInMap "greetings" "french" "Bonjour" }} +---- +{{ .Scratch.DeleteInMap "greetings" "english" }} +---- +{{ .Scratch.Get "greetings" }} > map[french:Bonjour] +``` + #### .GetSortedMapValues Return an array of values from `key` sorted by `mapKey`. diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index e60061bd0..05383dda3 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -80,6 +80,26 @@ Considering the structure above, when running `hugo --environment staging`, Hugo {{% note %}} Default environments are __development__ with `hugo server` and __production__ with `hugo`. {{%/ note %}} + +## Merge Configuration from Themes + +{{< new-in "0.84.0" >}} The configuration merge described below was improved in Hugo 0.84.0 and made fully configurable. The big change/improvement was that we now, by default, do deep merging of `params` maps from themes. + +The configuration value for `_merge` can be one of: + +none +: No merge. + +shallow +: Only add values for new keys. + +shallow +: Add values for new keys, merge existing. + +Note that you don't need to be so verbose as in the default setup below; a `_merge` value higher up will be inherited if not set. + +{{< code-toggle config="mergeStrategy" skipHeader=true />}} + ## All Configuration Settings The following is the full list of Hugo-defined variables with their default diff --git a/content/en/news/0.84.0-relnotes/featured.png b/content/en/news/0.84.0-relnotes/featured.png new file mode 100644 index 000000000..e733669e3 Binary files /dev/null and b/content/en/news/0.84.0-relnotes/featured.png differ diff --git a/content/en/news/0.84.0-relnotes/index.md b/content/en/news/0.84.0-relnotes/index.md new file mode 100644 index 000000000..3bd7b379a --- /dev/null +++ b/content/en/news/0.84.0-relnotes/index.md @@ -0,0 +1,160 @@ + +--- +date: 2021-06-18 +title: "Config Revamp" +description: "Hugo 0.84.0: Deep merge of theme configuration, config dir support now also in themes/modules, HTTP header support in getJSON, and more." +categories: ["Releases"] +--- + +**This release brings several configuration fixes and improvements that will be especially useful for themes.** + +## Deep merge of theme Params + +One of the most common complaint from Hugo theme owners/users has been about the configuration handling. Hugo has up until now only performed a shallow merge of theme `params` into the configuration. + +With that, given this example from a theme configuration: + +```toml +[params] +[params.colours] +blue="#337DFF" +green="#68FF33" +red="#FF3358" +``` + +If you would like to use the above theme, but want a different shade of red, you earlier had to copy the entire block, even the colours you're totally happy with. This was painful even the simplest setup. + +Now you can just override the `params` keys you want to change, e.g.: + +```toml +[params] +[params.colours] +red="#fc0f03" +``` + +For more information, and especially about the way you can opt out of the above behaviour, see [Merge Configuration from Themes](https://gohugo.io/getting-started/configuration/#merge-configuration-from-themes). + +## Themes now support the config directory + +Now both the project and themes/modules can store its configuration in both the top level config file (e.g. `config.toml`) or in the `config` directory. See [Configuration Directory](https://gohugo.io/getting-started/configuration/#configuration-directory). + +## HTTP headers in getJSON/getCSV + +`getJSON` now supports custom HTTP headers. This has been a big limitation in Hugo, especially considering the [Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) header. + +We have updated the internal Instagram shortcode to pass the access token in a header: + +``` +{{ $hideCaption := cond (eq (.Get 1) "hidecaption") "1" "0" }} +{{ $headers := dict "Authorization" (printf "Bearer %s" $accessToken) }} +{{ with getJSON "https://graph.facebook.com/v8.0/instagram_oembed/?url=https://instagram.com/p/" $id "/&hidecaption=" $hideCaption $headers }} + {{ .html | safeHTML }} +{{ end }} +``` + + Also see the discussion [this issue](https://github.com/gohugoio/hugo/issues/7879) about the access token above. + +## New erroridf template func + +Sometime, especially when creating themes, it is useful to be able to let the user decide if an error situation is critical enough to fail the build. The new `erroridf` produces `ERROR` log statements that can be toggled off: + +```html +{{ erroridf "some-custom-id" "Some error message." }} +``` + +Will log: + +``` +ERROR: Some error message. +If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config: +ignoreErrors = ["some-custom-id"] +``` +## Stats + +This release represents **46 contributions by 11 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 [@jmooring](https://github.com/jmooring), [@satotake](https://github.com/satotake), and [@Seirdy](https://github.com/Seirdy) for their ongoing contributions. +And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the themes site in pristine condition. + +Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), +which has received **20 contributions by 10 contributors**. A special thanks to [@salim-b](https://github.com/salim-b), [@bep](https://github.com/bep), [@thomasjsn](https://github.com/thomasjsn), and [@lucasew](https://github.com/lucasew) for their work on the documentation site. + + +Hugo now has: + +* 52487+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 432+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 370+ [themes](http://themes.gohugo.io/) + + +## Notes + +* We now do deep merging of `params` from theme config(s). That is you most likely what you want, but [Merge Configuration from Themes](https://gohugo.io/getting-started/configuration/#merge-configuration-from-themes) describes how you can get the old behaviour back. + +## Enhancements + +### Templates + +* Rename err-missing-instagram-accesstoken => error-missing-instagram-accesstoken [9096842b](https://github.com/gohugoio/hugo/commit/9096842b0494166e401cc08a70b93ae2ee19a198) [@bep](https://github.com/bep) +* Add a terse pagination template variant to improve performance [73483d0f](https://github.com/gohugoio/hugo/commit/73483d0f9eb46838d41640f88cc05c1d16811dc5) [@jmooring](https://github.com/jmooring) [#8599](https://github.com/gohugoio/hugo/issues/8599) +* Add erroridf template func [f55d2f43](https://github.com/gohugoio/hugo/commit/f55d2f43769053b80b419a690554e747dc5dcede) [@bep](https://github.com/bep) [#8613](https://github.com/gohugoio/hugo/issues/8613) +* Print response body on HTTP errors [282f1aa3](https://github.com/gohugoio/hugo/commit/282f1aa3db9f6420fdd360e46db1ffadd5b083a1) [@bep](https://github.com/bep) +* Misc header improvements, tests, allow multiple headers of same key [fcd63de3](https://github.com/gohugoio/hugo/commit/fcd63de3a54fadcd30972654d8eb86dc4d889784) [@bep](https://github.com/bep) [#5617](https://github.com/gohugoio/hugo/issues/5617) +* Allows user-defined HTTP headers with getJSON and getCSV [150d7573](https://github.com/gohugoio/hugo/commit/150d75738b54acddc485d363436757189144da6a) [@chamberlainpj](https://github.com/chamberlainpj) [#5617](https://github.com/gohugoio/hugo/issues/5617) +* Allow 'Querify' to take lone slice/interface argument [c46fc838](https://github.com/gohugoio/hugo/commit/c46fc838a9320adfc6532b1b543e903c48b3b4cb) [@importhuman](https://github.com/importhuman) [#6735](https://github.com/gohugoio/hugo/issues/6735) + +### Output + +* Make WebAppManifestFormat NotAlternative=true [643b6719](https://github.com/gohugoio/hugo/commit/643b671931ed5530855e7d4819896790bf3f6c28) [@bep](https://github.com/bep) [#8624](https://github.com/gohugoio/hugo/issues/8624) +* Adjust test assertion [ab4e1dfa](https://github.com/gohugoio/hugo/commit/ab4e1dfa4eebe0ac18f1d1f60a9647cbb7b41d7f) [@bep](https://github.com/bep) [#8625](https://github.com/gohugoio/hugo/issues/8625) +* support application/manifest+json [02f31897](https://github.com/gohugoio/hugo/commit/02f31897b4f7252154850a65c900e88e0b237fa3) [@Seirdy](https://github.com/Seirdy) [#8624](https://github.com/gohugoio/hugo/issues/8624) + +### Other + +* Regenerate docs helper [be6b901c](https://github.com/gohugoio/hugo/commit/be6b901cf7d07238337334e6b6d886a7b039f5e6) [@bep](https://github.com/bep) +* Regenerate docshelper [402da3f8](https://github.com/gohugoio/hugo/commit/402da3f8f327f97302c4b5d69cd4832a94bd189b) [@bep](https://github.com/bep) +* Implement configuration in a directory for modules [bb2aa087](https://github.com/gohugoio/hugo/commit/bb2aa08709c812a5be29922a1a7f4d814e200cab) [@bep](https://github.com/bep) [#8654](https://github.com/gohugoio/hugo/issues/8654) +* Update github.com/alecthomas/chroma v0.9.1 => v0.9.2 [3aa7f0b2](https://github.com/gohugoio/hugo/commit/3aa7f0b27fc736b4c32adbb1fc1fc7fbefd6efd9) [@bep](https://github.com/bep) [#8658](https://github.com/gohugoio/hugo/issues/8658) +* Run go mod tidy [9b870aa7](https://github.com/gohugoio/hugo/commit/9b870aa788ab1b5159bc836fbac6e60a29bee329) [@bep](https://github.com/bep) +* Split out the puthe path/filepath functions into common/paths [93aad3c5](https://github.com/gohugoio/hugo/commit/93aad3c543828efca2adeb7f96cf50ae29878593) [@bep](https://github.com/bep) [#8654](https://github.com/gohugoio/hugo/issues/8654) +* Update to Goldmark v1.3.8 [8eafe084](https://github.com/gohugoio/hugo/commit/8eafe0845d66efd3cf442a8ed89a6da5c1d3117b) [@jmooring](https://github.com/jmooring) [#8648](https://github.com/gohugoio/hugo/issues/8648) +* Do not read config from os.Environ when running tests [31fb29fb](https://github.com/gohugoio/hugo/commit/31fb29fb3f306678f3697e05bbccefb2078d7f78) [@bep](https://github.com/bep) [#8655](https://github.com/gohugoio/hugo/issues/8655) +* Set a dummy Instagram token [a886dd53](https://github.com/gohugoio/hugo/commit/a886dd53b80322e1edf924f2ede4d4ea037c5baf) [@bep](https://github.com/bep) +* Regenerate docs helper [a91cd765](https://github.com/gohugoio/hugo/commit/a91cd7652f7559492b070dbe02fe558348f3d0b6) [@bep](https://github.com/bep) +* Update to Go 1.16.5, Goreleaser 0.169.0 [552cef5c](https://github.com/gohugoio/hugo/commit/552cef5c576ae4dbf4626f77f3c8b15b42a9e7f3) [@bep](https://github.com/bep) [#8619](https://github.com/gohugoio/hugo/issues/8619)[#8263](https://github.com/gohugoio/hugo/issues/8263) +* Upgrade Instagram shortcode [9b5debe4](https://github.com/gohugoio/hugo/commit/9b5debe4b820132759cfdf7bff7fe9c1ad0a6bb1) [@bep](https://github.com/bep) [#7879](https://github.com/gohugoio/hugo/issues/7879) +* Set modTime at creation time [06d29542](https://github.com/gohugoio/hugo/commit/06d295427f798da85de469924fd10f58c0de9a58) [@bep](https://github.com/bep) [#6161](https://github.com/gohugoio/hugo/issues/6161) +* Add math.Max and math.Min [01758f99](https://github.com/gohugoio/hugo/commit/01758f99b915f34fe7ca4621e4d1ee09efe385b1) [@jmooring](https://github.com/jmooring) [#8583](https://github.com/gohugoio/hugo/issues/8583) +* Catch incomplete shortcode error [845a7ba4](https://github.com/gohugoio/hugo/commit/845a7ba4fc30c61842148d67d31d0fa3db8f40b9) [@satotake](https://github.com/satotake) [#6866](https://github.com/gohugoio/hugo/issues/6866) +* Use SPDX license identifier [10f60de8](https://github.com/gohugoio/hugo/commit/10f60de89a5a53528f1e3a47a77224e5c7915e4e) [@jmooring](https://github.com/jmooring) [#8555](https://github.com/gohugoio/hugo/issues/8555) +* Cache and copy Menu for sorting [785a31b5](https://github.com/gohugoio/hugo/commit/785a31b5b84643f4769f9bd363599cbcce86f098) [@satotake](https://github.com/satotake) [#7594](https://github.com/gohugoio/hugo/issues/7594) +* Update to LibSASS 3.6.5 [bc1e0528](https://github.com/gohugoio/hugo/commit/bc1e05286a96d08ad02ad200d6a4076bb01c486e) [@bep](https://github.com/bep) +* Make the HTML element collector more robust [f518b4f7](https://github.com/gohugoio/hugo/commit/f518b4f71e1a61b09d660b5c284121ebf3b3b86b) [@bep](https://github.com/bep) [#8530](https://github.com/gohugoio/hugo/issues/8530) +* Make the HTML element collector more robust" [dc6b7a75](https://github.com/gohugoio/hugo/commit/dc6b7a75ff5b7fcb8a0b0e3f7ed406422d847624) [@bep](https://github.com/bep) +* Get the collector in line with the io.Writer interface" [3f515f0e](https://github.com/gohugoio/hugo/commit/3f515f0e3395b24776ae24045b846ff2b33b8906) [@bep](https://github.com/bep) +* Get the collector in line with the io.Writer interface [a9bcd381](https://github.com/gohugoio/hugo/commit/a9bcd38181ceb79afba82adcd4de1aebf571e74c) [@bep](https://github.com/bep) +* Make the HTML element collector more robust [ef0f1a72](https://github.com/gohugoio/hugo/commit/ef0f1a726901d6c614040cfc2d7e8f9a2ca97816) [@bep](https://github.com/bep) [#8530](https://github.com/gohugoio/hugo/issues/8530) +* Add Scratch.DeleteInMap [abbc99d4](https://github.com/gohugoio/hugo/commit/abbc99d4c60b102e2779e4362ceb433095719384) [@meehawk](https://github.com/meehawk) [#8504](https://github.com/gohugoio/hugo/issues/8504) +* Display version when building site (#8533) [76c95f55](https://github.com/gohugoio/hugo/commit/76c95f55a5d18290baa7f23667161d4af9fb9b53) [@jmooring](https://github.com/jmooring) [#8531](https://github.com/gohugoio/hugo/issues/8531) +* Update querify function description and examples [2c7f5b62](https://github.com/gohugoio/hugo/commit/2c7f5b62f6c1fa1c7b3cf2c1f3a1663b18e75004) [@jmooring](https://github.com/jmooring) +* Change SetEscapeHTML to false [504c78da](https://github.com/gohugoio/hugo/commit/504c78da4b5020e1fd13a1195ad38a9e85f8289a) [@peaceiris](https://github.com/peaceiris) [#8512](https://github.com/gohugoio/hugo/issues/8512) +* Add a benchmark [b660ea8d](https://github.com/gohugoio/hugo/commit/b660ea8d545d6ba5479dd28a670044d57e5d196f) [@bep](https://github.com/bep) +* Update dependency list [64f88f30](https://github.com/gohugoio/hugo/commit/64f88f3011de5a510d8e6d6bad8ac4a091b11c0c) [@bep](https://github.com/bep) + +## Fixes + +### Templates + +* Fix countwords to handle special chars [7a2c10ae](https://github.com/gohugoio/hugo/commit/7a2c10ae60f096dacee4b44e0c8ae0a1b66ae033) [@ResamVi](https://github.com/ResamVi) [#8479](https://github.com/gohugoio/hugo/issues/8479) + +### Other + +* Fix fill with smartcrop sometimes returning 0 bytes images [5af045eb](https://github.com/gohugoio/hugo/commit/5af045ebab109d3e5501b8b6d9fd448840c96c9a) [@bep](https://github.com/bep) [#7955](https://github.com/gohugoio/hugo/issues/7955) +* Misc config loading fixes [d392893c](https://github.com/gohugoio/hugo/commit/d392893cd73dc00c927f342778f6dca9628d328e) [@bep](https://github.com/bep) [#8633](https://github.com/gohugoio/hugo/issues/8633)[#8618](https://github.com/gohugoio/hugo/issues/8618)[#8630](https://github.com/gohugoio/hugo/issues/8630)[#8591](https://github.com/gohugoio/hugo/issues/8591)[#6680](https://github.com/gohugoio/hugo/issues/6680)[#5192](https://github.com/gohugoio/hugo/issues/5192) +* Fix nested OS env config override when parent does not exist [12530519](https://github.com/gohugoio/hugo/commit/12530519d8fb4513c9c18a6494099b7dff8e4fd4) [@bep](https://github.com/bep) [#8618](https://github.com/gohugoio/hugo/issues/8618) +* Fix invalid timestamp of the "public" folder [26ae12c0](https://github.com/gohugoio/hugo/commit/26ae12c0c64b847d24bde60d7d710ea2efcb40d4) [@anthonyfok](https://github.com/anthonyfok) [#6161](https://github.com/gohugoio/hugo/issues/6161) +* Fix env split to allow = character in values [ee733085](https://github.com/gohugoio/hugo/commit/ee733085b7f5d3f2aef1667901ab6ecb8041d699) [@xqbumu](https://github.com/xqbumu) [#8589](https://github.com/gohugoio/hugo/issues/8589) +* Fix warning regression in i18n [ececd1b1](https://github.com/gohugoio/hugo/commit/ececd1b122c741567a80acd8d60ccd6356fa5323) [@bep](https://github.com/bep) [#8492](https://github.com/gohugoio/hugo/issues/8492) + + + + + diff --git a/content/en/templates/data-templates.md b/content/en/templates/data-templates.md index 661c0bdfa..b3edf8f44 100644 --- a/content/en/templates/data-templates.md +++ b/content/en/templates/data-templates.md @@ -114,19 +114,10 @@ You can use the following code to render the `Short Description` in your layout: Note the use of the [`markdownify` template function][markdownify]. This will send the description through the Blackfriday Markdown rendering engine. - -## Data-Driven Content +## Get Remote Data -In addition to the [data files](/extras/datafiles/) feature, Hugo also has a "data-driven content" feature, which lets you load any [JSON](https://www.json.org/) or [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) file from nearly any resource. - -Data-driven content currently consists of two functions, `getJSON` and `getCSV`, which are available in all template files. - -## Implementation details - -### Call the Functions with a URL - -In your template, call the functions like this: +Use `getJSON` or `getCSV` to get remote data: ``` {{ $dataJ := getJSON "url" }} @@ -155,19 +146,18 @@ This will resolve internally to the following: {{ $gistJ := getJSON "https://api.github.com/users/GITHUB_USERNAME/gists" }} ``` -Finally, you can range over an array. This example will output the -first 5 gists for a GitHub user: +### Add HTTP headers + +{{< new-in "0.84.0" >}} Both `getJSON` and `getCSV` takes an optional map as the last argument, e.g.: ``` - +{{ $data := getJSON "https://example.org/api" (dict "Authorization" "Bearer abcd") }} +``` + +If you need multiple values for the same header key, use a slice: + +``` +{{ $data := getJSON "https://example.org/api" (dict "X-List" (slice "a" "b" "c")) }} ``` ### Example for CSV files diff --git a/data/docs.json b/data/docs.json index 5e27712e3..d0edcb67f 100644 --- a/data/docs.json +++ b/data/docs.json @@ -14,25 +14,6 @@ "abnf" ] }, - { - "Name": "AL", - "Aliases": [ - "al", - "dal" - ] - }, - { - "Name": "ANTLR", - "Aliases": [ - "antlr" - ] - }, - { - "Name": "APL", - "Aliases": [ - "apl" - ] - }, { "Name": "ActionScript", "Aliases": [ @@ -58,12 +39,25 @@ "ads" ] }, + { + "Name": "AL", + "Aliases": [ + "al", + "dal" + ] + }, { "Name": "Angular2", "Aliases": [ "ng2" ] }, + { + "Name": "ANTLR", + "Aliases": [ + "antlr" + ] + }, { "Name": "ApacheConf", "Aliases": [ @@ -74,6 +68,12 @@ "htaccess" ] }, + { + "Name": "APL", + "Aliases": [ + "apl" + ] + }, { "Name": "AppleScript", "Aliases": [ @@ -96,12 +96,6 @@ "nawk" ] }, - { - "Name": "BNF", - "Aliases": [ - "bnf" - ] - }, { "Name": "Ballerina", "Aliases": [ @@ -166,6 +160,12 @@ "decls" ] }, + { + "Name": "BNF", + "Aliases": [ + "bnf" + ] + }, { "Name": "Brainfuck", "Aliases": [ @@ -179,7 +179,8 @@ "Aliases": [ "c", "h", - "idc" + "idc", + "x[bp]m" ] }, { @@ -207,37 +208,6 @@ "hxx" ] }, - { - "Name": "CFEngine3", - "Aliases": [ - "cf", - "cf3", - "cfengine3" - ] - }, - { - "Name": "CMake", - "Aliases": [ - "cmake", - "txt" - ] - }, - { - "Name": "COBOL", - "Aliases": [ - "COB", - "CPY", - "cob", - "cobol", - "cpy" - ] - }, - { - "Name": "CSS", - "Aliases": [ - "css" - ] - }, { "Name": "Caddyfile", "Aliases": [ @@ -272,6 +242,20 @@ "ceylon" ] }, + { + "Name": "CFEngine3", + "Aliases": [ + "cf", + "cf3", + "cfengine3" + ] + }, + { + "Name": "cfstatement", + "Aliases": [ + "cfs" + ] + }, { "Name": "ChaiScript", "Aliases": [ @@ -295,6 +279,23 @@ "clojure" ] }, + { + "Name": "CMake", + "Aliases": [ + "cmake", + "txt" + ] + }, + { + "Name": "COBOL", + "Aliases": [ + "COB", + "CPY", + "cob", + "cobol", + "cpy" + ] + }, { "Name": "CoffeeScript", "Aliases": [ @@ -325,6 +326,12 @@ "crystal" ] }, + { + "Name": "CSS", + "Aliases": [ + "css" + ] + }, { "Name": "Cython", "Aliases": [ @@ -342,12 +349,6 @@ "di" ] }, - { - "Name": "DTD", - "Aliases": [ - "dtd" - ] - }, { "Name": "Dart", "Aliases": [ @@ -376,6 +377,12 @@ "dockerfile" ] }, + { + "Name": "DTD", + "Aliases": [ + "dtd" + ] + }, { "Name": "Dylan", "Aliases": [ @@ -423,14 +430,6 @@ "hrl" ] }, - { - "Name": "FSharp", - "Aliases": [ - "fs", - "fsharp", - "fsi" - ] - }, { "Name": "Factor", "Aliases": [ @@ -464,6 +463,22 @@ "fortran" ] }, + { + "Name": "FortranFixed", + "Aliases": [ + "F", + "f", + "fortranfixed" + ] + }, + { + "Name": "FSharp", + "Aliases": [ + "fs", + "fsharp", + "fsi" + ] + }, { "Name": "GAS", "Aliases": [ @@ -480,15 +495,6 @@ "gdscript" ] }, - { - "Name": "GLSL", - "Aliases": [ - "frag", - "geo", - "glsl", - "vert" - ] - }, { "Name": "Genshi", "Aliases": [ @@ -522,6 +528,15 @@ "gherkin" ] }, + { + "Name": "GLSL", + "Aliases": [ + "frag", + "geo", + "glsl", + "vert" + ] + }, { "Name": "Gnuplot", "Aliases": [ @@ -557,6 +572,17 @@ "graphqls" ] }, + { + "Name": "Groff", + "Aliases": [ + "1p", + "3pm", + "[1-9]", + "groff", + "man", + "nroff" + ] + }, { "Name": "Groovy", "Aliases": [ @@ -564,33 +590,6 @@ "groovy" ] }, - { - "Name": "HCL", - "Aliases": [ - "hcl" - ] - }, - { - "Name": "HLB", - "Aliases": [ - "hlb" - ] - }, - { - "Name": "HTML", - "Aliases": [ - "htm", - "html", - "xhtml", - "xslt" - ] - }, - { - "Name": "HTTP", - "Aliases": [ - "http" - ] - }, { "Name": "Handlebars", "Aliases": [ @@ -613,12 +612,39 @@ "hxsl" ] }, + { + "Name": "HCL", + "Aliases": [ + "hcl" + ] + }, { "Name": "Hexdump", "Aliases": [ "hexdump" ] }, + { + "Name": "HLB", + "Aliases": [ + "hlb" + ] + }, + { + "Name": "HTML", + "Aliases": [ + "htm", + "html", + "xhtml", + "xslt" + ] + }, + { + "Name": "HTTP", + "Aliases": [ + "http" + ] + }, { "Name": "Hy", "Aliases": [ @@ -626,17 +652,6 @@ "hylang" ] }, - { - "Name": "INI", - "Aliases": [ - "cfg", - "dosini", - "editorconfig", - "gitconfig", - "inf", - "ini" - ] - }, { "Name": "Idris", "Aliases": [ @@ -652,6 +667,17 @@ "ipf" ] }, + { + "Name": "INI", + "Aliases": [ + "cfg", + "dosini", + "editorconfig", + "gitconfig", + "inf", + "ini" + ] + }, { "Name": "Io", "Aliases": [ @@ -665,12 +691,6 @@ "j" ] }, - { - "Name": "JSON", - "Aliases": [ - "json" - ] - }, { "Name": "Java", "Aliases": [ @@ -686,6 +706,12 @@ "mjs" ] }, + { + "Name": "JSON", + "Aliases": [ + "json" + ] + }, { "Name": "Julia", "Aliases": [ @@ -706,13 +732,6 @@ "kt" ] }, - { - "Name": "LLVM", - "Aliases": [ - "ll", - "llvm" - ] - }, { "Name": "Lighttpd configuration file", "Aliases": [ @@ -720,6 +739,13 @@ "lighty" ] }, + { + "Name": "LLVM", + "Aliases": [ + "ll", + "llvm" + ] + }, { "Name": "Lua", "Aliases": [ @@ -727,12 +753,6 @@ "wlua" ] }, - { - "Name": "MLIR", - "Aliases": [ - "mlir" - ] - }, { "Name": "Mako", "Aliases": [ @@ -740,6 +760,14 @@ "mao" ] }, + { + "Name": "markdown", + "Aliases": [ + "markdown", + "md", + "mkd" + ] + }, { "Name": "Mason", "Aliases": [ @@ -768,6 +796,18 @@ "matlab" ] }, + { + "Name": "mcfunction", + "Aliases": [ + "mcfunction" + ] + }, + { + "Name": "Metal", + "Aliases": [ + "metal" + ] + }, { "Name": "MiniZinc", "Aliases": [ @@ -778,6 +818,12 @@ "mzn" ] }, + { + "Name": "MLIR", + "Aliases": [ + "mlir" + ] + }, { "Name": "Modula-2", "Aliases": [ @@ -801,13 +847,6 @@ "mwscript" ] }, - { - "Name": "MySQL", - "Aliases": [ - "mysql", - "sql" - ] - }, { "Name": "Myghty", "Aliases": [ @@ -815,6 +854,13 @@ "myt" ] }, + { + "Name": "MySQL", + "Aliases": [ + "mysql", + "sql" + ] + }, { "Name": "NASM", "Aliases": [ @@ -851,16 +897,6 @@ "nixos" ] }, - { - "Name": "OCaml", - "Aliases": [ - "ml", - "mli", - "mll", - "mly", - "ocaml" - ] - }, { "Name": "Objective-C", "Aliases": [ @@ -872,6 +908,16 @@ "objectivec" ] }, + { + "Name": "OCaml", + "Aliases": [ + "ml", + "mli", + "mll", + "mly", + "ocaml" + ] + }, { "Name": "Octave", "Aliases": [ @@ -893,36 +939,6 @@ "orgmode" ] }, - { - "Name": "PHP", - "Aliases": [ - "inc", - "php", - "php3", - "php4", - "php5", - "php[345]" - ] - }, - { - "Name": "PHTML", - "Aliases": [ - "phtml" - ] - }, - { - "Name": "PL/pgSQL", - "Aliases": [ - "plpgsql" - ] - }, - { - "Name": "POVRay", - "Aliases": [ - "inc", - "pov" - ] - }, { "Name": "PacmanConf", "Aliases": [ @@ -939,6 +955,26 @@ "t" ] }, + { + "Name": "PHP", + "Aliases": [ + "inc", + "php", + "php3", + "php4", + "php5", + "php[345]" + ] + }, + { + "Name": "PHTML", + "Aliases": [ + "inc", + "php", + "php[345]", + "phtml" + ] + }, { "Name": "Pig", "Aliases": [ @@ -952,12 +988,34 @@ "pkgconfig" ] }, + { + "Name": "PL/pgSQL", + "Aliases": [ + "plpgsql" + ] + }, + { + "Name": "plaintext", + "Aliases": [ + "no-highlight", + "plain", + "text", + "txt" + ] + }, { "Name": "Pony", "Aliases": [ "pony" ] }, + { + "Name": "PostgreSQL SQL dialect", + "Aliases": [ + "postgres", + "postgresql" + ] + }, { "Name": "PostScript", "Aliases": [ @@ -968,10 +1026,17 @@ ] }, { - "Name": "PostgreSQL SQL dialect", + "Name": "POVRay", "Aliases": [ - "postgres", - "postgresql" + "inc", + "pov" + ] + }, + { + "Name": "PowerQuery", + "Aliases": [ + "powerquery", + "pq" ] }, { @@ -1016,8 +1081,14 @@ { "Name": "Python", "Aliases": [ + "bazel", + "bzl", + "jy", "py", + "py3", + "pyi", "python", + "python3", "pyw", "sage", "sc", @@ -1025,10 +1096,10 @@ ] }, { - "Name": "Python 3", + "Name": "Python 2", "Aliases": [ - "py3", - "python3" + "py2", + "python2" ] }, { @@ -1075,6 +1146,34 @@ "ragel" ] }, + { + "Name": "Raku", + "Aliases": [ + "6pl", + "6pm", + "nqp", + "p6", + "p6l", + "p6m", + "perl6", + "pl", + "pl6", + "pm", + "pm6", + "raku", + "rakudoc", + "rakumod", + "rakutest", + "t" + ] + }, + { + "Name": "react", + "Aliases": [ + "jsx", + "react" + ] + }, { "Name": "ReasonML", "Aliases": [ @@ -1084,6 +1183,21 @@ "rei" ] }, + { + "Name": "reg", + "Aliases": [ + "reg", + "registry" + ] + }, + { + "Name": "reStructuredText", + "Aliases": [ + "rest", + "restructuredtext", + "rst" + ] + }, { "Name": "Rexx", "Aliases": [ @@ -1120,32 +1234,6 @@ "sas" ] }, - { - "Name": "SCSS", - "Aliases": [ - "scss" - ] - }, - { - "Name": "SPARQL", - "Aliases": [ - "rq", - "sparql" - ] - }, - { - "Name": "SQL", - "Aliases": [ - "sql" - ] - }, - { - "Name": "SYSTEMD", - "Aliases": [ - "service", - "systemd" - ] - }, { "Name": "Sass", "Aliases": [ @@ -1175,6 +1263,12 @@ "tst" ] }, + { + "Name": "SCSS", + "Aliases": [ + "scss" + ] + }, { "Name": "Smalltalk", "Aliases": [ @@ -1203,6 +1297,19 @@ "solidity" ] }, + { + "Name": "SPARQL", + "Aliases": [ + "rq", + "sparql" + ] + }, + { + "Name": "SQL", + "Aliases": [ + "sql" + ] + }, { "Name": "SquidConf", "Aliases": [ @@ -1227,12 +1334,54 @@ "stylus" ] }, + { + "Name": "Svelte", + "Aliases": [ + "svelte" + ] + }, { "Name": "Swift", "Aliases": [ "swift" ] }, + { + "Name": "SYSTEMD", + "Aliases": [ + "automount", + "device", + "dnssd", + "link", + "mount", + "netdev", + "network", + "path", + "scope", + "service", + "slice", + "socket", + "swap", + "systemd", + "target", + "timer" + ] + }, + { + "Name": "systemverilog", + "Aliases": [ + "sv", + "svh", + "systemverilog" + ] + }, + { + "Name": "TableGen", + "Aliases": [ + "tablegen", + "td" + ] + }, { "Name": "TASM", "Aliases": [ @@ -1241,19 +1390,6 @@ "tasm" ] }, - { - "Name": "TOML", - "Aliases": [ - "toml" - ] - }, - { - "Name": "TableGen", - "Aliases": [ - "tablegen", - "td" - ] - }, { "Name": "Tcl", "Aliases": [ @@ -1268,15 +1404,6 @@ "tcsh" ] }, - { - "Name": "TeX", - "Aliases": [ - "aux", - "latex", - "tex", - "toc" - ] - }, { "Name": "Termcap", "Aliases": [ @@ -1298,12 +1425,27 @@ "tf" ] }, + { + "Name": "TeX", + "Aliases": [ + "aux", + "latex", + "tex", + "toc" + ] + }, { "Name": "Thrift", "Aliases": [ "thrift" ] }, + { + "Name": "TOML", + "Aliases": [ + "toml" + ] + }, { "Name": "TradingView", "Aliases": [ @@ -1374,6 +1516,13 @@ "vbnet" ] }, + { + "Name": "verilog", + "Aliases": [ + "v", + "verilog" + ] + }, { "Name": "VHDL", "Aliases": [ @@ -1390,6 +1539,13 @@ "vimrc" ] }, + { + "Name": "vue", + "Aliases": [ + "vue", + "vuejs" + ] + }, { "Name": "WDTE", "Aliases": [ @@ -1434,79 +1590,6 @@ "Aliases": [ "zig" ] - }, - { - "Name": "cfstatement", - "Aliases": [ - "cfs" - ] - }, - { - "Name": "markdown", - "Aliases": [ - "markdown", - "md", - "mkd" - ] - }, - { - "Name": "mcfunction", - "Aliases": [ - "mcfunction" - ] - }, - { - "Name": "plaintext", - "Aliases": [ - "no-highlight", - "plain", - "text", - "txt" - ] - }, - { - "Name": "reStructuredText", - "Aliases": [ - "rest", - "restructuredtext", - "rst" - ] - }, - { - "Name": "react", - "Aliases": [ - "jsx", - "react" - ] - }, - { - "Name": "reg", - "Aliases": [ - "reg", - "registry" - ] - }, - { - "Name": "systemverilog", - "Aliases": [ - "sv", - "svh", - "systemverilog" - ] - }, - { - "Name": "verilog", - "Aliases": [ - "v", - "verilog" - ] - }, - { - "Name": "vue", - "Aliases": [ - "vue", - "vuejs" - ] } ] }, @@ -1587,6 +1670,65 @@ "preserveTOC": false } }, + "mergeStrategy": { + "build": { + "_merge": "none" + }, + "caches": { + "_merge": "none" + }, + "frontmatter": { + "_merge": "none" + }, + "imaging": { + "_merge": "none" + }, + "languages": { + "_merge": "none", + "en": { + "_merge": "none", + "menus": { + "_merge": "shallow" + }, + "params": { + "_merge": "deep" + } + } + }, + "markup": { + "_merge": "none" + }, + "mediatypes": { + "_merge": "shallow" + }, + "menus": { + "_merge": "shallow" + }, + "minify": { + "_merge": "none" + }, + "module": { + "_merge": "none" + }, + "outputformats": { + "_merge": "shallow" + }, + "params": { + "_merge": "deep" + }, + "permalinks": { + "_merge": "none" + }, + "related": { + "_merge": "none" + }, + "sitemap": { + "_merge": "none" + }, + "taxonomies": { + "_merge": "none" + } + }, "minify": { "minifyOutput": false, "disableHTML": false, @@ -1655,6 +1797,20 @@ "json" ] }, + { + "mainType": "application", + "subType": "manifest", + "delimiter": ".", + "firstSuffix": { + "suffix": "webmanifest", + "fullSuffix": ".webmanifest" + }, + "type": "application/manifest+json", + "string": "application/manifest+json", + "suffixes": [ + "webmanifest" + ] + }, { "mainType": "application", "subType": "octet-stream", @@ -2138,6 +2294,20 @@ "notAlternative": false, "permalinkable": false, "weight": 0 + }, + { + "mediaType": "application/manifest+json", + "name": "WebAppManifest", + "path": "", + "baseName": "manifest", + "rel": "manifest", + "protocol": "", + "isPlainText": true, + "isHTML": false, + "noUgly": false, + "notAlternative": true, + "permalinkable": false, + "weight": 0 } ], "layouts": [ @@ -3144,6 +3314,10 @@ [ "\u003ca href=\"https://www.google.com?{{ (querify \"q\" \"test\" \"page\" 3) | safeURL }}\"\u003eSearch\u003c/a\u003e", "\u003ca href=\"https://www.google.com?page=3\u0026amp;q=test\"\u003eSearch\u003c/a\u003e" + ], + [ + "{{ slice \"foo\" 1 \"bar\" 2 | querify | safeHTML }}", + "bar=2\u0026foo=1" ] ] }, @@ -3337,7 +3511,7 @@ "Description": "GetCSV expects a data separator and one or n-parts of a URL to a resource which\ncan either be a local or a remote one.\nThe data separator can be a comma, semi-colon, pipe, etc, but only one character.\nIf you provide multiple parts for the URL they will be joined together to the final URL.\nGetCSV returns nil or a slice slice to use in a short code.", "Args": [ "sep", - "urlParts" + "args" ], "Aliases": [ "getCSV" @@ -3347,7 +3521,7 @@ "GetJSON": { "Description": "GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one.\nIf you provide multiple parts they will be joined together to the final URL.\nGetJSON returns nil or parsed JSON to use in a short code.", "Args": [ - "urlParts" + "args" ], "Aliases": [ "getJSON" @@ -3442,6 +3616,23 @@ ] ] }, + "Erroridf": { + "Description": "Erroridf formats according to a format specifier and logs an ERROR and\nan information text that the error with the given ID can be suppressed in config.\nIt returns an empty string.", + "Args": [ + "id", + "format", + "a" + ], + "Aliases": [ + "erroridf" + ], + "Examples": [ + [ + "{{ erroridf \"my-err-id\" \"%s.\" \"failed\" }}", + "" + ] + ] + }, "Print": { "Description": "Print returns string representation of the passed arguments.", "Args": [ @@ -3829,6 +4020,34 @@ ] ] }, + "Max": { + "Description": "Max returns the greater of two numbers.", + "Args": [ + "a", + "b" + ], + "Aliases": null, + "Examples": [ + [ + "{{math.Max 1 2 }}", + "2" + ] + ] + }, + "Min": { + "Description": "Min returns the smaller of two numbers.", + "Args": [ + "a", + "b" + ], + "Aliases": null, + "Examples": [ + [ + "{{math.Min 1 2 }}", + "1" + ] + ] + }, "Mod": { "Description": "Mod returns a % b.", "Args": [ @@ -3907,7 +4126,7 @@ ] }, "Sqrt": { - "Description": "Sqrt returns the square root of a number.\nNOTE: will return for NaN for negative values of a", + "Description": "Sqrt returns the square root of a number.", "Args": [ "a" ], diff --git a/layouts/shortcodes/code-toggle.html b/layouts/shortcodes/code-toggle.html index da4b00719..0b92d520d 100644 --- a/layouts/shortcodes/code-toggle.html +++ b/layouts/shortcodes/code-toggle.html @@ -1,34 +1,41 @@ {{ $file := .Get "file" }} {{ $code := "" }} {{ with .Get "config" }} -{{ $file = $file | default "config" }} -{{ $sections := (split . ".") }} -{{ $configSection := index $.Site.Data.docs.config $sections }} -{{ $code = dict $sections $configSection }} + {{ $file = $file | default "config" }} + {{ $sections := (split . ".") }} + {{ $configSection := index $.Site.Data.docs.config $sections }} + {{ $code = dict $sections $configSection }} + {{ if $.Get "skipHeader"}} + {{ $code = $configSection }} + {{ end }} {{ else }} -{{ $code = $.Inner }} + {{ $code = $.Inner }} {{ end }} {{ $langs := (slice "yaml" "toml" "json") }}
-
- {{- with $file -}} -
{{ . }}.
- {{- end -}} - {{ range $langs }} -   - {{ end }} -
-
- {{ range $langs }} -
- {{ highlight ($code | transform.Remarshal . | safeHTML) . ""}} -
- {{ if ne ($.Get "copy") "false" }} - - {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} - {{end}} - {{ end }} -
- +
+ {{- with $file -}} +
+ {{ . }}. +
+ {{- end -}} + {{ range $langs }} + +   + {{ end }} +
+
+ {{ range $langs }} +
+ {{ highlight ($code | transform.Remarshal . | safeHTML) . ""}} +
+ {{ if ne ($.Get "copy") "false" }} + + {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} + {{end}} + {{ end }} +
+
diff --git a/netlify.toml b/netlify.toml index 696410d47..23d321b2f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.83.1" +HUGO_VERSION = "0.84.0" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.83.1" +HUGO_VERSION = "0.84.0" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.83.1" +HUGO_VERSION = "0.84.0" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.83.1" +HUGO_VERSION = "0.84.0" [context.next.environment] HUGO_ENABLEGITINFO = "true" diff --git a/resources/_gen/images/news/0.84.0-relnotes/featured_hu7c38afe80520529cfcae538ac032ebff_47732_480x0_resize_catmullrom_2.png b/resources/_gen/images/news/0.84.0-relnotes/featured_hu7c38afe80520529cfcae538ac032ebff_47732_480x0_resize_catmullrom_2.png new file mode 100644 index 000000000..ca153c9c1 Binary files /dev/null and b/resources/_gen/images/news/0.84.0-relnotes/featured_hu7c38afe80520529cfcae538ac032ebff_47732_480x0_resize_catmullrom_2.png differ diff --git a/resources/_gen/images/news/0.84.0-relnotes/featured_hu7c38afe80520529cfcae538ac032ebff_47732_640x0_resize_catmullrom_2.png b/resources/_gen/images/news/0.84.0-relnotes/featured_hu7c38afe80520529cfcae538ac032ebff_47732_640x0_resize_catmullrom_2.png new file mode 100644 index 000000000..5e2dc099e Binary files /dev/null and b/resources/_gen/images/news/0.84.0-relnotes/featured_hu7c38afe80520529cfcae538ac032ebff_47732_640x0_resize_catmullrom_2.png differ