Repository: gohugoio/hugo
Pull request #12893 (2024-09-30 08:51:52)

build(deps): bump github.com/hairyhenderson/go-codeowners from 0.5.0 to 0.6.0
Bumps [github.com/hairyhenderson/go-codeowners](https://github.com/hairyhenderson/go-codeowners) from 0.5.0 to 0.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/hairyhenderson/go-codeowners/releases">github.com/hairyhenderson/go-codeowners's releases</a>.</em></p>
<blockquote>
<h2>v0.6.0</h2>
<h2><a href="https://github.com/hairyhenderson/go-codeowners/compare/v0.5.0...v0.6.0">0.6.0</a> (2024-09-27)</h2>
<h3>Features</h3>
<ul>
<li><strong>errors:</strong> Allow checking codeowners file not found (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/41">#41</a>) (<a href="https://github.com/hairyhenderson/go-codeowners/commit/d659b73a08c1a1111c5e9c4c1136472c8ca28a4b">d659b73</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>perf:</strong> Reduce allocations (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/39">#39</a>) (<a href="https://github.com/hairyhenderson/go-codeowners/commit/2ca66e0194d2b9077c63a9d1eace8f1083675fa9">2ca66e0</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/hairyhenderson/go-codeowners/blob/main/CHANGELOG.md">github.com/hairyhenderson/go-codeowners's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/hairyhenderson/go-codeowners/compare/v0.5.0...v0.6.0">0.6.0</a> (2024-09-27)</h2>
<h3>Features</h3>
<ul>
<li><strong>errors:</strong> Allow checking codeowners file not found (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/41">#41</a>) (<a href="https://github.com/hairyhenderson/go-codeowners/commit/d659b73a08c1a1111c5e9c4c1136472c8ca28a4b">d659b73</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>perf:</strong> Reduce allocations (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/39">#39</a>) (<a href="https://github.com/hairyhenderson/go-codeowners/commit/2ca66e0194d2b9077c63a9d1eace8f1083675fa9">2ca66e0</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/hairyhenderson/go-codeowners/commit/01f12d1c3b7e97c1b2e3768c6ea8f617afec67db"><code>01f12d1</code></a> chore(main): release 0.6.0 (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/42">#42</a>)</li>
<li><a href="https://github.com/hairyhenderson/go-codeowners/commit/2ca66e0194d2b9077c63a9d1eace8f1083675fa9"><code>2ca66e0</code></a> fix(perf): Reduce allocations (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/39">#39</a>)</li>
<li><a href="https://github.com/hairyhenderson/go-codeowners/commit/d659b73a08c1a1111c5e9c4c1136472c8ca28a4b"><code>d659b73</code></a> feat(errors): Allow checking codeowners file not found (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/41">#41</a>)</li>
<li><a href="https://github.com/hairyhenderson/go-codeowners/commit/b3a8ae60ad48cfa3733c7779cbedc73b5a877b96"><code>b3a8ae6</code></a> chore(lint): Update lint config (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/38">#38</a>)</li>
<li><a href="https://github.com/hairyhenderson/go-codeowners/commit/2403f4dab25c74749e1c3fc915869317bf0b7d6d"><code>2403f4d</code></a> ci: Install release-please for automated releases (<a href="https://redirect.github.com/hairyhenderson/go-codeowners/issues/37">#37</a>)</li>
<li>See full diff in <a href="https://github.com/hairyhenderson/go-codeowners/compare/v0.5.0...v0.6.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/hairyhenderson/go-codeowners&package-manager=go_modules&previous-version=0.5.0&new-version=0.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/go.mod b/go.mod
index b049672bf..ee52e1e41 100644
--- a/go.mod
+++ b/go.mod
@@ -46,7 +46,7 @@ require (
 	github.com/gohugoio/testmodBuilder/mods v0.0.0-20190520184928-c56af20f2e95
 	github.com/google/go-cmp v0.6.0
 	github.com/gorilla/websocket v1.5.3
-	github.com/hairyhenderson/go-codeowners v0.5.0
+	github.com/hairyhenderson/go-codeowners v0.6.0
 	github.com/jdkato/prose v1.2.1
 	github.com/kylelemons/godebug v1.1.0
 	github.com/kyokomi/emoji/v2 v2.2.13
diff --git a/go.sum b/go.sum
index 17a2e2708..06a32e97c 100644
--- a/go.sum
+++ b/go.sum
@@ -329,8 +329,8 @@ github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS
 github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
 github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
 github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/hairyhenderson/go-codeowners v0.5.0 h1:dpQB+hVHiRc2VVvc2BHxkuM+tmu9Qej/as3apqUbsWc=
-github.com/hairyhenderson/go-codeowners v0.5.0/go.mod h1:R3uW1OQXEj2Gu6/OvZ7bt6hr0qdkLvUWPiqNaWnexpo=
+github.com/hairyhenderson/go-codeowners v0.6.0 h1:cRCtmNf9Ni1GIeiAAlHX5IEEB2gr61813Kx5JmXxAAk=
+github.com/hairyhenderson/go-codeowners v0.6.0/go.mod h1:RFWbGcjlXhRKNezt7AQHmJucY0alk4osN0+RKOsIAa8=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
diff --git a/resources/page/pagemeta/page_frontmatter.go b/resources/page/pagemeta/page_frontmatter.go
index 9491bf1bc..d5d612609 100644
--- a/resources/page/pagemeta/page_frontmatter.go
+++ b/resources/page/pagemeta/page_frontmatter.go
@@ -728,7 +728,7 @@ func (f *frontmatterFieldHandlers) newDateFieldHandler(key string, setter func(d
 	return func(d *FrontMatterDescriptor) (bool, error) {
 		v, found := d.PageConfig.Params[key]
 
-		if !found {
+		if !found || v == "" || v == nil {
 			return false, nil
 		}
 
@@ -739,7 +739,7 @@ func (f *frontmatterFieldHandlers) newDateFieldHandler(key string, setter func(d
 			var err error
 			date, err = htime.ToTimeInDefaultLocationE(v, d.Location)
 			if err != nil {
-				return false, fmt.Errorf("invalid front matter: %s: %s: see %s", key, v, d.PathOrTitle)
+				return false, fmt.Errorf("the %q front matter field is not a parsable date: see %s", key, d.PathOrTitle)
 			}
 			d.PageConfig.Params[key] = date
 		}


Test patch:
diff --git a/resources/page/pagemeta/pagemeta_integration_test.go b/resources/page/pagemeta/pagemeta_integration_test.go
index 4d195b7f0..d0c550b2e 100644
--- a/resources/page/pagemeta/pagemeta_integration_test.go
+++ b/resources/page/pagemeta/pagemeta_integration_test.go
@@ -14,6 +14,7 @@
 package pagemeta_test
 
 import (
+	"strings"
 	"testing"
 
 	"github.com/gohugoio/hugo/hugolib"
@@ -43,3 +44,99 @@ Lastmod: 2024-03-13 06:00:00 &#43;0000 GMT
 Eq: true
 `)
 }
+
+func TestDateValidation(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+disableKinds = ['page','rss','section','sitemap','taxonomy','term']
+-- content/_index.md --
+FRONT_MATTER
+-- layouts/index.html --
+{{ .Date.UTC.Format "2006-01-02" }}
+--
+`
+	errorMsg := `ERROR the "date" front matter field is not a parsable date`
+
+	// TOML: unquoted date/time (valid)
+	f := strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = 2024-10-01
++++
+	`)
+	b := hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "2024-10-01")
+
+	// TOML: string (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = "2024-10-01"
++++
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "2024-10-01")
+
+	// TOML: empty string (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = ""
++++
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "0001-01-01")
+
+	// TOML: int (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = 0
++++
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "1970-01-01")
+
+	// TOML: string (invalid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = "2024-42-42"
++++
+	`)
+	b, _ = hugolib.TestE(t, f)
+	b.AssertLogContains(errorMsg)
+
+	// TOML: bool (invalid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = true
++++
+	`)
+	b, _ = hugolib.TestE(t, f)
+	b.AssertLogContains(errorMsg)
+
+	// TOML: float (invalid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = 6.7
++++
+	`)
+	b, _ = hugolib.TestE(t, f)
+	b.AssertLogContains(errorMsg)
+
+	// JSON: null (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
+{
+  "date": null
+}
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "0001-01-01")
+
+	// YAML: null (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
+---
+date:
+---
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "0001-01-01")
+}
diff --git a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
index c6bffd81a..c0d6d3dff 100644
--- a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
+++ b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
@@ -36,8 +36,8 @@ func TestTailwindV4Basic(t *testing.T) {
     "url": "https://github.com/bep/hugo-starter-tailwind-basic.git"
   },
   "devDependencies": {
-    "@tailwindcss/cli": "4.0.0-alpha.24",
-    "tailwindcss": "4.0.0-alpha.24"
+    "@tailwindcss/cli": "^4.0.0-alpha.26",
+    "tailwindcss": "^4.0.0-alpha.26"
   },
   "name": "hugo-starter-tailwind-basic",
   "version": "0.1.0"