aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/page/permalinks_integration_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-10-16 08:53:45 +0200
committerBjørn Erik Pedersen <[email protected]>2024-10-16 10:14:48 +0200
commita2f666b586b0df063ad240910b28a73dc3aa2673 (patch)
treeeadd3fa1afb33139959d0eec1298fe7944d34d56 /resources/page/permalinks_integration_test.go
parentb1b3bbcdbd585cdac67c1d8fca4c98be11e086d6 (diff)
downloadhugo-a2f666b586b0df063ad240910b28a73dc3aa2673.tar.gz
hugo-a2f666b586b0df063ad240910b28a73dc3aa2673.zip
Remove erroneously permalink validation
Fixes #12948
Diffstat (limited to 'resources/page/permalinks_integration_test.go')
-rw-r--r--resources/page/permalinks_integration_test.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/resources/page/permalinks_integration_test.go b/resources/page/permalinks_integration_test.go
index 2b9e878b1..4188c70ca 100644
--- a/resources/page/permalinks_integration_test.go
+++ b/resources/page/permalinks_integration_test.go
@@ -18,6 +18,7 @@ import (
"github.com/bep/logg"
qt "github.com/frankban/quicktest"
+ "github.com/gohugoio/hugo/htesting"
"github.com/gohugoio/hugo/hugolib"
)
@@ -232,3 +233,38 @@ slug: custom-recipe-2
b.AssertFileContent("public/delicious-recipe/recipe-1/index.html", "Single|page|/delicious-recipe/recipe-1/")
b.AssertFileContent("public/delicious-recipe/custom-recipe-2/index.html", "Single|page|/delicious-recipe/custom-recipe-2/")
}
+
+// Issue 12948.
+func TestPermalinksWithEscapedColons(t *testing.T) {
+ t.Parallel()
+
+ if htesting.IsWindows() {
+ t.Skip("Windows does not support colons in paths")
+ }
+
+ files := `
+-- hugo.toml --
+disableKinds = ['home','rss','section','sitemap','taxonomy','term']
+[permalinks.page]
+s2 = "/c\\:d/:slug/"
+-- content/s1/p1.md --
+---
+title: p1
+url: "/a\\:b/:slug/"
+---
+-- content/s2/p2.md --
+---
+title: p2
+---
+-- layouts/_default/single.html --
+{{ .Title }}
+`
+
+ b := hugolib.Test(t, files)
+
+ b.AssertFileExists("public/a:b/p1/index.html", true)
+
+ // The above URL comes from the URL front matter field where everything is allowed.
+ // We strip colons from paths constructed by Hugo (they are not supported on Windows).
+ b.AssertFileExists("public/cd/p2/index.html", true)
+}