Repository: gohugoio/hugo
Pull request #13702 (2025-05-09 08:01:32)

build(deps): bump github.com/tdewolff/minify/v2 from 2.20.37 to 2.23.5
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.20.37 to 2.23.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tdewolff/minify/releases">github.com/tdewolff/minify/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.23.5</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/a529eb7e4bbcbeea511d57e4e72e728f2e5b386c">CSS: add space before !important when KeepCSS2 is set,</a> <a href="https://github.com/tdewolff/minify/commit/a529eb7e4bbcbeea511d57e4e72e728f2e5b386c">fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/818">tdewolff/minify#818</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/4f2a6e689fa6b044f8a8ebfdfce9818f01c4daab">SVG: keep xlink namespace</a></li>
</ul>
<h2>v2.23.4</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/7807619eedbd4d884a762a1dbe615ca2c04566d3">Set minimum Go version to 1.17</a></li>
</ul>
<h2>v2.23.3</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/c2687079f9efd636c272576ffb7059ac0ee619c9">cmd: add importmap JSON minifier, see</a> <a href="https://redirect.github.com/tdewolff/minify/issues/812">tdewolff/minify#812</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/324b0cf40174307a7134149da800966a0ef64c8a">cmd: fix tests</a></li>
</ul>
<h2>v2.23.2</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/228ca9848f6af3e5b075f66075f306c2e5ebd430">cmd:  set default mimetype for .tmpl to text/x-template</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/60a240ad376cb117d03196ff27364af21fefa7ec">CSS: revert</a> <a href="https://github.com/tdewolff/minify/commit/dc25ed9e803528609803bf63b08f42171e92f53a">https://github.com/tdewolff/minify/commit/dc25ed9e803528609803bf63b08f42171e92f53a</a> <a href="https://github.com/tdewolff/minify/commit/60a240ad376cb117d03196ff27364af21fefa7ec">and remove source mapping URLs,</a> <a href="https://github.com/tdewolff/minify/commit/60a240ad376cb117d03196ff27364af21fefa7ec">fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/814%5B">tdewolff/minify#814</a>, see](<a href="https://github.com/tdewolff/minify/commit/60a240ad376cb117d03196ff27364af21fefa7ec">https://github.com/tdewolff/minify/commit/60a240ad376cb117d03196ff27364af21fefa7ec</a>) <a href="https://redirect.github.com/tdewolff/minify/issues/692">tdewolff/minify#692</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/abac89fe42041506aae1201ce226323fcb5f6315">cmd: add -i/--inplace option</a></li>
</ul>
<h2>v2.23.1</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/e6839b4a66852812a633d70bb6ca876090a373ae">HTML: fix templates starting with &lt;,</a> <a href="https://github.com/tdewolff/minify/commit/e6839b4a66852812a633d70bb6ca876090a373ae">fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/809">tdewolff/minify#809</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/9b9e4f768a8c2728de2fe1cd82d6b485f37ab3d6">SVG: keep the xmlns:svg namespace, see</a> <a href="https://redirect.github.com/tdewolff/minify/issues/803">tdewolff/minify#803</a></li>
</ul>
<h2>v2.23.0</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/8ea22776eaaf3c0922c87fa2d0925a93d07bbec8">Downgrade minimum Go version to 1.18, fixes GitHub actions</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/0904a4109c0d0a4e7797c72ac8d9c9bdb42956cd">JS: improve rewriting Number(...), fix bug for Numebr(100n),</a> <a href="https://github.com/tdewolff/minify/commit/0904a4109c0d0a4e7797c72ac8d9c9bdb42956cd">fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/806">tdewolff/minify#806</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/263f6d8db045e0f13cd9d0db33607eac102197b6">JS: don't convert Number(x) =&gt; +x, this doesn't work for BigInts, fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/806">tdewolff/minify#806</a>, see <a href="https://redirect.github.com/tdewolff/minify/issues/794">tdewolff/minify#794</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/573513d79f02cc9d3a652a9eab9fdfa5598799df">HTML: minify whitespace around template tokens in text</a></li>
</ul>
<h2>v2.22.4</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/5e043d341ac374edd05f0dea28178cbd4cc39fb2">JS: fix renamed variables in rewritten functions</a></li>
</ul>
<h2>v2.22.3</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/d4af2424789b325427f37f6ac9593c60bad9b689">JS: fix bug for renamed variables in rewritten math.* functions</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/13196aec4c8bdc8e6d7c8b1648c5f4f833393c16">SVG: remove tags and attributes from other namespaces, remove empty <!-- raw HTML omitted -->; fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/803">tdewolff/minify#803</a></li>
</ul>
<h2>v2.22.2</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/9359d9ac61ddaea8a312a6fa07e4e6fdc6661f7a">JS: fix grouping for function to expression transformations</a> fixes <a href="https://redirect.github.com/privatenumber/minification-benchmarks/pull/668#event-16769331378">privatenumber/minification-benchmarks#668</a></li>
</ul>
<h2>v2.22.1</h2>
<p>Update dependencies</p>
<h2>v2.22.0</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/55cda6b9603bc3b20209290417fb389e022b36ae">JS: change undefined=&gt;0[0] and void 0=&gt;0[0], see</a> <a href="https://redirect.github.com/tdewolff/minify/issues/790">tdewolff/minify#790</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/ee34e323d9ef156e2361ce64396b7ac44f32730e">JS: add shorter versions for isNaN, parseInt, Number, Math.pow, Math.abs, and Math.trunc</a>, fixes <a href="https://redirect.github.com/tdewolff/minify/issues/790">tdewolff/minify#790</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/b60a115a7868a5d104e1b79db48d4c62d42a30b6">JS: don't minify undefined/Infinity if that variable was declared, fixes</a>  <a href="https://redirect.github.com/tdewolff/minify/issues/728">tdewolff/minify#728</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/2d27b5b575850e8e4a2d674a7cab4d58e730a494">Fix URL decoding of UTF-8 characters,</a> <a href="https://github.com/tdewolff/minify/commit/2d27b5b575850e8e4a2d674a7cab4d58e730a494">fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/796">tdewolff/minify#796</a></li>
</ul>
<h2>v2.21.3</h2>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/7734bb058a73634d321cc36ab6d0c040402f0942">Rename benchmarks/ to _benchmarks/,</a> <a href="https://github.com/tdewolff/minify/commit/7734bb058a73634d321cc36ab6d0c040402f0942">fixes</a> <a href="https://redirect.github.com/tdewolff/minify/issues/792">tdewolff/minify#792</a></li>
</ul>
<h2>v2.21.2</h2>
<ul>
<li>HTML: fix parsing of tags with special characters, fixes <a href="https://redirect.github.com/tdewolff/minify/issues/772">#772</a> and <a href="https://redirect.github.com/tdewolff/minify/issues/743">#743</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/tdewolff/minify/commit/a529eb7e4bbcbeea511d57e4e72e728f2e5b386c"><code>a529eb7</code></a> CSS: add space before !important when KeepCSS2 is set, fixes <a href="https://redirect.github.com/tdewolff/minify/issues/818">#818</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/4f2a6e689fa6b044f8a8ebfdfce9818f01c4daab"><code>4f2a6e6</code></a> SVG: keep xlink namespace</li>
<li><a href="https://github.com/tdewolff/minify/commit/9e07ca89fe48a0431c34b47bc9bf6f835a4e8b35"><code>9e07ca8</code></a> Update parse</li>
<li><a href="https://github.com/tdewolff/minify/commit/7807619eedbd4d884a762a1dbe615ca2c04566d3"><code>7807619</code></a> Set minimum Go version to 1.17</li>
<li><a href="https://github.com/tdewolff/minify/commit/324b0cf40174307a7134149da800966a0ef64c8a"><code>324b0cf</code></a> cmd: fix tests</li>
<li><a href="https://github.com/tdewolff/minify/commit/c2687079f9efd636c272576ffb7059ac0ee619c9"><code>c268707</code></a> cmd: add importmap JSON minifier, see <a href="https://redirect.github.com/tdewolff/minify/issues/812">#812</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/228ca9848f6af3e5b075f66075f306c2e5ebd430"><code>228ca98</code></a> cmd: fix --inplace bugs, set default mimetype for .tmpl to text/x-template</li>
<li><a href="https://github.com/tdewolff/minify/commit/60a240ad376cb117d03196ff27364af21fefa7ec"><code>60a240a</code></a> CSS: revert dc25ed9 and remove source mapping URLs, fixes <a href="https://redirect.github.com/tdewolff/minify/issues/814">#814</a>, see <a href="https://redirect.github.com/tdewolff/minify/issues/692">#692</a></li>
<li><a href="https://github.com/tdewolff/minify/commit/abac89fe42041506aae1201ce226323fcb5f6315"><code>abac89f</code></a> cli: add -i/--inplace option</li>
<li><a href="https://github.com/tdewolff/minify/commit/e6839b4a66852812a633d70bb6ca876090a373ae"><code>e6839b4</code></a> HTNL: fix templates starting with &lt;, fixes <a href="https://redirect.github.com/tdewolff/minify/issues/809">#809</a></li>
<li>Additional commits viewable in <a href="https://github.com/tdewolff/minify/compare/v2.20.37...v2.23.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/tdewolff/minify/v2&package-manager=go_modules&previous-version=2.20.37&new-version=2.23.5)](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>

jmooring: @dependabot rebase

Patch:
diff --git a/README.md b/README.md
index e0b3f1567..9befa9c9d 100644
--- a/README.md
+++ b/README.md
@@ -65,9 +65,11 @@ See the [features] section of the documentation for a comprehensive summary of H
 
 <p>&nbsp;</p>
 <p float="left">
-  <a href="https://www.linode.com/?utm_campaign=hugosponsor&utm_medium=banner&utm_source=hugogithub" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/assets/images/sponsors/linode-logo_standard_light_medium.png" width="200" alt="Linode"></a>
+  <a href="https://www.linode.com/?utm_campaign=hugosponsor&utm_medium=banner&utm_source=hugogithub" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/hugoDocs/master/assets/images/sponsors/linode-logo_standard_light_medium.png" width="200" alt="Linode"></a>
 &nbsp;&nbsp;&nbsp;
-  <a href="https://www.jetbrains.com/go/?utm_source=OSS&utm_medium=referral&utm_campaign=hugo" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/assets/images/sponsors/goland.svg" width="200" alt="The complete IDE crafted for professional Go developers."></a>
+  <a href="https://www.jetbrains.com/go/?utm_source=OSS&utm_medium=referral&utm_campaign=hugo" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/hugoDocs/master/assets/images/sponsors/goland.svg" width="200" alt="The complete IDE crafted for professional Go developers."></a>
+  &nbsp;&nbsp;&nbsp;
+  <a href="https://pinme.eth.limo/?s=hugo" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/hugoDocs/master/assets/images/sponsors/logo-pinme.svg" width="200" alt="PinMe."></a>
 </p>
 
 ## Editions
diff --git a/commands/new.go b/commands/new.go
index fdc1f65f2..81e1c65a4 100644
--- a/commands/new.go
+++ b/commands/new.go
@@ -76,10 +76,8 @@ Ensure you run this within the root directory of your site.`,
 			&simpleCommand{
 				name:  "site",
 				use:   "site [path]",
-				short: "Create a new site (skeleton)",
-				long: `Create a new site in the provided directory.
-The new site will have the correct structure, but no content or theme yet.
-Use ` + "`hugo new [contentPath]`" + ` to create new content.`,
+				short: "Create a new site",
+				long:  `Create a new site at the specified path.`,
 				run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
 					if len(args) < 1 {
 						return newUserError("path needs to be provided")
@@ -124,11 +122,9 @@ Use ` + "`hugo new [contentPath]`" + ` to create new content.`,
 			&simpleCommand{
 				name:  "theme",
 				use:   "theme [name]",
-				short: "Create a new theme (skeleton)",
-				long: `Create a new theme (skeleton) called [name] in ./themes.
-New theme is a skeleton. Please add content to the touched files. Add your
-name to the copyright line in the license and adjust the theme.toml file
-according to your needs.`,
+				short: "Create a new theme",
+				long: `Create a new theme with the specified name in the ./themes directory.
+This generates a functional theme including template examples and sample content.`,
 				run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
 					if len(args) < 1 {
 						return newUserError("theme name needs to be provided")
diff --git a/config/allconfig/alldecoders.go b/config/allconfig/alldecoders.go
index 1cfa1afc4..035349790 100644
--- a/config/allconfig/alldecoders.go
+++ b/config/allconfig/alldecoders.go
@@ -330,7 +330,7 @@ var allDecoderSetups = map[string]decodeWeight{
 		key: "cascade",
 		decode: func(d decodeWeight, p decodeConfig) error {
 			var err error
-			p.c.Cascade, err = page.DecodeCascadeConfig(nil, p.p.Get(d.key))
+			p.c.Cascade, err = page.DecodeCascadeConfig(nil, true, p.p.Get(d.key))
 			return err
 		},
 	},
diff --git a/config/allconfig/load.go b/config/allconfig/load.go
index 2d9185f6f..4fb8bbaef 100644
--- a/config/allconfig/load.go
+++ b/config/allconfig/load.go
@@ -233,40 +233,51 @@ func (l configLoader) applyOsEnvOverrides(environ []string) error {
 
 		if existing != nil {
 			val, err := metadecoders.Default.UnmarshalStringTo(env.Value, existing)
-			if err != nil {
+			if err == nil {
+				val = l.envValToVal(env.Key, val)
+				if owner != nil {
+					owner[nestedKey] = val
+				} else {
+					l.cfg.Set(env.Key, val)
+				}
 				continue
 			}
+		}
 
-			if owner != nil {
-				owner[nestedKey] = val
-			} else {
-				l.cfg.Set(env.Key, val)
-			}
+		if owner != nil && nestedKey != "" {
+			owner[nestedKey] = env.Value
 		} else {
-			if nestedKey != "" {
-				owner[nestedKey] = env.Value
-			} else {
-				var val any
-				key := strings.ReplaceAll(env.Key, delim, ".")
-				_, ok := allDecoderSetups[key]
-				if ok {
-					// A map.
-					if v, err := metadecoders.Default.UnmarshalStringTo(env.Value, map[string]any{}); err == nil {
-						val = v
-					}
+			var val any
+			key := strings.ReplaceAll(env.Key, delim, ".")
+			_, ok := allDecoderSetups[key]
+			if ok {
+				// A map.
+				if v, err := metadecoders.Default.UnmarshalStringTo(env.Value, map[string]any{}); err == nil {
+					val = v
 				}
-				if val == nil {
-					// A string.
-					val = l.envStringToVal(key, env.Value)
-				}
-				l.cfg.Set(key, val)
 			}
+
+			if val == nil {
+				// A string.
+				val = l.envStringToVal(key, env.Value)
+			}
+			l.cfg.Set(key, val)
 		}
+
 	}
 
 	return nil
 }
 
+func (l *configLoader) envValToVal(k string, v any) any {
+	switch v := v.(type) {
+	case string:
+		return l.envStringToVal(k, v)
+	default:
+		return v
+	}
+}
+
 func (l *configLoader) envStringToVal(k, v string) any {
 	switch k {
 	case "disablekinds", "disablelanguages":
diff --git a/go.mod b/go.mod
index 6a83524d6..c51a5fc52 100644
--- a/go.mod
+++ b/go.mod
@@ -66,8 +66,8 @@ require (
 	github.com/spf13/cobra v1.9.1
 	github.com/spf13/fsync v0.10.1
 	github.com/spf13/pflag v1.0.6
-	github.com/tdewolff/minify/v2 v2.20.37
-	github.com/tdewolff/parse/v2 v2.7.15
+	github.com/tdewolff/minify/v2 v2.23.5
+	github.com/tdewolff/parse/v2 v2.8.0
 	github.com/tetratelabs/wazero v1.9.0
 	github.com/yuin/goldmark v1.7.11
 	github.com/yuin/goldmark-emoji v1.0.6
diff --git a/go.sum b/go.sum
index 7dd0507b6..a70bc0390 100644
--- a/go.sum
+++ b/go.sum
@@ -449,13 +449,12 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
 github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
 github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
 github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/tdewolff/minify/v2 v2.20.37 h1:Q97cx4STXCh1dlWDlNHZniE8BJ2EBL0+2b0n92BJQhw=
-github.com/tdewolff/minify/v2 v2.20.37/go.mod h1:L1VYef/jwKw6Wwyk5A+T0mBjjn3mMPgmjjA688RNsxU=
-github.com/tdewolff/parse/v2 v2.7.15 h1:hysDXtdGZIRF5UZXwpfn3ZWRbm+ru4l53/ajBRGpCTw=
-github.com/tdewolff/parse/v2 v2.7.15/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA=
-github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
-github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo=
-github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
+github.com/tdewolff/minify/v2 v2.23.5 h1:/P548KcpTkIOUvNg22zN83/GiaYSOIrbqtoue4I7kYM=
+github.com/tdewolff/minify/v2 v2.23.5/go.mod h1:2RI9tiIrzJU1Z5EasXEPaI1MqobRyxKHOOgrRkq5oEw=
+github.com/tdewolff/parse/v2 v2.8.0 h1:jW0afj6zpUGXuZTwJ7/UfP2SddyLalb/SDryjaMTkA4=
+github.com/tdewolff/parse/v2 v2.8.0/go.mod h1:Hwlni2tiVNKyzR1o6nUs4FOF07URA+JLBLd6dlIXYqo=
+github.com/tdewolff/test v1.0.11 h1:FdLbwQVHxqG16SlkGveC0JVyrJN62COWTRyUFzfbtBE=
+github.com/tdewolff/test v1.0.11/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
 github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
 github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=
 github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
diff --git a/hugolib/content_map.go b/hugolib/content_map.go
index 454d36df7..596a8f7f9 100644
--- a/hugolib/content_map.go
+++ b/hugolib/content_map.go
@@ -356,7 +356,7 @@ func (m *pageMap) addPagesFromGoTmplFi(fi hugofs.FileMetaInfo, buildConfig *Buil
 				Watching:          s.Conf.Watching(),
 				HandlePage: func(pt *pagesfromdata.PagesFromTemplate, pc *pagemeta.PageConfig) error {
 					s := pt.Site.(*Site)
-					if err := pc.Compile(pt.GoTmplFi.Meta().PathInfo.Base(), true, "", s.Log, s.conf.OutputFormats.Config, s.conf.MediaTypes.Config); err != nil {
+					if err := pc.CompileForPagesFromDataPre(pt.GoTmplFi.Meta().PathInfo.Base(), m.s.Log, s.conf.MediaTypes.Config); err != nil {
 						return err
 					}
 
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index be834fbb6..9e67fbb1b 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -1695,7 +1695,9 @@ func (sa *sitePagesAssembler) assembleTermsAndTranslations() error {
 							pathInfo: pi,
 							pageMetaParams: &pageMetaParams{
 								pageConfig: &pagemeta.PageConfig{
-									Kind: kinds.KindTerm,
+									PageConfigEarly: pagemeta.PageConfigEarly{
+										Kind: kinds.KindTerm,
+									},
 								},
 							},
 						}
@@ -1956,7 +1958,9 @@ func (sa *sitePagesAssembler) addStandalonePages() error {
 			pathInfo: s.Conf.PathParser().Parse(files.ComponentFolderContent, key+f.MediaType.FirstSuffix.FullSuffix),
 			pageMetaParams: &pageMetaParams{
 				pageConfig: &pagemeta.PageConfig{
-					Kind: kind,
+					PageConfigEarly: pagemeta.PageConfigEarly{
+						Kind: kind,
+					},
 				},
 			},
 			standaloneOutputFormat: f,
@@ -2082,7 +2086,9 @@ func (sa *sitePagesAssembler) addMissingRootSections() error {
 			pathInfo: p,
 			pageMetaParams: &pageMetaParams{
 				pageConfig: &pagemeta.PageConfig{
-					Kind: kinds.KindHome,
+					PageConfigEarly: pagemeta.PageConfigEarly{
+						Kind: kinds.KindHome,
+					},
 				},
 			},
 		}
@@ -2115,7 +2121,9 @@ func (sa *sitePagesAssembler) addMissingTaxonomies() error {
 				pathInfo: sa.Conf.PathParser().Parse(files.ComponentFolderContent, key+"/_index.md"),
 				pageMetaParams: &pageMetaParams{
 					pageConfig: &pagemeta.PageConfig{
-						Kind: kinds.KindTaxonomy,
+						PageConfigEarly: pagemeta.PageConfigEarly{
+							Kind: kinds.KindTaxonomy,
+						},
 					},
 				},
 				singular: viewName.singular,
diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go
index 94dbbab3e..e8bce20d1 100644
--- a/hugolib/page__meta.go
+++ b/hugolib/page__meta.go
@@ -72,12 +72,7 @@ type pageMeta struct {
 // Prepare for a rebuild of the data passed in from front matter.
 func (m *pageMeta) setMetaPostPrepareRebuild() {
 	params := xmaps.Clone(m.paramsOriginal)
-	m.pageMetaParams.pageConfig = &pagemeta.PageConfig{
-		Kind:   m.pageConfig.Kind,
-		Lang:   m.pageConfig.Lang,
-		Path:   m.pageConfig.Path,
-		Params: params,
-	}
+	m.pageMetaParams.pageConfig = pagemeta.ClonePageConfigForRebuild(m.pageMetaParams.pageConfig, params)
 }
 
 type pageMetaParams struct {
@@ -94,7 +89,11 @@ type pageMetaParams struct {
 
 func (m *pageMetaParams) init(preserveOriginal bool) {
 	if preserveOriginal {
-		m.paramsOriginal = xmaps.Clone[maps.Params](m.pageConfig.Params)
+		if m.pageConfig.IsFromContentAdapter {
+			m.paramsOriginal = xmaps.Clone(m.pageConfig.ContentAdapterData)
+		} else {
+			m.paramsOriginal = xmaps.Clone(m.pageConfig.Params)
+		}
 		m.cascadeOriginal = m.pageConfig.CascadeCompiled.Clone()
 	}
 }
@@ -254,7 +253,7 @@ func (p *pageMeta) setMetaPre(pi *contentParseInfo, logger loggers.Logger, conf
 		// Check for any cascade define on itself.
 		if cv, found := frontmatter["cascade"]; found {
 			var err error
-			cascade, err := page.DecodeCascade(logger, cv)
+			cascade, err := page.DecodeCascade(logger, true, cv)
 			if err != nil {
 				return err
 			}
@@ -341,18 +340,29 @@ func (ps *pageState) setMetaPost(cascade *maps.Ordered[page.PageMatcher, maps.Pa
 	}
 
 	// Cascade is also applied to itself.
+	var err error
 	cascade.Range(func(k page.PageMatcher, v maps.Params) bool {
 		if !k.Matches(ps) {
 			return true
 		}
 		for kk, vv := range v {
-			if _, found := ps.m.pageConfig.Params[kk]; !found {
-				ps.m.pageConfig.Params[kk] = vv
+			if ps.m.pageConfig.IsFromContentAdapter {
+				if _, found := ps.m.pageConfig.ContentAdapterData[kk]; !found {
+					ps.m.pageConfig.ContentAdapterData[kk] = vv
+				}
+			} else {
+				if _, found := ps.m.pageConfig.Params[kk]; !found {
+					ps.m.pageConfig.Params[kk] = vv
+				}
 			}
 		}
 		return true
 	})
 
+	if err != nil {
+		return err
+	}
+
 	if err := ps.setMetaPostParams(); err != nil {
 		return err
 	}
@@ -398,6 +408,12 @@ func (p *pageState) setMetaPostParams() error {
 		PathOrTitle:   p.pathOrTitle(),
 	}
 
+	if isContentAdapter {
+		if err := pm.pageConfig.Compile(ext, p.s.Log, p.s.conf.OutputFormats.Config, p.s.conf.MediaTypes.Config); err != nil {
+			return err
+		}
+	}
+
 	// Handle the date separately
 	// TODO(bep) we need to "do more" in this area so this can be split up and
 	// more easily tested without the Page, but the coupling is strong.
@@ -656,7 +672,7 @@ params:
 		return err
 	}
 
-	if err := pcfg.Compile("", false, ext, p.s.Log, p.s.conf.OutputFormats.Config, p.s.conf.MediaTypes.Config); err != nil {
+	if err := pcfg.Compile(ext, p.s.Log, p.s.conf.OutputFormats.Config, p.s.conf.MediaTypes.Config); err != nil {
 		return err
 	}
 
diff --git a/hugolib/pagesfromdata/pagesfromgotmpl.go b/hugolib/pagesfromdata/pagesfromgotmpl.go
index a704b39ee..72909a40b 100644
--- a/hugolib/pagesfromdata/pagesfromgotmpl.go
+++ b/hugolib/pagesfromdata/pagesfromgotmpl.go
@@ -91,17 +91,20 @@ func (p *pagesFromDataTemplateContext) AddPage(v any) (string, error) {
 
 	pd := pagemeta.DefaultPageConfig
 	pd.IsFromContentAdapter = true
+	pd.ContentAdapterData = m
 
-	if err := mapstructure.WeakDecode(m, &pd); err != nil {
-		return "", fmt.Errorf("failed to decode page map: %w", err)
+	// The rest will be handled after the cascade is calculated and applied.
+	if err := mapstructure.WeakDecode(pd.ContentAdapterData, &pd.PageConfigEarly); err != nil {
+		err = fmt.Errorf("failed to decode page map: %w", err)
+		return "", err
 	}
 
-	p.p.buildState.NumPagesAdded++
-
 	if err := pd.Validate(true); err != nil {
 		return "", err
 	}
 
+	p.p.buildState.NumPagesAdded++
+
 	return "", p.p.HandlePage(p.p, &pd)
 }
 
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index cc8a145d9..56bf1ff9e 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -398,6 +398,10 @@ func doRenderShortcode(
 			return true
 		}
 		base, layoutDescriptor := po.GetInternalTemplateBasePathAndDescriptor()
+
+		// With shortcodes/mymarkdown.md (only), this allows {{% mymarkdown %}} when rendering HTML,
+		// but will not resolve any template when doing {{< mymarkdown >}}.
+		layoutDescriptor.AlwaysAllowPlainText = sc.doMarkup
 		q := tplimpl.TemplateQuery{
 			Path:     base,
 			Name:     sc.name,
@@ -405,10 +409,9 @@ func doRenderShortcode(
 			Desc:     layoutDescriptor,
 			Consider: include,
 		}
-		v := s.TemplateStore.LookupShortcode(q)
+		v, err := s.TemplateStore.LookupShortcode(q)
 		if v == nil {
-			s.Log.Errorf("Unable to locate template for shortcode %q in page %q", sc.name, p.File().Path())
-			return zeroShortcode, nil
+			return zeroShortcode, err
 		}
 		tmpl = v
 		hasVariants = hasVariants || len(ofCount) > 1
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 5d373cd71..82c1a31e7 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
 # Release env. 
 # These will be replaced by script before release.
-HUGORELEASER_TAG=v0.147.2
-HUGORELEASER_COMMITISH=c7feb15d10b29a94d7fb57c31e8bcb2e92718fb7
+HUGORELEASER_TAG=v0.147.3
+HUGORELEASER_COMMITISH=05417512bd001c0b2cc0042dcc584575825b89b3
+
 
 
 
diff --git a/resources/page/page_matcher.go b/resources/page/page_matcher.go
index 1e98b0836..27a7c7e9e 100644
--- a/resources/page/page_matcher.go
+++ b/resources/page/page_matcher.go
@@ -16,6 +16,7 @@ package page
 import (
 	"fmt"
 	"path/filepath"
+	"slices"
 	"strings"
 
 	"github.com/gohugoio/hugo/common/loggers"
@@ -24,7 +25,6 @@ import (
 	"github.com/gohugoio/hugo/hugofs/glob"
 	"github.com/gohugoio/hugo/resources/kinds"
 	"github.com/mitchellh/mapstructure"
-	"slices"
 )
 
 // A PageMatcher can be used to match a Page with Glob patterns.
@@ -105,7 +105,7 @@ func CheckCascadePattern(logger loggers.Logger, m PageMatcher) {
 	}
 }
 
-func DecodeCascadeConfig(logger loggers.Logger, in any) (*config.ConfigNamespace[[]PageMatcherParamsConfig, *maps.Ordered[PageMatcher, maps.Params]], error) {
+func DecodeCascadeConfig(logger loggers.Logger, handleLegacyFormat bool, in any) (*config.ConfigNamespace[[]PageMatcherParamsConfig, *maps.Ordered[PageMatcher, maps.Params]], error) {
 	buildConfig := func(in any) (*maps.Ordered[PageMatcher, maps.Params], any, error) {
 		cascade := maps.NewOrdered[PageMatcher, maps.Params]()
 		if in == nil {
@@ -120,7 +120,15 @@ func DecodeCascadeConfig(logger loggers.Logger, in any) (*config.ConfigNamespace
 
 		for _, m := range ms {
 			m = maps.CleanConfigStringMap(m)
-			c, err := mapToPageMatcherParamsConfig(m)
+			var (
+				c   PageMatcherParamsConfig
+				err error
+			)
+			if handleLegacyFormat {
+				c, err = mapToPageMatcherParamsConfigLegacy(m)
+			} else {
+				c, err = mapToPageMatcherParamsConfig(m)
+			}
 			if err != nil {
 				return nil, nil, err
 			}
@@ -155,8 +163,8 @@ func DecodeCascadeConfig(logger loggers.Logger, in any) (*config.ConfigNamespace
 }
 
 // DecodeCascade decodes in which could be either a map or a slice of maps.
-func DecodeCascade(logger loggers.Logger, in any) (*maps.Ordered[PageMatcher, maps.Params], error) {
-	conf, err := DecodeCascadeConfig(logger, in)
+func DecodeCascade(logger loggers.Logger, handleLegacyFormat bool, in any) (*maps.Ordered[PageMatcher, maps.Params], error) {
+	conf, err := DecodeCascadeConfig(logger, handleLegacyFormat, in)
 	if err != nil {
 		return nil, err
 	}
@@ -164,6 +172,26 @@ func DecodeCascade(logger loggers.Logger, in any) (*maps.Ordered[PageMatcher, ma
 }
 
 func mapToPageMatcherParamsConfig(m map[string]any) (PageMatcherParamsConfig, error) {
+	var pcfg PageMatcherParamsConfig
+	for k, v := range m {
+		switch strings.ToLower(k) {
+		case "_target", "target":
+			var target PageMatcher
+			if err := decodePageMatcher(v, &target); err != nil {
+				return pcfg, err
+			}
+			pcfg.Target = target
+		default:
+			if pcfg.Params == nil {
+				pcfg.Params = make(maps.Params)
+			}
+			pcfg.Params[k] = v
+		}
+	}
+	return pcfg, pcfg.init()
+}
+
+func mapToPageMatcherParamsConfigLegacy(m map[string]any) (PageMatcherParamsConfig, error) {
 	var pcfg PageMatcherParamsConfig
 	for k, v := range m {
 		switch strings.ToLower(k) {
@@ -190,7 +218,6 @@ func mapToPageMatcherParamsConfig(m map[string]any) (PageMatcherParamsConfig, er
 			}
 			pcfg.Target = target
 		default:
-			// Legacy config.
 			if pcfg.Params == nil {
 				pcfg.Params = make(maps.Params)
 			}
diff --git a/resources/page/pagemeta/page_frontmatter.go b/resources/page/pagemeta/page_frontmatter.go
index eb52e5055..7dea7ca6b 100644
--- a/resources/page/pagemeta/page_frontmatter.go
+++ b/resources/page/pagemeta/page_frontmatter.go
@@ -33,6 +33,7 @@ import (
 	"github.com/gohugoio/hugo/resources/kinds"
 	"github.com/gohugoio/hugo/resources/page"
 	"github.com/gohugoio/hugo/resources/resource"
+	"github.com/mitchellh/mapstructure"
 
 	"github.com/gohugoio/hugo/helpers"
 
@@ -75,35 +76,43 @@ func (d Dates) IsAllDatesZero() bool {
 	return d.Date.IsZero() && d.Lastmod.IsZero() && d.PublishDate.IsZero() && d.ExpiryDate.IsZero()
 }
 
+// Page config that needs to be set early. These cannot be modified by cascade.
+type PageConfigEarly struct {
+	Kind    string // The kind of page, e.g. "page", "section", "home" etc. This is usually derived from the content path.
+	Path    string // The canonical path to the page, e.g. /sect/mypage. Note: Leading slash, no trailing slash, no extensions or language identifiers.
+	Lang    string // The language code for this page. This is usually derived from the module mount or filename.
+	Cascade []map[string]any
+
+	// Content holds the content for this page.
+	Content Source
+}
+
 // PageConfig configures a Page, typically from front matter.
 // Note that all the top level fields are reserved Hugo keywords.
 // Any custom configuration needs to be set in the Params map.
 type PageConfig struct {
 	Dates Dates `json:"-"` // Dates holds the four core dates for this page.
 	DatesStrings
-	Title          string   // The title of the page.
-	LinkTitle      string   // The link title of the page.
-	Type           string   // The content type of the page.
-	Layout         string   // The layout to use for to render this page.
-	Weight         int      // The weight of the page, used in sorting if set to a non-zero value.
-	Kind           string   // The kind of page, e.g. "page", "section", "home" etc. This is usually derived from the content path.
-	Path           string   // The canonical path to the page, e.g. /sect/mypage. Note: Leading slash, no trailing slash, no extensions or language identifiers.
-	Lang           string   // The language code for this page. This is usually derived from the module mount or filename.
-	URL            string   // The URL to the rendered page, e.g. /sect/mypage.html.
-	Slug           string   // The slug for this page.
-	Description    string   // The description for this page.
-	Summary        string   // The summary for this page.
-	Draft          bool     // Whether or not the content is a draft.
-	Headless       bool     `json:"-"` // Whether or not the page should be rendered.
-	IsCJKLanguage  bool     // Whether or not the content is in a CJK language.
-	TranslationKey string   // The translation key for this page.
-	Keywords       []string // The keywords for this page.
-	Aliases        []string // The aliases for this page.
-	Outputs        []string // The output formats to render this page in. If not set, the site's configured output formats for this page kind will be used.
+	PageConfigEarly `mapstructure:",squash"`
+	Title           string   // The title of the page.
+	LinkTitle       string   // The link title of the page.
+	Type            string   // The content type of the page.
+	Layout          string   // The layout to use for to render this page.
+	Weight          int      // The weight of the page, used in sorting if set to a non-zero value.
+	URL             string   // The URL to the rendered page, e.g. /sect/mypage.html.
+	Slug            string   // The slug for this page.
+	Description     string   // The description for this page.
+	Summary         string   // The summary for this page.
+	Draft           bool     // Whether or not the content is a draft.
+	Headless        bool     `json:"-"` // Whether or not the page should be rendered.
+	IsCJKLanguage   bool     // Whether or not the content is in a CJK language.
+	TranslationKey  string   // The translation key for this page.
+	Keywords        []string // The keywords for this page.
+	Aliases         []string // The aliases for this page.
+	Outputs         []string // The output formats to render this page in. If not set, the site's configured output formats for this page kind will be used.
 
 	FrontMatterOnlyValues `mapstructure:"-" json:"-"`
 
-	Cascade []map[string]any
 	Sitemap config.SitemapConfig
 	Build   BuildConfig
 	Menus   any // Can be a string, []string or map[string]any.
@@ -111,8 +120,9 @@ type PageConfig struct {
 	// User defined params.
 	Params maps.Params
 
-	// Content holds the content for this page.
-	Content Source
+	// The raw data from the content adapter.
+	// TODO(bep) clean up the ContentAdapterData vs Params.
+	ContentAdapterData map[string]any `mapstructure:"-" json:"-"`
 
 	// Compiled values.
 	CascadeCompiled         *maps.Ordered[page.PageMatcher, maps.Params] `mapstructure:"-" json:"-"`
@@ -121,6 +131,20 @@ type PageConfig struct {
 	IsFromContentAdapter    bool                                         `mapstructure:"-" json:"-"`
 }
 
+func ClonePageConfigForRebuild(p *PageConfig, params map[string]any) *PageConfig {
+	pp := &PageConfig{
+		PageConfigEarly:      p.PageConfigEarly,
+		IsFromContentAdapter: p.IsFromContentAdapter,
+	}
+	if pp.IsFromContentAdapter {
+		pp.ContentAdapterData = params
+	} else {
+		pp.Params = params
+	}
+
+	return pp
+}
+
 var DefaultPageConfig = PageConfig{
 	Build: DefaultBuildConfig,
 }
@@ -151,8 +175,7 @@ func (p *PageConfig) Validate(pagesFromData bool) error {
 	return nil
 }
 
-// Compile sets up the page configuration after all fields have been set.
-func (p *PageConfig) Compile(basePath string, pagesFromData bool, ext string, logger loggers.Logger, outputFormats output.Formats, mediaTypes media.Types) error {
+func (p *PageConfig) CompileForPagesFromDataPre(basePath string, logger loggers.Logger, mediaTypes media.Types) error {
 	// In content adapters, we always get relative paths.
 	if basePath != "" {
 		p.Path = path.Join(basePath, p.Path)
@@ -160,12 +183,32 @@ func (p *PageConfig) Compile(basePath string, pagesFromData bool, ext string, lo
 
 	if p.Params == nil {
 		p.Params = make(maps.Params)
-	} else if pagesFromData {
-		p.Params = maps.PrepareParamsClone(p.Params)
 	} else {
-		maps.PrepareParams(p.Params)
+		p.Params = maps.PrepareParamsClone(p.Params)
 	}
 
+	if p.Kind == "" {
+		p.Kind = kinds.KindPage
+	}
+
+	if p.Cascade != nil {
+		cascade, err := page.DecodeCascade(logger, false, p.Cascade)
+		if err != nil {
+			return fmt.Errorf("failed to decode cascade: %w", err)
+		}
+		p.CascadeCompiled = cascade
+	}
+
+	// Note that NormalizePathStringBasic will make sure that we don't preserve the unnormalized path.
+	// We do that when we create pages from the file system; mostly for backward compatibility,
+	// but also because people tend to use use the filename to name their resources (with spaces and all),
+	// and this isn't relevant when creating resources from an API where it's easy to add textual meta data.
+	p.Path = paths.NormalizePathStringBasic(p.Path)
+
+	return p.compilePrePost("", mediaTypes)
+}
+
+func (p *PageConfig) compilePrePost(ext string, mediaTypes media.Types) error {
 	if p.Content.Markup == "" && p.Content.MediaType == "" {
 		if ext == "" {
 			ext = "md"
@@ -196,35 +239,37 @@ func (p *PageConfig) Compile(basePath string, pagesFromData bool, ext string, lo
 	if p.Content.Markup == "" {
 		p.Content.Markup = p.ContentMediaType.SubType
 	}
+	return nil
+}
 
-	if len(p.Outputs) > 0 {
-		outFormats, err := outputFormats.GetByNames(p.Outputs...)
-		if err != nil {
-			return fmt.Errorf("failed to resolve output formats %v: %w", p.Outputs, err)
-		} else {
-			p.ConfiguredOutputFormats = outFormats
+// Compile sets up the page configuration after all fields have been set.
+func (p *PageConfig) Compile(ext string, logger loggers.Logger, outputFormats output.Formats, mediaTypes media.Types) error {
+	if p.IsFromContentAdapter {
+		if err := mapstructure.WeakDecode(p.ContentAdapterData, p); err != nil {
+			err = fmt.Errorf("failed to decode page map: %w", err)
+			return err
 		}
+		// Not needed anymore.
+		p.ContentAdapterData = nil
 	}
 
-	if pagesFromData {
-		if p.Kind == "" {
-			p.Kind = kinds.KindPage
-		}
-
-		// Note that NormalizePathStringBasic will make sure that we don't preserve the unnormalized path.
-		// We do that when we create pages from the file system; mostly for backward compatibility,
-		// but also because people tend to use use the filename to name their resources (with spaces and all),
-		// and this isn't relevant when creating resources from an API where it's easy to add textual meta data.
-		p.Path = paths.NormalizePathStringBasic(p.Path)
+	if p.Params == nil {
+		p.Params = make(maps.Params)
+	} else {
+		maps.PrepareParams(p.Params)
+	}
 
+	if err := p.compilePrePost(ext, mediaTypes); err != nil {
+		return err
 	}
 
-	if p.Cascade != nil {
-		cascade, err := page.DecodeCascade(logger, p.Cascade)
+	if len(p.Outputs) > 0 {
+		outFormats, err := outputFormats.GetByNames(p.Outputs...)
 		if err != nil {
-			return fmt.Errorf("failed to decode cascade: %w", err)
+			return fmt.Errorf("failed to resolve output formats %v: %w", p.Outputs, err)
+		} else {
+			p.ConfiguredOutputFormats = outFormats
 		}
-		p.CascadeCompiled = cascade
 	}
 
 	return nil
diff --git a/resources/resource_transformers/cssjs/postcss.go b/resources/resource_transformers/cssjs/postcss.go
index 1a9e01142..98bdc9249 100644
--- a/resources/resource_transformers/cssjs/postcss.go
+++ b/resources/resource_transformers/cssjs/postcss.go
@@ -69,7 +69,6 @@ func (c *PostCSSClient) Process(res resources.ResourceTransformer, options map[s
 }
 
 type InlineImports struct {
-	// Service `mapstructure:",squash"`
 	// Enable inlining of @import statements.
 	// Does so recursively, but currently once only per file;
 	// that is, it's not possible to import the same file in
@@ -78,6 +77,11 @@ type InlineImports struct {
 	// so you can have @import anywhere in the file.
 	InlineImports bool
 
+	// See issue https://github.com/gohugoio/hugo/issues/13719
+	// Disable inlining of @import statements
+	// This is currenty only used for css.TailwindCSS.
+	DisableInlineImports bool
+
 	// When InlineImports is enabled, we fail the build if an import cannot be resolved.
 	// You can enable this to allow the build to continue and leave the import statement in place.
 	// Note that the inline importer does not process url location or imports with media queries,
diff --git a/resources/resource_transformers/cssjs/tailwindcss.go b/resources/resource_transformers/cssjs/tailwindcss.go
index beda7a646..a60a16222 100644
--- a/resources/resource_transformers/cssjs/tailwindcss.go
+++ b/resources/resource_transformers/cssjs/tailwindcss.go
@@ -129,9 +129,11 @@ func (t *tailwindcssTransformation) Transform(ctx *resources.ResourceTransformat
 		t.rs.Assets.Fs, t.rs.Logger, ctx.DependencyManager,
 	)
 
-	src, err = imp.resolve()
-	if err != nil {
-		return err
+	if !options.InlineImports.DisableInlineImports {
+		src, err = imp.resolve()
+		if err != nil {
+			return err
+		}
 	}
 
 	go func() {
@@ -146,7 +148,11 @@ func (t *tailwindcssTransformation) Transform(ctx *resources.ResourceTransformat
 				Cause: err,
 			}
 		}
-		return imp.toFileError(errBuf.String())
+		s := errBuf.String()
+		if options.InlineImports.DisableInlineImports && strings.Contains(s, "Can't resolve") {
+			s += "You may want to set the 'disableInlineImports' option to false to inline imports, see https://gohugo.io/functions/css/tailwindcss/#disableinlineimports"
+		}
+		return imp.toFileError(s)
 	}
 
 	return nil
diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html b/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html
index ce356559d..849bad99e 100644
--- a/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html
+++ b/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html
@@ -2,7 +2,7 @@
 {{- $pc := site.Config.Privacy.Twitter -}}
 {{- if not $pc.Disable -}}
   {{- if $pc.Simple -}}
-    {{- template "_internal/shortcodes/twitter_simple.html" . -}}
+    {{- template "_shortcodes/twitter_simple.html" . -}}
   {{- else -}}
     {{- $id := or (.Get "id") "" -}}
     {{- $user := or (.Get "user") "" -}}
diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/vimeo.html b/tpl/tplimpl/embedded/templates/_shortcodes/vimeo.html
index 2588ac86c..fb8ea0d97 100644
--- a/tpl/tplimpl/embedded/templates/_shortcodes/vimeo.html
+++ b/tpl/tplimpl/embedded/templates/_shortcodes/vimeo.html
@@ -18,7 +18,7 @@ title, then loading.
 {{- $pc := site.Config.Privacy.Vimeo }}
 {{- if not $pc.Disable }}
   {{- if $pc.Simple }}
-    {{- template "_internal/shortcodes/vimeo_simple.html" . }}
+    {{- template "_shortcodes/vimeo_simple.html" . }}
   {{- else }}
     {{- $dnt := cond $pc.EnableDNT 1 0 }}
 
diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/x.html b/tpl/tplimpl/embedded/templates/_shortcodes/x.html
index 28a5e331b..87455530c 100644
--- a/tpl/tplimpl/embedded/templates/_shortcodes/x.html
+++ b/tpl/tplimpl/embedded/templates/_shortcodes/x.html
@@ -1,7 +1,7 @@
 {{- $pc := site.Config.Privacy.X -}}
 {{- if not $pc.Disable -}}
   {{- if $pc.Simple -}}
-    {{- template "_internal/shortcodes/x_simple.html" . -}}
+    {{- template "_shortcodes/x_simple.html" . -}}
   {{- else -}}
     {{- $id := or (.Get "id") "" -}}
     {{- $user := or (.Get "user") "" -}}
diff --git a/tpl/tplimpl/templatedescriptor.go b/tpl/tplimpl/templatedescriptor.go
index ea47afc88..fd86f15fa 100644
--- a/tpl/tplimpl/templatedescriptor.go
+++ b/tpl/tplimpl/templatedescriptor.go
@@ -37,6 +37,7 @@ type TemplateDescriptor struct {
 	// Misc.
 	LayoutFromUserMustMatch bool // If set, we only look for the exact layout.
 	IsPlainText             bool // Whether this is a plain text template.
+	AlwaysAllowPlainText    bool // Whether to e.g. allow plain text templates to be rendered in HTML.
 }
 
 func (d *TemplateDescriptor) normalizeFromFile() {
@@ -64,7 +65,7 @@ func (s descriptorHandler) compareDescriptors(category Category, isEmbedded bool
 		return weightNoMatch
 	}
 
-	w := this.doCompare(category, isEmbedded, s.opts.DefaultContentLanguage, other)
+	w := this.doCompare(category, s.opts.DefaultContentLanguage, other)
 
 	if w.w1 <= 0 {
 		if category == CategoryMarkup && (this.Variant1 == other.Variant1) && (this.Variant2 == other.Variant2 || this.Variant2 != "" && other.Variant2 == "") {
@@ -74,7 +75,12 @@ func (s descriptorHandler) compareDescriptors(category Category, isEmbedded bool
 			}
 
 			w.w1 = 1
-			return w
+		}
+
+		if category == CategoryShortcode {
+			if (this.IsPlainText == other.IsPlainText || !other.IsPlainText) || this.AlwaysAllowPlainText {
+				w.w1 = 1
+			}
 		}
 	}
 
@@ -82,13 +88,16 @@ func (s descriptorHandler) compareDescriptors(category Category, isEmbedded bool
 }
 
 //lint:ignore ST1006 this vs other makes it easier to reason about.
-func (this TemplateDescriptor) doCompare(category Category, isEmbedded bool, defaultContentLanguage string, other TemplateDescriptor) weight {
+func (this TemplateDescriptor) doCompare(category Category, defaultContentLanguage string, other TemplateDescriptor) weight {
 	w := weightNoMatch
 
-	// HTML in plain text is OK, but not the other way around.
-	if other.IsPlainText && !this.IsPlainText {
-		return w
+	if !this.AlwaysAllowPlainText {
+		// HTML in plain text is OK, but not the other way around.
+		if other.IsPlainText && !this.IsPlainText {
+			return w
+		}
 	}
+
 	if other.Kind != "" && other.Kind != this.Kind {
 		return w
 	}


Test patch:
diff --git a/config/allconfig/allconfig_integration_test.go b/config/allconfig/allconfig_integration_test.go
index f8fbb22f7..8f6cacf84 100644
--- a/config/allconfig/allconfig_integration_test.go
+++ b/config/allconfig/allconfig_integration_test.go
@@ -357,3 +357,25 @@ All.
 
 	b.Assert(b.H.Conf.DefaultContentLanguage(), qt.Equals, "sv")
 }
+
+func TestDefaultConfigEnvDisableLanguagesIssue13707(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+disableLanguages = []
+[languages]
+[languages.en]
+weight = 1
+[languages.nn]
+weight = 2
+[languages.sv]
+weight = 3
+`
+
+	b := hugolib.Test(t, files, hugolib.TestOptWithConfig(func(conf *hugolib.IntegrationTestConfig) {
+		conf.Environ = []string{`HUGO_DISABLELANGUAGES=sv nn`}
+	}))
+
+	b.Assert(len(b.H.Sites), qt.Equals, 1)
+}
diff --git a/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go b/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go
index f6e4221a0..db06fb4a4 100644
--- a/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go
+++ b/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go
@@ -821,3 +821,97 @@ outputs:
 	b.AssertFileExists("public/p4/index.html", true)
 	b.AssertFileExists("public/p4/index.json", false) // currently returns true
 }
+
+func TestContentAdapterOutputsIssue13692(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+disableKinds = ['page','home','sitemap','taxonomy','term']
+[[cascade]]
+outputs = ['html','json']
+[cascade.target]
+path = '{/s2,/s4}'
+-- layouts/section.html --
+html: {{ .Title }}
+-- layouts/section.json --
+json: {{ .Title }}
+-- content/s1/_index.md --
+---
+title: s1
+---
+-- content/s2/_index.md --
+---
+title: s2
+---
+-- content/_content.gotmpl --
+{{ $page := dict "path" "s3" "title" "s3" "kind" "section" }}
+{{ $.AddPage $page }}
+
+{{ $page := dict "path" "s4" "title" "s4" "kind" "section" }}
+{{ $.AddPage $page }}
+
+{{ $page := dict "path" "s5" "title" "s5" "kind" "section" "outputs" (slice "html") }}
+ {{ $.AddPage $page }}
+`
+
+	b := hugolib.Test(t, files)
+
+	b.AssertFileExists("public/s1/index.html", true)
+	b.AssertFileExists("public/s1/index.json", false)
+	b.AssertFileExists("public/s1/index.xml", true)
+
+	b.AssertFileExists("public/s2/index.html", true)
+	b.AssertFileExists("public/s2/index.json", true)
+	b.AssertFileExists("public/s2/index.xml", false)
+
+	b.AssertFileExists("public/s3/index.html", true)
+	b.AssertFileExists("public/s3/index.json", false)
+	b.AssertFileExists("public/s3/index.xml", true)
+
+	b.AssertFileExists("public/s4/index.html", true)
+	b.AssertFileExists("public/s4/index.json", true)
+	b.AssertFileExists("public/s4/index.xml", false)
+
+	b.AssertFileExists("public/s5/index.html", true)
+	b.AssertFileExists("public/s5/index.json", false)
+	b.AssertFileExists("public/s5/index.xml", false)
+}
+
+func TestContentAdapterCascadeBasic(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+disableLiveReload = true
+-- content/_index.md --
+---
+cascade:
+  - title: foo
+    target:
+      path: "**"
+---
+-- layouts/all.html --
+Title: {{ .Title }}|Content: {{ .Content }}|
+-- content/_content.gotmpl --
+{{ $content := dict
+  "mediaType" "text/markdown"
+  "value" "The _Hunchback of Notre Dame_ was written by Victor Hugo."
+}}
+
+{{ $page := dict "path" "s1"  "kind" "page" }}
+{{ $.AddPage $page }}
+ {{ $page := dict "path" "s2"  "kind" "page" "title" "bar" "content" $content }}
+{{ $.AddPage $page }}
+
+`
+
+	b := hugolib.TestRunning(t, files)
+
+	b.AssertFileContent("public/s1/index.html", "Title: foo|")
+	b.AssertFileContent("public/s2/index.html", "Title: bar|", "Content: <p>The <em>Hunchback of Notre Dame</em> was written by Victor Hugo.</p>")
+
+	b.EditFileReplaceAll("content/_index.md", "foo", "baz").Build()
+
+	b.AssertFileContent("public/s1/index.html", "Title: baz|")
+}
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index f1d90e22e..a1f12e77a 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -918,7 +918,7 @@ func TestShortcodeMarkdownOutputFormat(t *testing.T) {
 ---
 title: "p1"
 ---
-{{< foo >}}
+{{% foo %}}
 # The below would have failed using the HTML template parser.
 -- layouts/shortcodes/foo.md --
 §§§
@@ -930,9 +930,7 @@ title: "p1"
 
 	b := Test(t, files)
 
-	b.AssertFileContent("public/p1/index.html", `
-<x
-	`)
+	b.AssertFileContent("public/p1/index.html", "<code>&lt;x")
 }
 
 func TestShortcodePreserveIndentation(t *testing.T) {
diff --git a/resources/page/page_matcher_test.go b/resources/page/page_matcher_test.go
index bc072ce15..2fe6ccc89 100644
--- a/resources/page/page_matcher_test.go
+++ b/resources/page/page_matcher_test.go
@@ -84,7 +84,7 @@ func TestPageMatcher(t *testing.T) {
 
 	c.Run("mapToPageMatcherParamsConfig", func(c *qt.C) {
 		fn := func(m map[string]any) PageMatcherParamsConfig {
-			v, err := mapToPageMatcherParamsConfig(m)
+			v, err := mapToPageMatcherParamsConfigLegacy(m)
 			c.Assert(err, qt.IsNil)
 			return v
 		}
@@ -129,7 +129,7 @@ func TestDecodeCascadeConfig(t *testing.T) {
 		},
 	}
 
-	got, err := DecodeCascadeConfig(loggers.NewDefault(), in)
+	got, err := DecodeCascadeConfig(loggers.NewDefault(), true, in)
 
 	c.Assert(err, qt.IsNil)
 	c.Assert(got, qt.IsNotNil)
@@ -143,7 +143,7 @@ func TestDecodeCascadeConfig(t *testing.T) {
 		{Params: maps.Params{"b": string("bv")}, Target: PageMatcher{Kind: "page"}},
 	})
 
-	got, err = DecodeCascadeConfig(loggers.NewDefault(), nil)
+	got, err = DecodeCascadeConfig(loggers.NewDefault(), true, nil)
 	c.Assert(err, qt.IsNil)
 	c.Assert(got, qt.IsNotNil)
 }
diff --git a/resources/page/pagemeta/page_frontmatter_test.go b/resources/page/pagemeta/page_frontmatter_test.go
index de2932391..8d50f9b57 100644
--- a/resources/page/pagemeta/page_frontmatter_test.go
+++ b/resources/page/pagemeta/page_frontmatter_test.go
@@ -176,7 +176,7 @@ func TestContentMediaTypeFromMarkup(t *testing.T) {
 	} {
 		var pc pagemeta.PageConfig
 		pc.Content.Markup = test.in
-		c.Assert(pc.Compile("", true, "", logger, output.DefaultFormats, media.DefaultTypes), qt.IsNil)
+		c.Assert(pc.Compile("", logger, output.DefaultFormats, media.DefaultTypes), qt.IsNil)
 		c.Assert(pc.ContentMediaType.Type, qt.Equals, test.expected)
 	}
 }
diff --git a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
index ae70042a0..734ffe759 100644
--- a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
+++ b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
@@ -17,6 +17,7 @@ import (
 	"testing"
 
 	"github.com/bep/logg"
+	qt "github.com/frankban/quicktest"
 	"github.com/gohugoio/hugo/htesting"
 	"github.com/gohugoio/hugo/hugolib"
 )
@@ -70,3 +71,66 @@ CSS: {{ $css.Content | safeCSS }}|
 
 	b.AssertFileContent("public/index.html", "/*! tailwindcss v4.")
 }
+
+func TestTailwindCSSNoInlineImportsIssue13719(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+disableKinds = ['page','rss','section','sitemap','taxonomy','term']
+theme = 'my-theme'
+
+[[module.mounts]]
+source = 'assets'
+target = 'assets'
+
+[[module.mounts]]
+source = 'other'
+target = 'assets/css'
+-- assets/css/main.css --
+@import "tailwindcss";
+
+@import "colors/red.css";
+@import "colors/blue.css";
+@import "colors/purple.css";
+-- assets/css/colors/red.css --
+@import "green.css";
+
+.red {color: red;}
+-- assets/css/colors/green.css --
+.green {color: green;}
+-- themes/my-theme/assets/css/colors/blue.css --
+.blue {color: blue;}
+-- other/colors/purple.css --
+.purple {color: purple;}
+-- layouts/home.html --
+{{ with (templates.Defer (dict "key" "global")) }}
+  {{ with resources.Get "css/main.css" }}
+    {{ $opts := dict "disableInlineImports" true }}
+    {{ with . | css.TailwindCSS $opts }}
+      <link rel="stylesheet" href="{{ .RelPermalink }}">
+    {{ end }}
+  {{ end }}
+{{ end }}
+-- package.json --
+{
+  "devDependencies": {
+    "@tailwindcss/cli": "^4.1.7",
+    "tailwindcss": "^4.1.7"
+  }
+}
+`
+
+	b, err := hugolib.NewIntegrationTestBuilder(
+		hugolib.IntegrationTestConfig{
+			T:               t,
+			TxtarString:     files,
+			NeedsOsFS:       true,
+			NeedsNpmInstall: true,
+			LogLevel:        logg.LevelInfo,
+		}).BuildE()
+
+	b.Assert(err, qt.IsNotNil)
+	b.Assert(err.Error(), qt.Contains, "Can't resolve 'colors/red.css'")
+	b.Assert(err.Error(), qt.Contains, "You may want to set the 'disableInlineImports' option to false")
+}
diff --git a/testscripts/commands/new.txt b/testscripts/commands/new.txt
index cd338203f..f8d7c1ec1 100644
--- a/testscripts/commands/new.txt
+++ b/testscripts/commands/new.txt
@@ -1,7 +1,7 @@
 # Test the new command.
 
 hugo new site -h
-stdout 'Create a new site in the provided directory'
+stdout 'Create a new site at the specified path.'
 hugo new site my-yaml-site --format yml
 checkfile my-yaml-site/hugo.yml
 hugo new site mysite -f
@@ -19,7 +19,7 @@ exists themes
 ! exists resources
 
 hugo new theme -h
-stdout 'Create a new theme \(skeleton\) called \[name\] in ./themes'
+stdout 'Create a new theme with the specified name in the ./themes directory.'
 hugo new theme mytheme --format yml
 stdout 'Creating new theme'
 ! exists resources
diff --git a/tpl/tplimpl/shortcodes_integration_test.go b/tpl/tplimpl/shortcodes_integration_test.go
index 838dc16d7..e884c9a8d 100644
--- a/tpl/tplimpl/shortcodes_integration_test.go
+++ b/tpl/tplimpl/shortcodes_integration_test.go
@@ -17,6 +17,7 @@ import (
 	"strings"
 	"testing"
 
+	qt "github.com/frankban/quicktest"
 	"github.com/gohugoio/hugo/htesting/hqt"
 	"github.com/gohugoio/hugo/hugolib"
 )
@@ -696,3 +697,63 @@ title: p2
 	b.AssertFileContent("public/p1/index.html", "78eb19b5c6f3768f")
 	b.AssertFileContent("public/p2/index.html", "a6db910a9cf54bc1")
 }
+
+func TestShortcodePlainTextVsHTMLTemplateIssue13698(t *testing.T) {
+	t.Parallel()
+
+	filesTemplate := `
+-- hugo.toml --
+markup.goldmark.renderer.unsafe = true
+-- layouts/all.html --
+Content: {{ .Content }}|
+-- layouts/_shortcodes/mymarkdown.md --
+<div>Foo bar</div>
+-- content/p1.md --
+---
+title: p1
+---
+## A shortcode
+
+SHORTCODE
+
+`
+
+	files := strings.ReplaceAll(filesTemplate, "SHORTCODE", "{{% mymarkdown %}}")
+	b := hugolib.Test(t, files)
+	b.AssertFileContent("public/p1/index.html", "<div>Foo bar</div>")
+
+	files = strings.ReplaceAll(filesTemplate, "SHORTCODE", "{{< mymarkdown >}}")
+
+	var err error
+	b, err = hugolib.TestE(t, files)
+	b.Assert(err, qt.IsNotNil)
+	b.Assert(err.Error(), qt.Contains, `no compatible template found for shortcode "mymarkdown" in [/_shortcodes/mymarkdown.md]; note that to use plain text template shortcodes in HTML you need to use the shortcode {{% delimiter`)
+}
+
+func TestShortcodeOnlyLanguageInBaseIssue13699(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+baseURL = 'https://example.org/'
+[languages]
+[languages.en]
+weight = 1
+disableLanguages = ['de']
+[languages.de]
+weight = 2
+-- layouts/_shortcodes/de.html --
+de.html
+-- layouts/all.html --
+{{ .Content }}
+-- content/_index.md --
+---
+title: home
+---
+{{< de >}}
+
+`
+	b := hugolib.Test(t, files)
+
+	b.AssertFileContent("public/index.html", "de.html")
+}
diff --git a/tpl/tplimpl/templatestore.go b/tpl/tplimpl/templatestore.go
index 53880eb33..2ea337274 100644
--- a/tpl/tplimpl/templatestore.go
+++ b/tpl/tplimpl/templatestore.go
@@ -19,6 +19,7 @@ import (
 	"bytes"
 	"context"
 	"embed"
+	"errors"
 	"fmt"
 	"io"
 	"io/fs"
@@ -608,7 +609,7 @@ func (s *TemplateStore) LookupShortcodeByName(name string) *TemplInfo {
 	return ti
 }
 
-func (s *TemplateStore) LookupShortcode(q TemplateQuery) *TemplInfo {
+func (s *TemplateStore) LookupShortcode(q TemplateQuery) (*TemplInfo, error) {
 	q.init()
 	k1 := s.key(q.Path)
 
@@ -630,13 +631,15 @@ func (s *TemplateStore) LookupShortcode(q TemplateQuery) *TemplInfo {
 		}
 
 		for k, vv := range v {
+			best.candidates = append(best.candidates, vv)
 			if !q.Consider(vv) {
 				continue
 			}
 
 			weight := s.dh.compareDescriptors(q.Category, vv.subCategory == SubCategoryEmbedded, q.Desc, k)
 			weight.distance = distance
-			if best.isBetter(weight, vv) {
+			isBetter := best.isBetter(weight, vv)
+			if isBetter {
 				best.updateValues(weight, k2, k, vv)
 			}
 		}
@@ -644,8 +647,21 @@ func (s *TemplateStore) LookupShortcode(q TemplateQuery) *TemplInfo {
 		return false, nil
 	})
 
-	// Any match will do.
-	return best.templ
+	if best.w.w1 <= 0 {
+		var err error
+		if s := best.candidatesAsStringSlice(); s != nil {
+			msg := fmt.Sprintf("no compatible template found for shortcode %q in %s", q.Name, s)
+			if !q.Desc.IsPlainText {
+				msg += "; note that to use plain text template shortcodes in HTML you need to use the shortcode {{% delimiter"
+			}
+			err = errors.New(msg)
+		} else {
+			err = fmt.Errorf("no template found for shortcode %q", q.Name)
+		}
+		return nil, err
+	}
+
+	return best.templ, nil
 }
 
 // PrintDebug is for testing/debugging only.
@@ -1133,12 +1149,21 @@ func (s *TemplateStore) insertTemplate2(
 		tree.Insert(key, m)
 	}
 
-	if !replace {
-		if v, found := m[nk]; found {
-			if len(pi.Identifiers()) >= len(v.PathInfo.Identifiers()) {
-				// e.g. /pages/home.foo.html and  /pages/home.html where foo may be a valid language name in another site.
-				return nil, nil
-			}
+	nkExisting, existingFound := m[nk]
+	if !replace && existingFound && fi != nil && nkExisting.Fi != nil {
+		// See issue #13715.
+		// We do the merge on the file system level, but from Hugo v0.146.0 we have a situation where
+		// the project may well have a different layouts layout compared to the theme(s) it uses.
+		// We could possibly have fixed that on a lower (file system) level, but since this is just
+		// a temporary situation (until all projects are updated),
+		// do a replace here if the file comes from higher up in the module chain.
+		replace = fi.Meta().ModuleOrdinal < nkExisting.Fi.Meta().ModuleOrdinal
+	}
+
+	if !replace && existingFound {
+		if len(pi.Identifiers()) >= len(nkExisting.PathInfo.Identifiers()) {
+			// e.g. /pages/home.foo.html and  /pages/home.html where foo may be a valid language name in another site.
+			return nil, nil
 		}
 	}
 
@@ -1808,10 +1833,11 @@ type TextTemplatHandler interface {
 }
 
 type bestMatch struct {
-	templ *TemplInfo
-	desc  TemplateDescriptor
-	w     weight
-	key   string
+	templ      *TemplInfo
+	desc       TemplateDescriptor
+	w          weight
+	key        string
+	candidates []*TemplInfo
 
 	// settings.
 	defaultOutputformat string
@@ -1822,6 +1848,18 @@ func (best *bestMatch) reset() {
 	best.w = weight{}
 	best.desc = TemplateDescriptor{}
 	best.key = ""
+	best.candidates = nil
+}
+
+func (best *bestMatch) candidatesAsStringSlice() []string {
+	if len(best.candidates) == 0 {
+		return nil
+	}
+	candidates := make([]string, len(best.candidates))
+	for i, v := range best.candidates {
+		candidates[i] = v.PathInfo.Path()
+	}
+	return candidates
 }
 
 func (best *bestMatch) isBetter(w weight, ti *TemplInfo) bool {
@@ -1831,7 +1869,6 @@ func (best *bestMatch) isBetter(w weight, ti *TemplInfo) bool {
 	}
 
 	if w.w1 <= 0 {
-
 		if best.w.w1 <= 0 {
 			return ti.PathInfo.Path() < best.templ.PathInfo.Path()
 		}
diff --git a/tpl/tplimpl/templatestore_integration_test.go b/tpl/tplimpl/templatestore_integration_test.go
index 75ec0376f..0b3ce7a56 100644
--- a/tpl/tplimpl/templatestore_integration_test.go
+++ b/tpl/tplimpl/templatestore_integration_test.go
@@ -920,6 +920,26 @@ func TestPartialHTML(t *testing.T) {
 	b.AssertFileContent("public/index.html", "<link rel=\"stylesheet\" href=\"/css/style.css\">")
 }
 
+func TestPartialPlainTextInHTML(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+-- layouts/all.html --
+<html>
+<head>
+{{ partial "mypartial.txt" . }}
+</head>
+</html>
+-- layouts/partials/mypartial.txt --
+My <div>partial</div>.
+`
+
+	b := hugolib.Test(t, files)
+
+	b.AssertFileContent("public/index.html", "My &lt;div&gt;partial&lt;/div&gt;.")
+}
+
 // Issue #13593.
 func TestGoatAndNoGoat(t *testing.T) {
 	t.Parallel()
@@ -1103,6 +1123,35 @@ All.
 	b.AssertLogContains("unrecognized render hook")
 }
 
+func TestLayoutNotFound(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+-- layouts/single.html --
+Single.
+`
+	b := hugolib.Test(t, files, hugolib.TestOptWarn())
+	b.AssertLogContains("WARN  found no layout file for \"html\" for kind \"home\"")
+}
+
+func TestLayoutOverrideThemeWhenThemeOnOldFormatIssue13715(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+theme = "mytheme"
+-- layouts/list.html --
+ layouts/list.html
+-- themes/mytheme/layouts/_default/list.html --
+mytheme/layouts/_default/list.html
+
+`
+
+	b := hugolib.Test(t, files)
+	b.AssertFileContent("public/index.html", "layouts/list.html")
+}
+
 func BenchmarkExecuteWithContext(b *testing.B) {
 	files := `
 -- hugo.toml --
@@ -1197,8 +1246,8 @@ s2.
 			Category: tplimpl.CategoryShortcode,
 			Desc:     desc,
 		}
-		v := store.LookupShortcode(q)
-		if v == nil {
+		v, err := store.LookupShortcode(q)
+		if v == nil || err != nil {
 			b.Fatal("not found")
 		}
 	}