mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
output: Add more layout lookup tests
Add more tests to cover more cases and to help with documentation and discussion of template lookup order. Updates #7964
This commit is contained in:
parent
6f7633df7d
commit
34061706e6
1 changed files with 253 additions and 0 deletions
|
@ -248,6 +248,59 @@ func TestLayout(t *testing.T) {
|
|||
"_default/baseof.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Section, baseof, French, AMP", LayoutDescriptor{Kind: "section", Section: "sect1", Lang: "fr", Baseof: true}, "", ampType,
|
||||
[]string{
|
||||
"sect1/sect1-baseof.fr.amp.html",
|
||||
"sect1/section-baseof.fr.amp.html",
|
||||
"sect1/list-baseof.fr.amp.html",
|
||||
"sect1/baseof.fr.amp.html",
|
||||
"sect1/sect1-baseof.amp.html",
|
||||
"sect1/section-baseof.amp.html",
|
||||
"sect1/list-baseof.amp.html",
|
||||
"sect1/baseof.amp.html",
|
||||
"sect1/sect1-baseof.fr.html",
|
||||
"sect1/section-baseof.fr.html",
|
||||
"sect1/list-baseof.fr.html",
|
||||
"sect1/baseof.fr.html",
|
||||
"sect1/sect1-baseof.html",
|
||||
"sect1/section-baseof.html",
|
||||
"sect1/list-baseof.html",
|
||||
"sect1/baseof.html",
|
||||
"section/sect1-baseof.fr.amp.html",
|
||||
"section/section-baseof.fr.amp.html",
|
||||
"section/list-baseof.fr.amp.html",
|
||||
"section/baseof.fr.amp.html",
|
||||
"section/sect1-baseof.amp.html",
|
||||
"section/section-baseof.amp.html",
|
||||
"section/list-baseof.amp.html",
|
||||
"section/baseof.amp.html",
|
||||
"section/sect1-baseof.fr.html",
|
||||
"section/section-baseof.fr.html",
|
||||
"section/list-baseof.fr.html",
|
||||
"section/baseof.fr.html",
|
||||
"section/sect1-baseof.html",
|
||||
"section/section-baseof.html",
|
||||
"section/list-baseof.html",
|
||||
"section/baseof.html",
|
||||
"_default/sect1-baseof.fr.amp.html",
|
||||
"_default/section-baseof.fr.amp.html",
|
||||
"_default/list-baseof.fr.amp.html",
|
||||
"_default/baseof.fr.amp.html",
|
||||
"_default/sect1-baseof.amp.html",
|
||||
"_default/section-baseof.amp.html",
|
||||
"_default/list-baseof.amp.html",
|
||||
"_default/baseof.amp.html",
|
||||
"_default/sect1-baseof.fr.html",
|
||||
"_default/section-baseof.fr.html",
|
||||
"_default/list-baseof.fr.html",
|
||||
"_default/baseof.fr.html",
|
||||
"_default/sect1-baseof.html",
|
||||
"_default/section-baseof.html",
|
||||
"_default/list-baseof.html",
|
||||
"_default/baseof.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Section with layout", LayoutDescriptor{Kind: "section", Section: "sect1", Layout: "mylayout"}, "", ampType,
|
||||
[]string{
|
||||
|
@ -277,6 +330,160 @@ func TestLayout(t *testing.T) {
|
|||
"_default/list.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Term, French, AMP", LayoutDescriptor{Kind: "term", Section: "tags", Lang: "fr"}, "", ampType,
|
||||
[]string{
|
||||
"term/term.fr.amp.html",
|
||||
"term/tags.fr.amp.html",
|
||||
"term/taxonomy.fr.amp.html",
|
||||
"term/list.fr.amp.html",
|
||||
"term/term.amp.html",
|
||||
"term/tags.amp.html",
|
||||
"term/taxonomy.amp.html",
|
||||
"term/list.amp.html",
|
||||
"term/term.fr.html",
|
||||
"term/tags.fr.html",
|
||||
"term/taxonomy.fr.html",
|
||||
"term/list.fr.html",
|
||||
"term/term.html",
|
||||
"term/tags.html",
|
||||
"term/taxonomy.html",
|
||||
"term/list.html",
|
||||
"taxonomy/term.fr.amp.html",
|
||||
"taxonomy/tags.fr.amp.html",
|
||||
"taxonomy/taxonomy.fr.amp.html",
|
||||
"taxonomy/list.fr.amp.html",
|
||||
"taxonomy/term.amp.html",
|
||||
"taxonomy/tags.amp.html",
|
||||
"taxonomy/taxonomy.amp.html",
|
||||
"taxonomy/list.amp.html",
|
||||
"taxonomy/term.fr.html",
|
||||
"taxonomy/tags.fr.html",
|
||||
"taxonomy/taxonomy.fr.html",
|
||||
"taxonomy/list.fr.html",
|
||||
"taxonomy/term.html",
|
||||
"taxonomy/tags.html",
|
||||
"taxonomy/taxonomy.html",
|
||||
"taxonomy/list.html",
|
||||
"tags/term.fr.amp.html",
|
||||
"tags/tags.fr.amp.html",
|
||||
"tags/taxonomy.fr.amp.html",
|
||||
"tags/list.fr.amp.html",
|
||||
"tags/term.amp.html",
|
||||
"tags/tags.amp.html",
|
||||
"tags/taxonomy.amp.html",
|
||||
"tags/list.amp.html",
|
||||
"tags/term.fr.html",
|
||||
"tags/tags.fr.html",
|
||||
"tags/taxonomy.fr.html",
|
||||
"tags/list.fr.html",
|
||||
"tags/term.html",
|
||||
"tags/tags.html",
|
||||
"tags/taxonomy.html",
|
||||
"tags/list.html",
|
||||
"_default/term.fr.amp.html",
|
||||
"_default/tags.fr.amp.html",
|
||||
"_default/taxonomy.fr.amp.html",
|
||||
"_default/list.fr.amp.html",
|
||||
"_default/term.amp.html",
|
||||
"_default/tags.amp.html",
|
||||
"_default/taxonomy.amp.html",
|
||||
"_default/list.amp.html",
|
||||
"_default/term.fr.html",
|
||||
"_default/tags.fr.html",
|
||||
"_default/taxonomy.fr.html",
|
||||
"_default/list.fr.html",
|
||||
"_default/term.html",
|
||||
"_default/tags.html",
|
||||
"_default/taxonomy.html",
|
||||
"_default/list.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Term, baseof, French, AMP", LayoutDescriptor{Kind: "term", Section: "tags", Lang: "fr", Baseof: true}, "", ampType,
|
||||
[]string{
|
||||
"term/term-baseof.fr.amp.html",
|
||||
"term/tags-baseof.fr.amp.html",
|
||||
"term/taxonomy-baseof.fr.amp.html",
|
||||
"term/list-baseof.fr.amp.html",
|
||||
"term/baseof.fr.amp.html",
|
||||
"term/term-baseof.amp.html",
|
||||
"term/tags-baseof.amp.html",
|
||||
"term/taxonomy-baseof.amp.html",
|
||||
"term/list-baseof.amp.html",
|
||||
"term/baseof.amp.html",
|
||||
"term/term-baseof.fr.html",
|
||||
"term/tags-baseof.fr.html",
|
||||
"term/taxonomy-baseof.fr.html",
|
||||
"term/list-baseof.fr.html",
|
||||
"term/baseof.fr.html",
|
||||
"term/term-baseof.html",
|
||||
"term/tags-baseof.html",
|
||||
"term/taxonomy-baseof.html",
|
||||
"term/list-baseof.html",
|
||||
"term/baseof.html",
|
||||
"taxonomy/term-baseof.fr.amp.html",
|
||||
"taxonomy/tags-baseof.fr.amp.html",
|
||||
"taxonomy/taxonomy-baseof.fr.amp.html",
|
||||
"taxonomy/list-baseof.fr.amp.html",
|
||||
"taxonomy/baseof.fr.amp.html",
|
||||
"taxonomy/term-baseof.amp.html",
|
||||
"taxonomy/tags-baseof.amp.html",
|
||||
"taxonomy/taxonomy-baseof.amp.html",
|
||||
"taxonomy/list-baseof.amp.html",
|
||||
"taxonomy/baseof.amp.html",
|
||||
"taxonomy/term-baseof.fr.html",
|
||||
"taxonomy/tags-baseof.fr.html",
|
||||
"taxonomy/taxonomy-baseof.fr.html",
|
||||
"taxonomy/list-baseof.fr.html",
|
||||
"taxonomy/baseof.fr.html",
|
||||
"taxonomy/term-baseof.html",
|
||||
"taxonomy/tags-baseof.html",
|
||||
"taxonomy/taxonomy-baseof.html",
|
||||
"taxonomy/list-baseof.html",
|
||||
"taxonomy/baseof.html",
|
||||
"tags/term-baseof.fr.amp.html",
|
||||
"tags/tags-baseof.fr.amp.html",
|
||||
"tags/taxonomy-baseof.fr.amp.html",
|
||||
"tags/list-baseof.fr.amp.html",
|
||||
"tags/baseof.fr.amp.html",
|
||||
"tags/term-baseof.amp.html",
|
||||
"tags/tags-baseof.amp.html",
|
||||
"tags/taxonomy-baseof.amp.html",
|
||||
"tags/list-baseof.amp.html",
|
||||
"tags/baseof.amp.html",
|
||||
"tags/term-baseof.fr.html",
|
||||
"tags/tags-baseof.fr.html",
|
||||
"tags/taxonomy-baseof.fr.html",
|
||||
"tags/list-baseof.fr.html",
|
||||
"tags/baseof.fr.html",
|
||||
"tags/term-baseof.html",
|
||||
"tags/tags-baseof.html",
|
||||
"tags/taxonomy-baseof.html",
|
||||
"tags/list-baseof.html",
|
||||
"tags/baseof.html",
|
||||
"_default/term-baseof.fr.amp.html",
|
||||
"_default/tags-baseof.fr.amp.html",
|
||||
"_default/taxonomy-baseof.fr.amp.html",
|
||||
"_default/list-baseof.fr.amp.html",
|
||||
"_default/baseof.fr.amp.html",
|
||||
"_default/term-baseof.amp.html",
|
||||
"_default/tags-baseof.amp.html",
|
||||
"_default/taxonomy-baseof.amp.html",
|
||||
"_default/list-baseof.amp.html",
|
||||
"_default/baseof.amp.html",
|
||||
"_default/term-baseof.fr.html",
|
||||
"_default/tags-baseof.fr.html",
|
||||
"_default/taxonomy-baseof.fr.html",
|
||||
"_default/list-baseof.fr.html",
|
||||
"_default/baseof.fr.html",
|
||||
"_default/term-baseof.html",
|
||||
"_default/tags-baseof.html",
|
||||
"_default/taxonomy-baseof.html",
|
||||
"_default/list-baseof.html",
|
||||
"_default/baseof.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Term", LayoutDescriptor{Kind: "term", Section: "tags"}, "", ampType,
|
||||
[]string{
|
||||
|
@ -392,6 +599,52 @@ func TestLayout(t *testing.T) {
|
|||
"_default/single.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Page baseof with layout and type", LayoutDescriptor{Kind: "page", Layout: "mylayout", Type: "myttype", Baseof: true}, "", ampType,
|
||||
[]string{
|
||||
"myttype/mylayout-baseof.amp.html",
|
||||
"myttype/single-baseof.amp.html",
|
||||
"myttype/baseof.amp.html",
|
||||
"myttype/mylayout-baseof.html",
|
||||
"myttype/single-baseof.html",
|
||||
"myttype/baseof.html",
|
||||
"_default/mylayout-baseof.amp.html",
|
||||
"_default/single-baseof.amp.html",
|
||||
"_default/baseof.amp.html",
|
||||
"_default/mylayout-baseof.html",
|
||||
"_default/single-baseof.html",
|
||||
"_default/baseof.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Page baseof with layout and type in French", LayoutDescriptor{Kind: "page", Layout: "mylayout", Type: "myttype", Lang: "fr", Baseof: true}, "", ampType,
|
||||
[]string{
|
||||
"myttype/mylayout-baseof.fr.amp.html",
|
||||
"myttype/single-baseof.fr.amp.html",
|
||||
"myttype/baseof.fr.amp.html",
|
||||
"myttype/mylayout-baseof.amp.html",
|
||||
"myttype/single-baseof.amp.html",
|
||||
"myttype/baseof.amp.html",
|
||||
"myttype/mylayout-baseof.fr.html",
|
||||
"myttype/single-baseof.fr.html",
|
||||
"myttype/baseof.fr.html",
|
||||
"myttype/mylayout-baseof.html",
|
||||
"myttype/single-baseof.html",
|
||||
"myttype/baseof.html",
|
||||
"_default/mylayout-baseof.fr.amp.html",
|
||||
"_default/single-baseof.fr.amp.html",
|
||||
"_default/baseof.fr.amp.html",
|
||||
"_default/mylayout-baseof.amp.html",
|
||||
"_default/single-baseof.amp.html",
|
||||
"_default/baseof.amp.html",
|
||||
"_default/mylayout-baseof.fr.html",
|
||||
"_default/single-baseof.fr.html",
|
||||
"_default/baseof.fr.html",
|
||||
"_default/mylayout-baseof.html",
|
||||
"_default/single-baseof.html",
|
||||
"_default/baseof.html",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Page with layout and type with subtype", LayoutDescriptor{Kind: "page", Layout: "mylayout", Type: "myttype/mysubtype"}, "", ampType,
|
||||
[]string{
|
||||
|
|
Loading…
Reference in a new issue