|
|
|
@@ -41,11 +41,11 @@ withallbutlastsectionslug = '/:sectionslugs[:last]/:slug/'
|
|
|
|
|
withsectionslug = '/sectionslug/:sectionslug/:slug/'
|
|
|
|
|
withsectionslugs = '/sectionslugs/:sectionslugs/:slug/'
|
|
|
|
|
[permalinks.section]
|
|
|
|
|
withfilefilename = '/sectionwithfilefilename/:filename/'
|
|
|
|
|
withfilefilename = '/sectionwithfilefilename/:contentbasename/'
|
|
|
|
|
withfilefiletitle = '/sectionwithfilefiletitle/:title/'
|
|
|
|
|
withfileslug = '/sectionwithfileslug/:slug/'
|
|
|
|
|
nofileslug = '/sectionnofileslug/:slug/'
|
|
|
|
|
nofilefilename = '/sectionnofilefilename/:filename/'
|
|
|
|
|
nofilefilename = '/sectionnofilefilename/:contentbasename/'
|
|
|
|
|
nofiletitle1 = '/sectionnofiletitle1/:title/'
|
|
|
|
|
nofiletitle2 = '/sectionnofiletitle2/:sections[:last]/'
|
|
|
|
|
[permalinks.term]
|
|
|
|
@@ -125,9 +125,12 @@ slug: "mytagslug"
|
|
|
|
|
b.AssertFileContent("public/pageslug/p1slugvalue/index.html", "Single|page|/pageslug/p1slugvalue/|")
|
|
|
|
|
b.AssertFileContent("public/sectionslug/section-root-slug/page1-slug/index.html", "Single|page|/sectionslug/section-root-slug/page1-slug/|")
|
|
|
|
|
b.AssertFileContent("public/sectionslugs/sections-root-slug/level1-slug/page1-slug/index.html", "Single|page|/sectionslugs/sections-root-slug/level1-slug/page1-slug/|")
|
|
|
|
|
b.AssertFileContent("public/sectionwithfilefilename/index.html", "List|section|/sectionwithfilefilename/|")
|
|
|
|
|
|
|
|
|
|
b.AssertFileContent("public/sectionwithfilefilename/withfilefilename/index.html", "List|section|/sectionwithfilefilename/withfilefilename/|")
|
|
|
|
|
|
|
|
|
|
b.AssertFileContent("public/sectionwithfileslug/withfileslugvalue/index.html", "List|section|/sectionwithfileslug/withfileslugvalue/|")
|
|
|
|
|
b.AssertFileContent("public/sectionnofilefilename/index.html", "List|section|/sectionnofilefilename/|")
|
|
|
|
|
|
|
|
|
|
b.AssertFileContent("public/sectionnofilefilename/nofilefilename/index.html", "List|section|/sectionnofilefilename/nofilefilename/|")
|
|
|
|
|
b.AssertFileContent("public/sectionnofileslug/nofileslugs/index.html", "List|section|/sectionnofileslug/nofileslugs/|")
|
|
|
|
|
b.AssertFileContent("public/sectionnofiletitle1/nofiletitle1s/index.html", "List|section|/sectionnofiletitle1/nofiletitle1s/|")
|
|
|
|
|
b.AssertFileContent("public/sectionnofiletitle2/index.html", "List|section|/sectionnofiletitle2/|")
|
|
|
|
@@ -138,7 +141,7 @@ slug: "mytagslug"
|
|
|
|
|
permalinksConf := b.H.Configs.Base.Permalinks
|
|
|
|
|
b.Assert(permalinksConf, qt.DeepEquals, map[string]map[string]string{
|
|
|
|
|
"page": {"withallbutlastsection": "/:sections[:last]/:slug/", "withallbutlastsectionslug": "/:sectionslugs[:last]/:slug/", "withpageslug": "/pageslug/:slug/", "withsectionslug": "/sectionslug/:sectionslug/:slug/", "withsectionslugs": "/sectionslugs/:sectionslugs/:slug/"},
|
|
|
|
|
"section": {"nofilefilename": "/sectionnofilefilename/:filename/", "nofileslug": "/sectionnofileslug/:slug/", "nofiletitle1": "/sectionnofiletitle1/:title/", "nofiletitle2": "/sectionnofiletitle2/:sections[:last]/", "withfilefilename": "/sectionwithfilefilename/:filename/", "withfilefiletitle": "/sectionwithfilefiletitle/:title/", "withfileslug": "/sectionwithfileslug/:slug/"},
|
|
|
|
|
"section": {"nofilefilename": "/sectionnofilefilename/:contentbasename/", "nofileslug": "/sectionnofileslug/:slug/", "nofiletitle1": "/sectionnofiletitle1/:title/", "nofiletitle2": "/sectionnofiletitle2/:sections[:last]/", "withfilefilename": "/sectionwithfilefilename/:contentbasename/", "withfilefiletitle": "/sectionwithfilefiletitle/:title/", "withfileslug": "/sectionwithfileslug/:slug/"},
|
|
|
|
|
"taxonomy": {"tags": "/tagsslug/:slug/"},
|
|
|
|
|
"term": {"tags": "/tagsslug/tag/:slug/"},
|
|
|
|
|
})
|
|
|
|
@@ -192,7 +195,7 @@ func TestPermalinksNestedSections(t *testing.T) {
|
|
|
|
|
files := `
|
|
|
|
|
-- hugo.toml --
|
|
|
|
|
[permalinks.page]
|
|
|
|
|
books = '/libros/:sections[1:]/:filename'
|
|
|
|
|
books = '/libros/:sections[1:]/:contentbasename'
|
|
|
|
|
|
|
|
|
|
[permalinks.section]
|
|
|
|
|
books = '/libros/:sections[1:]'
|
|
|
|
|