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

7380 Commits

Author SHA1 Message Date
2fb40ece5d tpl/strings: Add findRESubmatch
Fixes #10594
2023-01-17 12:14:11 +01:00
c6b3887696 config/security: Add O\w+ (e.g. GOROOT) to the default allowed list
Fixes #10429
2023-01-17 10:52:51 +01:00
21af5b359f Preserve front matter slice value types (e.g. int)
Fixes #10624
2023-01-17 08:58:05 +01:00
f38a2fbd2e Make hugo.toml the new config.toml
Both will of course work, but hugo.toml will win if both are set.

We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some
JSON config schema from some random other software which also names its config files config.toml.

Fixes #8979
2023-01-16 15:34:16 +01:00
6a579ebac3 Add fill HTTP Response info into .Data in resources.GetRemote
See #10604
2023-01-16 14:44:15 +01:00
f13531e608 Fix HEAD method in resources.GetRemote
Fixes #10604
2023-01-16 14:44:15 +01:00
b5d485060f Fix order when reading custom headers in resources.GetRemote
Fixes #10616
2023-01-16 14:44:15 +01:00
6e9fa9e0fd deps: Upgrade github.com/evanw/esbuild v0.15.18 => v0.17.0
Also add a test to make sure legal comments are preserved in JS bundles.

Closes #10536
2023-01-16 14:41:13 +01:00
c4f3a46ce6 Update README.md 2023-01-09 14:13:30 +01:00
fbc3e08c64 resource: Fix Go Doc vs .Data.Integrity 2023-01-07 10:58:34 +01:00
e402d91ee1 Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
3c51625c71 Make readFile return nil when file not found (note)
Fixes #9620
2023-01-04 18:01:26 +01:00
dd6d0a6de1 Remove reference to Goreleaser in code comment
Hugo no longer uses the Goreleaser tool.
2023-01-03 20:25:44 +01:00
f95fd57aac tpl/compare: Sort special float values as string
When sorting strings a worng order is returned. This happens because the strings are first converted
to floating values to check whether or not they should be sorted as
floating values. When an error is returned the strings will be
handled as string literals.
No error will be returned when parsing Inf, Infinity or NaN (case insensitive) because they
will be coverted to special floating point values and therefore are
legal float values.
Now we check if the returned converted values are special floating
values and treat them as string literals.

Fixes #10389
2023-01-02 17:35:08 +01:00
e754d5cb3e tpl/diagrams: Move Goat to its own file 2022-12-25 14:02:22 +01:00
002cd52807 Update CONTRIBUTING.md 2022-12-24 15:53:27 +01:00
a76c405d40 Update CONTRIBUTING.md 2022-12-24 15:49:00 +01:00
c0a03a2a39 Update README.md 2022-12-24 15:48:45 +01:00
e127d3e5c6 releaser: Prepare repository for 0.110.0-DEV
[ci skip]
2022-12-23 10:50:52 +00:00
47b12b83e6 releaser: Bump versions for release of 0.109.0
[ci skip]
v0.109.0
2022-12-23 10:38:11 +00:00
180dfeba03 Adjust "you need the extended version" error message 2022-12-23 10:33:49 +01:00
10bb29d7f3 docs: Regen docs helper JSON 2022-12-23 10:15:48 +01:00
eb0c8f9d02 resource/page: Slight adjustment of Page.Ancestors
Fixes #10567
2022-12-23 10:14:53 +01:00
3a216186b2 resource/page: Add Page.Ancestors
Fixes #10567
2022-12-23 10:14:53 +01:00
7874b96815 build(deps): bump golang.org/x/tools from 0.3.0 to 0.4.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-23 09:26:10 +01:00
71832328f8 Annotate test assertions 2022-12-22 18:53:12 +01:00
37ab1cf12a hugolib: Exclude non-linkable pages from translations map
Fixes #9073
2022-12-22 18:53:12 +01:00
59af05cabc Add HUGO_PUBLISHDIR to the Node environment
So you can do  `process.env.HUGO_PUBLISHDIR` in your `postcss.config.js` to figure out where Hugo publishes
its files.

Note that the value will always be an absolute file path and will point to a directory on disk even when running `hugo server` in memory mode.

If you write to this folder from PostCSS when running the server, you could run the server with one of these flags:

```
hugo server --renderToDisk
hugo server --renderStaticToDisk
```

Fixes #10554
2022-12-22 12:43:50 +01:00
4989da653d Revert "tpl/tplimpl: Use https in sitemap templates"
This reverts commit 3fd0b78498597ceb343b7fda2e9b652f3e957478.
2022-12-22 08:53:58 +01:00
cd1ed563a8 tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
aa2c724195 tpl/resources: Fix data race in ToCSS
Fixes #10542
2022-12-21 12:26:42 +01:00
effa6a4226 tocss: Add some more test cases
See #10555
2022-12-21 11:21:07 +01:00
5d5f0a2371 tocss: Fix unquote case with double quotes
See #10555
2022-12-21 11:21:07 +01:00
d20d2651ea Allow "fast render mode" even if --disableLiveReload is set
Fixes #10561
2022-12-21 11:02:21 +01:00
41a080b268 tocss: Add vars option
This commit adds a new `vars` option to both the Sass transpilers (Dart Sass and Libsass).

This means that you can pass a map with key/value pairs to the transpiler:

```handlebars
{{ $vars := dict "$color1" "blue" "$color2" "green" "$font_size" "24px" }}
{{ $cssOpts := (dict "transpiler" "dartsass" "outputStyle" "compressed" "vars" $vars ) }}
{{ $r := resources.Get "scss/main.scss" |  toCSS $cssOpts }}
```

And the the variables will be available in the `hugo:vars` namespace. Example usage for Dart Sass:

```scss
@use "hugo:vars" as v;

p {
    color: v.$color1;
    font-size: v.$font_size;
}
```

Note that Libsass does not support the `use` keyword, so you need to `import` them as global variables:

```scss
@import "hugo:vars";

p {
    color: $color1;
    font-size: $font_size;
}
```

Hugo will:

* Add a missing leading `$` for the variable names if needed.
* Wrap the values in `unquote('VALUE')` (Sass built-in) to get proper handling of identifiers vs other strings.

This means that you can pull variables directly from e.g. the site config:

```toml
[params]
[params.sassvars]
color1 = "blue"
color2 = "green"
font_size = "24px"
image = "images/hero.jpg"
```

```handlebars
{{ $vars := site.Params.sassvars}}
{{ $cssOpts := (dict "transpiler" "dartsass" "outputStyle" "compressed" "vars" $vars ) }}
{{ $r := resources.Get "scss/main.scss" |  toCSS $cssOpts }}
```

Fixes #10555
2022-12-20 19:36:30 +01:00
9a215d6950 Merge commit '41bc6f702aa54200530efbf4267e5c823df3028d' 2022-12-20 11:04:41 +01:00
41bc6f702a Squashed 'docs/' changes from 2201ac0e5..2c0125b52
2c0125b52 Remove .Site.Author
2cf8841b3 Update partialCached.md (#1924)
385487191 Update data-templates.md (#1926)
ce207e141 Remove redundant markdown and fix a few typos (#1936)
3687c2953 Make heading id linkable, take 2
45c79bea7 Make heading id linkable
b22079344 Delete duplicates the lines 557-569 and 570-582. (#1934)
0a90dc122 Rework the taxonomy variables page (#1935)
7f8979c50 Update theme
26e682a3a Update multilingual.md
d40e7693f Update postcss.md
375d75c01 Update postcss npm instructions (#1931)
63020094a Emphasize Window shell selection (#1930)
56824be2c Update configuration.md
b7b8f16b3 Docu 'Theme components': minor fix (#1929)
09dc81a05 Remove Docker from BSD page (#1927)
205fea204 netlify: Hugo 0.108.0
6abe49c28 Merge commit 'da670c38ee63a7fef25e2b9f42519232055b60dc'
12b59a4c5 docs: Add basic doc for wrapStandAloneImageWithinParagraph etc.
ba07bd970 dartsass: Add sourceMapIncludeSources option

git-subtree-dir: docs
git-subtree-split: 2c0125b5290494d49334606c451446ebd9df3c21
2022-12-20 11:04:41 +01:00
eda1e720cd modules: Improve "module workspace" not found error 2022-12-20 09:06:38 +01:00
330fa89411 modules: Adjust watch logic vs workspace use definitions 2022-12-19 20:17:33 +01:00
6db527483d Add any configured Go Workspace file to the config watcher
Fixes #10556
2022-12-19 20:17:33 +01:00
0d4b17d4c0 modules: Make the module.workspace=off as default (note)
Also, resolve any workspace file relative to the workingDir.

Fixes #10553
2022-12-19 20:17:33 +01:00
3afaca7584 release: Add a note section in release notes 2022-12-19 13:13:38 +01:00
2d217cba51 helpers: Allow at signs in UnicodeSanitize (note)
Closes #10548
2022-12-19 09:58:56 +01:00
17055d1fa7 parser/metadecoders: Remove superflous cast in test 2022-12-14 20:10:17 +01:00
2a81a49499 parser/metadecoders: Simplify nil check in Unmarshal 2022-12-14 18:03:47 +01:00
e30d711c29 parser/metadecoders: Add empty /data JSON file as empty map
When fetching JSON files from the /data folder that are empty they will
be added as empty map[string]any. This makes sure that no empty JSON
file causes the site to crash because of a failed unmarshal. This
happens because empty is not a valid JSON string. It is therefore
important to check the lenght of the data before passing it to the JSON
unmarshal function.

Fixes #8601
2022-12-14 18:03:47 +01:00
ad2059878a Also consider wrapped errors when checking for file IsNotExist errors
Fixes #10534
2022-12-14 13:51:06 +01:00
87e898a17a tpl/openapi3: Wrap *kopenapi3.T
To make it easier to document.
2022-12-14 12:29:40 +01:00
b54de1bd9b resources/js: Fix some import discrepancies between Hugo and ESBuild
This fixes the cases where

```js
import 'imp2/index.js';
import 'imp3/foo.js';
```

And these files lives in `assets` as:

```
imp2/index.ts
imp3/foo.ts
```

Fixes #10527
2022-12-13 18:58:17 +01:00
c9354d5463 github: Update to Dart Sass 1.56.2 2022-12-13 16:58:33 +01:00