Commit Graph

9075 Commits

Author SHA1 Message Date
dependabot[bot]
3968f9158e build(deps): bump github.com/bep/godartsass/v2 from 2.4.0 to 2.4.1
Bumps [github.com/bep/godartsass/v2](https://github.com/bep/godartsass) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/bep/godartsass/releases)
- [Commits](https://github.com/bep/godartsass/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: github.com/bep/godartsass/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 10:43:58 +01:00
dependabot[bot]
e9bd2373a0 build(deps): bump golang.org/x/net from 0.35.0 to 0.37.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.35.0 to 0.37.0.
- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.37.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-23 21:01:52 +01:00
Joe Mooring
a6bd67793b common/hexec: Remove github.com/cli/safeexec
We began using the safeexec package in v0.79.1 to address
https://github.com/gohugoio/hugo/security/advisories/GHSA-8j34-9876-pvfq.

The vulnerability was addressed by the Go team in 1.19, so the safeexec
package is no longer needed.

Closes #13516
2025-03-23 13:55:42 +01:00
Ville Vesilehto
f34cdc382a parser/metadecoder: Improve errors for non-map XML root values
Previously, the XML decoder would panic when encountering a root element with
a non-map value due to an unsafe type assertion.

The fix adds proper type checking before the map conversion and provides
clear error messages to help users identify and fix invalid XML structures.

Example error for invalid XML like:
<root>just text</root>

Will now return:
"XML root element 'root' must be a map/object, got string"
2025-03-22 18:48:23 +01:00
Bjørn Erik Pedersen
52561d561a identity: Use clear to clear the finder seen map
Faster:

```
Finder/Find_one-10    172.8n ± 26%   129.3n ± 2%  -25.18% (p=0.002 n=6)
Finder/Find_none-10   174.0n ±  1%   130.6n ± 0%  -24.94% (p=0.002 n=6)
```
2025-03-15 19:05:45 +01:00
dependabot[bot]
f4f21f5ea3 build(deps): bump github.com/bep/godartsass/v2 from 2.3.2 to 2.4.0
Bumps [github.com/bep/godartsass/v2](https://github.com/bep/godartsass) from 2.3.2 to 2.4.0.
- [Release notes](https://github.com/bep/godartsass/releases)
- [Commits](https://github.com/bep/godartsass/compare/v2.3.2...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/bep/godartsass/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-15 18:37:33 +01:00
Joe Mooring
a98ec3bd01 commands/gen: Set url in command pages to /docs/reference/commands/ 2025-03-14 21:11:46 +01:00
khayyam
d28c84a871 cache: Apply httpcache defaults for polling config
Previously, compiling the config with partial or missing poll configs
would introduce a panic. This ensures that the default poll configs
are applied in such scenarios to ensure config is valid.

Fixes #13471
2025-03-14 14:37:26 +01:00
dependabot[bot]
61c39ae63b build(deps): bump golang.org/x/image from 0.24.0 to 0.25.0
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/golang/image/compare/v0.24.0...v0.25.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 16:17:49 +01:00
Bjørn Erik Pedersen
2037137fbf deps: Upgrade golang.org/x/mod v0.23.0 => v0.24.0
Closes #13484
2025-03-12 16:24:48 +01:00
dependabot[bot]
d78d4cf161 build(deps): bump github.com/bep/overlayfs from 0.9.2 to 0.10.0
Bumps [github.com/bep/overlayfs](https://github.com/bep/overlayfs) from 0.9.2 to 0.10.0.
- [Release notes](https://github.com/bep/overlayfs/releases)
- [Commits](https://github.com/bep/overlayfs/compare/v0.9.2...v0.10.0)

---
updated-dependencies:
- dependency-name: github.com/bep/overlayfs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 21:03:49 +01:00
dependabot[bot]
f9aae1581b build(deps): bump github.com/bep/lazycache from 0.7.0 to 0.8.0
Bumps [github.com/bep/lazycache](https://github.com/bep/lazycache) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/bep/lazycache/releases)
- [Commits](https://github.com/bep/lazycache/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: github.com/bep/lazycache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 21:03:27 +01:00
Joe Mooring
b9add1c702 tpl/tplimpl: Add loading attribute to Vimeo shortcode
Closes #13445
2025-03-11 21:02:12 +01:00
dependabot[bot]
b0686712ba build(deps): bump github.com/bep/imagemeta from 0.8.4 to 0.9.0
Bumps [github.com/bep/imagemeta](https://github.com/bep/imagemeta) from 0.8.4 to 0.9.0.
- [Release notes](https://github.com/bep/imagemeta/releases)
- [Commits](https://github.com/bep/imagemeta/compare/v0.8.4...v0.9.0)

---
updated-dependencies:
- dependency-name: github.com/bep/imagemeta
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 16:51:32 +01:00
dependabot[bot]
93d9c0533a build(deps): bump github.com/bep/simplecobra from 0.5.0 to 0.6.0
Bumps [github.com/bep/simplecobra](https://github.com/bep/simplecobra) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/bep/simplecobra/releases)
- [Commits](https://github.com/bep/simplecobra/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/bep/simplecobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 16:51:19 +01:00
Joe Mooring
93df17661f commands: Add --omitEmpty flag to gen chromastyles
Closes #13475
2025-03-11 16:50:59 +01:00
Will Faught
eebea9ec41 tpl: Add trailing newline to robots.txt template 2025-03-05 15:02:50 +01:00
Bjørn Erik Pedersen
3f2e1c08e3 commands: Skip flaky test on Windows
Closes #13465
2025-03-03 12:50:33 +01:00
Hannes Braun
3a11d22da3 resources/image: Mark loong64 as FMA-using architecture 2025-02-26 21:17:06 +01:00
hugoreleaser
cb4a097190 releaser: Prepare repository for 0.146.0-DEV
[ci skip]
2025-02-26 15:58:38 +00:00
hugoreleaser
666444f0a5 releaser: Bump versions for release of 0.145.0
[ci skip]
v0.145.0
2025-02-26 15:41:25 +00:00
margau
e5eecbd9bc github: Build docker image with both extended and withdeploy tags 2025-02-26 16:33:22 +01:00
coliff
4094a1e12c all: Typo fixes 2025-02-26 15:10:28 +01:00
Bjørn Erik Pedersen
6927e6f048 deps: Upgrade github.com/rogpeppe/go-internal v1.13.1 => v1.14.1
Closes #13449
2025-02-26 14:43:03 +01:00
Bjørn Erik Pedersen
c498d0fe1e Use the page path and not the backing filename as the last resort in the default sort
This should:

1. Fix some (rare) tiebreaker issues when sorting pages from multiple content adapters.
2. Improve the sorting for pages without a backing file.
2025-02-26 13:06:26 +01:00
Bjørn Erik Pedersen
521911a576 all: Run modernize -fix ./... 2025-02-26 11:44:25 +01:00
dependabot[bot]
b7ae24b9c2 build(deps): bump github.com/yuin/goldmark-emoji from 1.0.4 to 1.0.5
Bumps [github.com/yuin/goldmark-emoji](https://github.com/yuin/goldmark-emoji) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/yuin/goldmark-emoji/releases)
- [Commits](https://github.com/yuin/goldmark-emoji/compare/v1.0.4...v1.0.5)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark-emoji
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 10:56:23 +01:00
Christian Oliff
2f4e666d7e tpl: HTTPS the instagram Shortcode JS
This JavaScript will always load over HTTPS so it's best to specify that. Protocol-less loaded resources are an anti-pattern (REF: https://www.paulirish.com/2010/the-protocol-relative-url/)
2025-02-26 09:27:31 +01:00
dependabot[bot]
1a4851f138 build(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-25 19:41:18 +01:00
dependabot[bot]
d1f23309bf build(deps): bump github.com/tetratelabs/wazero from 1.8.2 to 1.9.0
Bumps [github.com/tetratelabs/wazero](https://github.com/tetratelabs/wazero) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/tetratelabs/wazero/releases)
- [Commits](https://github.com/tetratelabs/wazero/compare/v1.8.2...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/tetratelabs/wazero
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-25 19:40:01 +01:00
Bjørn Erik Pedersen
04f21b4d80 Add transform.PortableText
Using this in a content adapter could look like this:

```handlebars
{{ $projectID := "<myproject>" }}
{{ $useCached := true }}
{{ $api := "api" }}
{{ if $useCached }}
  {{/* See https://www.sanity.io/docs/api-cdn */}}
  {{ $api = "apicdn" }}
{{ end }}
{{ $url := printf "https://%s.%s.sanity.io/v2021-06-07/data/query/production"  $projectID $api }}

{{/* prettier-ignore-start */ -}}
{{ $q :=  `*[_type == 'post']{
  title, publishedAt, summary, slug, body[]{
    ...,
    _type == "image" => {
      ...,
      asset->{
        _id,
        path,
        url,
        altText,
        title,
        description,
        metadata {
          dimensions {
            aspectRatio,
            width,
            height
          }
        }
      }
    }
  },
  }`
}}
{{/* prettier-ignore-end */ -}}
{{ $body := dict "query" $q | jsonify }}
{{ $opts := dict "method" "post" "body" $body }}
{{ $t := debug.Timer "sanity.get" }}
{{ $r := resources.GetRemote $url $opts }}
{{ $t.Stop }}
{{ $m := $r | transform.Unmarshal }}
{{ $result := $m.result }}
{{ $t := debug.Timer "sanity.parse" }}
{{ range $result }}
  {{ if not .slug }}
    {{ continue }}
  {{ end }}
  {{ $markdown := transform.PortableText .body }}
  {{ $t.Stop }}
  {{ $content := dict
    "mediaType" "text/markdown"
    "value" $markdown
  }}
  {{ $params := dict
    "portabletext" (.body | jsonify (dict "indent" " "))
  }}
  {{ $page := dict
    "content" $content
    "kind" "page"
    "path" .slug.current
    "title" .title
    "date" (.publishedAt | time )
    "summary" .summary
    "params" $params
  }}
  {{ $.AddPage $page }}
{{ end }}
```
2025-02-25 19:35:47 +01:00
Martey Dodoo
ab9e545760 readme: Fix relative links in Editions section
Make relative gohugo.io links used in Editions section of README
absolute so that they resolve successfully.
2025-02-25 18:26:05 +01:00
Bjørn Erik Pedersen
381c0da85d Fix some related content issues with content adapters
Fixes #13443
2025-02-25 14:14:56 +01:00
Bjørn Erik Pedersen
227e429267 Fix potential nilpointer in httpcache config 2025-02-24 18:42:50 +01:00
Joe Mooring
d0ce942190 hugolib: Deprecate _build front matter key in favor of build
We effectively aliased "_build" to "build" in v0.123.0, and
removed "_build" from the documentation at the same time.
2025-02-24 10:13:53 +01:00
Joe Mooring
4fd7f3233f snap: Update Node.js to 22.x 2025-02-22 07:49:02 -08:00
Bjørn Erik Pedersen
c3d435acfa Fix --printPathWarnings when site calls templates.Defer
This issue was introduced recently in eb7a5aabaa.

Fixes #13420
2025-02-19 12:59:40 +01:00
hugoreleaser
669216e204 releaser: Prepare repository for 0.145.0-DEV
[ci skip]
2025-02-18 12:29:51 +00:00
hugoreleaser
a79d63a446 releaser: Bump versions for release of 0.144.1
[ci skip]
v0.144.1
2025-02-18 12:14:07 +00:00
Bjørn Erik Pedersen
494e88abf6 markup/goldmark: Fix panic on empty Markdown header
Fixes #13416
2025-02-18 11:12:39 +01:00
hugoreleaser
f1e799c2e1 releaser: Prepare repository for 0.145.0-DEV
[ci skip]
2025-02-17 16:36:56 +00:00
hugoreleaser
b289b17c43 releaser: Bump versions for release of 0.144.0
[ci skip]
v0.144.0
2025-02-17 16:22:31 +00:00
Bjørn Erik Pedersen
85c1727748 markup/goldmark: Fix panic on stray attribute nodes 2025-02-17 17:19:53 +01:00
Bjørn Erik Pedersen
641403f7de Fix Position for passthrough hooks
Fixes #13406
2025-02-17 12:23:49 +01:00
Bjørn Erik Pedersen
24cc25552f Fix auto generated header ids so they don't contain e.g. hyperlink destinations (note)
This makes the header ids match the newly added dt ids.

Also make sure newlines are preserved in hooks' `.PlainText`.

Fixes #13405
Fixes #13410
2025-02-17 12:23:49 +01:00
dependabot[bot]
a2ca95629a build(deps): bump github.com/spf13/cobra from 1.8.1 to 1.9.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 12:08:14 +01:00
dependabot[bot]
367fe526e2 build(deps): bump github.com/sanity-io/litter from 1.5.7 to 1.5.8
Bumps [github.com/sanity-io/litter](https://github.com/sanity-io/litter) from 1.5.7 to 1.5.8.
- [Changelog](https://github.com/sanity-io/litter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sanity-io/litter/compare/v1.5.7...v1.5.8)

---
updated-dependencies:
- dependency-name: github.com/sanity-io/litter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 12:06:55 +01:00
Joe Mooring
5de3913ed4 config/allconfig: Deprecate :filename and :slugorfilename tokens 2025-02-17 12:06:32 +01:00
Bjørn Erik Pedersen
7b7a0f3624 resources/page: Revise the new contentbasename permalinks tokens
* Make it work for all pages, including those created from content adapters and not backed by a file.
* Allow the `slug` to win, so the new tokens are:

`:contentbasename`:

1. ContentBaseName

`:slugorcontentbasename`:

1. Slug
2. ContentBaseName

Note that a page will always have a `ContentBaseName`, so no need to fall back to e.g. the title.

Closes #11722
2025-02-17 09:41:49 +01:00
Henrique Dias
cb7a4339b7 resources/page: Add :contentbasename and :contentbasenameorslug permalink tokens
See #11722
2025-02-17 09:41:49 +01:00