diff --git a/cache/filecache/filecache_integration_test.go b/cache/filecache/filecache_integration_test.go index 1e920c29f..d17c4367b 100644 --- a/cache/filecache/filecache_integration_test.go +++ b/cache/filecache/filecache_integration_test.go @@ -67,7 +67,7 @@ title: "Home" --- -- assets/a/pixel.png -- iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg== --- layouts/index.html -- +-- layouts/home.html -- {{ warnf "HOME!" }} {{ $img := resources.GetMatch "**.png" }} {{ $img = $img.Resize "3x3" }} diff --git a/common/htime/htime_integration_test.go b/common/htime/htime_integration_test.go index 8090add12..596e9f130 100644 --- a/common/htime/htime_integration_test.go +++ b/common/htime/htime_integration_test.go @@ -26,7 +26,7 @@ func TestApplyWithContext(t *testing.T) { files := ` -- config.toml -- defaultContentLanguage = 'it' --- layouts/index.html -- +-- layouts/home.html -- {{ $dates := slice "2022-01-03" "2022-02-01" diff --git a/common/hugo/hugo_integration_test.go b/common/hugo/hugo_integration_test.go index 77dbb5c91..938600199 100644 --- a/common/hugo/hugo_integration_test.go +++ b/common/hugo/hugo_integration_test.go @@ -35,7 +35,7 @@ baseURL = 'https://en.example.org/' --- title: home --- --- layouts/index.html -- +-- layouts/home.html -- multilingual={{ hugo.IsMultilingual }} multihost={{ hugo.IsMultihost }} ` diff --git a/common/paths/paths_integration_test.go b/common/paths/paths_integration_test.go index f5ea3066a..3f3f786f9 100644 --- a/common/paths/paths_integration_test.go +++ b/common/paths/paths_integration_test.go @@ -35,9 +35,9 @@ weight = 2 removePathAccents = true -- content/διακριτικός.md -- -- content/διακριτικός.fr.md -- --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Language.Lang }}|Single. --- layouts/_default/list.html -- +-- layouts/list.html -- List ` b := hugolib.Test(t, files) @@ -64,9 +64,9 @@ disablePathToLower = true -- content/MySection/MyPage.fr.md -- -- content/MySection/MyBundle/index.md -- -- content/MySection/MyBundle/index.fr.md -- --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Language.Lang }}|Single. --- layouts/_default/list.html -- +-- layouts/list.html -- {{ .Language.Lang }}|List. ` b := hugolib.Test(t, files) diff --git a/config/allconfig/allconfig_integration_test.go b/config/allconfig/allconfig_integration_test.go index 54a2cc091..6899cf21c 100644 --- a/config/allconfig/allconfig_integration_test.go +++ b/config/allconfig/allconfig_integration_test.go @@ -39,7 +39,7 @@ title: "p1" --- title: "p1" --- --- layouts/_default/single.html -- +-- layouts/single.html -- Title: {{ .Title }} ` @@ -141,7 +141,7 @@ disableKinds = ["taxonomy", "term"] [pagination] disableAliases = true pagerSize = 2 --- layouts/_default/list.html -- +-- layouts/list.html -- {{ $paginator := .Paginate site.RegularPages }} {{ template "_internal/pagination.html" . }} {{ range $paginator.Pages }} @@ -191,7 +191,7 @@ func TestInvalidOutputFormat(t *testing.T) { disableKinds = ['page','rss','section','sitemap','taxonomy','term'] [outputs] home = ['html','foo'] --- layouts/index.html -- +-- layouts/home.html -- x ` diff --git a/hugolib/404_test.go b/hugolib/404_test.go index 36738e428..90e804c2d 100644 --- a/hugolib/404_test.go +++ b/hugolib/404_test.go @@ -72,7 +72,7 @@ baseURL = "http://example.com/" disableLiveReload = true [internal] fastRenderMode = true --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- Base: {{ block "main" . }}{{ end }} -- layouts/404.html -- {{ define "main" }} diff --git a/hugolib/alias_test.go b/hugolib/alias_test.go index 32a95d608..b7944b597 100644 --- a/hugolib/alias_test.go +++ b/hugolib/alias_test.go @@ -72,11 +72,11 @@ func TestAliasMultipleOutputFormats(t *testing.T) { files := ` -- hugo.toml -- baseURL = "http://example.com" --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Content }} --- layouts/_default/single.amp.html -- +-- layouts/single.amp.html -- {{ .Content }} --- layouts/_default/single.json -- +-- layouts/single.json -- {{ .Content }} -- content/blog/page.md -- --- diff --git a/hugolib/cascade_test.go b/hugolib/cascade_test.go index d9d915a42..fa8e5e434 100644 --- a/hugolib/cascade_test.go +++ b/hugolib/cascade_test.go @@ -83,9 +83,9 @@ title: P1 title: P2 tags: [t1, t2] --- --- layouts/_default/list.html -- +-- layouts/list.html -- List: {{ len .Pages }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Single: Tags: {{ site.Taxonomies.tags }}| ` @@ -105,9 +105,9 @@ func TestCascadeEditIssue12449(t *testing.T) { baseURL = "https://example.com" disableKinds = ['sitemap','rss', 'home', 'taxonomy','term'] disableLiveReload = true --- layouts/_default/list.html -- +-- layouts/list.html -- Title: {{ .Title }}|{{ .Content }}|cascadeparam: {{ .Params.cascadeparam }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Title: {{ .Title }}|{{ .Content }}|cascadeparam: {{ .Params.cascadeparam }}| -- content/mysect/_index.md -- --- @@ -160,9 +160,9 @@ path = '/s1**' --- title: p1 --- --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }}| --- layouts/_default/list.html -- +-- layouts/list.html -- {{ .Title }}| ` b := Test(t, files) @@ -195,9 +195,9 @@ cascade: --- title: p1 --- --- layouts/_default/single.html -- +-- layouts/single.html -- Background: {{ .Params.background }}| --- layouts/_default/list.html -- +-- layouts/list.html -- {{ .Title }}| ` @@ -214,9 +214,9 @@ func TestCascadeOverlap(t *testing.T) { files := ` -- hugo.toml -- disableKinds = ['home','rss','sitemap','taxonomy','term'] --- layouts/_default/list.html -- +-- layouts/list.html -- {{ .Title }} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }} -- content/s/_index.md -- --- diff --git a/hugolib/config_test.go b/hugolib/config_test.go index 70b49f806..3f1e7e6e9 100644 --- a/hugolib/config_test.go +++ b/hugolib/config_test.go @@ -163,7 +163,7 @@ p2 = "p2base" [params.pm2] pm21 = "pm21base" pm22 = "pm22base" --- layouts/index.html -- +-- layouts/home.html -- p1: {{ .Site.Params.p1 }} p2: {{ .Site.Params.p2 }} pm21: {{ .Site.Params.pm2.pm21 }} @@ -212,7 +212,7 @@ p2 = "p2en" sub1 = "sub1en" [languages.sv] title = "Svensk Title Theme" --- layouts/index.html -- +-- layouts/home.html -- title: {{ .Title }}| p1: {{ .Site.Params.p1 }}| p2: {{ .Site.Params.p2 }}| @@ -244,7 +244,7 @@ weight = 2 [languages.no] weight = 3 --- layouts/index.html -- +-- layouts/home.html -- Home. ` @@ -522,7 +522,7 @@ t3 = "tv3d" -- themes/test-theme/config/production/config.toml -- [params] t3 = "tv3p" --- layouts/index.html -- +-- layouts/home.html -- m1: {{ .Site.Params.m1 }} m2: {{ .Site.Params.m2 }} t1: {{ .Site.Params.t1 }} @@ -551,7 +551,7 @@ func TestPrivacyConfig(t *testing.T) { someOtherValue = "foo" [privacy.youtube] privacyEnhanced = true --- layouts/index.html -- +-- layouts/home.html -- Privacy Enhanced: {{ .Site.Config.Privacy.YouTube.PrivacyEnhanced }} ` b := Test(t, files) @@ -645,7 +645,7 @@ func TestInvalidDefaultMarkdownHandler(t *testing.T) { defaultMarkdownHandler = 'blackfriday' -- content/_index.md -- ## Foo --- layouts/index.html -- +-- layouts/home.html -- {{ .Content }} ` @@ -677,7 +677,7 @@ themeconfigdirparam = "themeconfigdirvalue" -- themes/mytheme/hugo.toml -- [params] themeparam = "themevalue" --- layouts/index.html -- +-- layouts/home.html -- rootparam: {{ site.Params.rootparam }} rootconfigparam: {{ site.Params.rootconfigparam }} themeparam: {{ site.Params.themeparam }} @@ -725,9 +725,9 @@ weigHt = WEIGHT_EN title = "Swedish" wEight = WEIGHT_SV disableKinds = ["page"] --- layouts/index.html -- +-- layouts/home.html -- Home: {{ .Lang}}|{{ len site.RegularPages }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Single. -- content/p1.en.md -- -- content/p2.en.md -- @@ -792,7 +792,7 @@ mediaType = 'text/html' [outputFormats.myformat] baseName = 'myindex' mediaType = 'text/html' --- layouts/index.html -- +-- layouts/home.html -- Home. @@ -827,7 +827,7 @@ myparam = "enParamValue" title = "Svensk Title" [languages.sv.params] myparam = "svParamValue" --- layouts/index.html -- +-- layouts/home.html -- MyParam: {{ site.Params.myparam }} ThisIsAParam: {{ site.Params.thisIsAParam }} @@ -873,7 +873,7 @@ title: "My English Section" --- title: "My Swedish Section" --- --- layouts/index.html -- +-- layouts/home.html -- LanguageCode: {{ eq site.LanguageCode site.Language.LanguageCode }}|{{ site.Language.LanguageCode }}| {{ range $i, $e := (slice site .Site) }} {{ $i }}|AllPages: {{ len .AllPages }}|Sections: {{ if .Sections }}true{{ end }}|BuildDrafts: {{ .BuildDrafts }}|Param: {{ .Language.Params.myparam }}|Language string: {{ .Language }}|Languages: {{ .Languages }} @@ -914,7 +914,7 @@ params: mainSections: -- content/mysection/_index.md -- -- content/mysection/mycontent.md -- --- layouts/index.html -- +-- layouts/home.html -- mainSections: {{ site.Params.mainSections }} ` @@ -930,7 +930,7 @@ func TestConfigHugoWorkingDir(t *testing.T) { files := ` -- hugo.toml -- --- layouts/index.html -- +-- layouts/home.html -- WorkingDir: {{ hugo.WorkingDir }}| ` @@ -971,7 +971,7 @@ p1 = "p1de" [languages.de.markup.goldmark.extensions.typographer] leftDoubleQuote = '«' # default “ rightDoubleQuote = '»' # default ” --- layouts/index.html -- +-- layouts/home.html -- {{ .Content }} p1: {{ site.Params.p1 }}| -- content/_index.en.md -- @@ -1002,7 +1002,7 @@ func TestConfigLegacyValues(t *testing.T) { # taxonomyTerm was renamed to taxonomy in Hugo 0.60.0. disableKinds = ["taxonomyTerm"] --- layouts/index.html -- +-- layouts/home.html -- Home ` @@ -1042,9 +1042,9 @@ notAlternative = true --- outputs: ["html", "htaccess"] --- --- layouts/index.html -- +-- layouts/home.html -- HTML. --- layouts/_default/list.htaccess -- +-- layouts/list.htaccess -- HTACCESS. @@ -1061,7 +1061,7 @@ func TestConfigLanguageCodeTopLevel(t *testing.T) { files := ` -- hugo.toml -- languageCode = "en-US" --- layouts/index.html -- +-- layouts/home.html -- LanguageCode: {{ .Site.LanguageCode }}|{{ site.Language.LanguageCode }}| @@ -1087,7 +1087,7 @@ path = "foo" [languages.sv.mediatypes."text/html"] suffixes = ["bar"] --- layouts/index.html -- +-- layouts/home.html -- Home. @@ -1115,7 +1115,7 @@ func TestConfigMiscPanics(t *testing.T) { files := ` -- hugo.yaml -- params: --- layouts/index.html -- +-- layouts/home.html -- Foo: {{ site.Params.foo }}| @@ -1139,7 +1139,7 @@ defaultContentLanguage = "en" lang = "en" languageName = "English" weight = 1 --- layouts/index.html -- +-- layouts/home.html -- Foo: {{ site.Params.foo }}| @@ -1191,7 +1191,7 @@ func TestConfigModuleDefaultMountsInConfig(t *testing.T) { -- hugo.toml -- baseURL = "https://example.org" contentDir = "mycontent" --- layouts/index.html -- +-- layouts/home.html -- Home. @@ -1216,7 +1216,7 @@ defaultContentLanguageInSubdir = true disableKinds = ["taxonomy", "term", "page", "section"] -- content/foo/bar.txt -- Foo. --- layouts/index.html -- +-- layouts/home.html -- Home. ` b := Test(t, files) @@ -1244,7 +1244,7 @@ title = "English Title" title = "Swedish Title" -- content/foo/bar.txt -- Foo. --- layouts/index.html -- +-- layouts/home.html -- Home. ` b := Test(t, files) @@ -1272,7 +1272,7 @@ title = "English Title" title = "Swedish Title" -- content/foo/bar.txt -- Foo. --- layouts/index.html -- +-- layouts/home.html -- Home. ` b := Test(t, files) @@ -1295,7 +1295,7 @@ title = "English Title" [languages.sv] title = "Swedish Title" disabled = true --- layouts/index.html -- +-- layouts/home.html -- Home. @@ -1317,7 +1317,7 @@ disableDefaultLanguageRedirect = true title = "English Title" [languages.sv] title = "Swedish Title" --- layouts/index.html -- +-- layouts/home.html -- Home. @@ -1450,9 +1450,9 @@ category = 'categories' title: "P1" categories: ["c1"] --- --- layouts/index.html -- +-- layouts/home.html -- Home. --- layouts/_default/list.html -- +-- layouts/list.html -- List. @@ -1473,7 +1473,7 @@ func TestKindsUnknown(t *testing.T) { disableKinds = ['foo', 'home'] [outputs] foo = ['HTML', 'AMP', 'RSS'] --- layouts/_default/list.html -- +-- layouts/list.html -- List. @@ -1499,7 +1499,7 @@ func TestDeprecateTaxonomyTerm(t *testing.T) { disableKinds = ['taxonomyTerm'] [outputs] taxonomyterm = ['HTML', 'AMP', 'RSS'] --- layouts/_default/list.html -- +-- layouts/list.html -- List. @@ -1530,7 +1530,7 @@ title = "English" [languages.pt] weight = 2 title = "Portuguese" --- layouts/index.html -- +-- layouts/home.html -- Home. -- content/custom/index.br.md -- --- diff --git a/hugolib/configdir_test.go b/hugolib/configdir_test.go index 39505563d..e47b75cee 100644 --- a/hugolib/configdir_test.go +++ b/hugolib/configdir_test.go @@ -35,7 +35,7 @@ ignoreErrors = ["error-missing-instagram-accesstoken"] a = "a1" b = "b1" c = "c1" --- layouts/index.html -- +-- layouts/home.html -- Params: {{ site.Params}} ` b := Test(t, files) diff --git a/hugolib/content_map_test.go b/hugolib/content_map_test.go index 2be88a78e..92196b67f 100644 --- a/hugolib/content_map_test.go +++ b/hugolib/content_map_test.go @@ -54,7 +54,7 @@ draft: true files := ` -- hugo.toml -- baseURL = "http://example.com" --- layouts/index.html -- +-- layouts/home.html -- Num Regular: {{ len .Site.RegularPages }}|{{ range .Site.RegularPages }}{{ .RelPermalink }}|{{ end }}$ Main Sections: {{ .Site.Params.mainSections }} Pag Num Pages: {{ len .Paginator.Pages }} @@ -205,7 +205,7 @@ func TestIntegrationTestTemplate(t *testing.T) { -- config.toml -- title = "Integration Test" disableKinds=["page", "section", "taxonomy", "term", "sitemap", "robotsTXT", "RSS"] --- layouts/index.html -- +-- layouts/home.html -- Home: {{ .Title }}| ` @@ -235,7 +235,7 @@ weight = 1 weight = 2 [languages.de] weight = 3 --- layouts/index.html -- +-- layouts/home.html -- {{ $bundle := site.GetPage "bundle" }} {{ $r := $bundle.Resources.GetMatch "*.txt" }} {{ .Language.Lang }}: {{ with $r }}{{ .RelPermalink }}|{{ .Content }}{{ end}} @@ -276,7 +276,7 @@ disableKinds = ["taxonomy", "term"] -- content/bundle/index.md -- -- content/bundle/data with Spaces.txt -- Data. --- layouts/index.html -- +-- layouts/home.html -- {{ $bundle := site.GetPage "bundle" }} {{ $r := $bundle.Resources.Get "data with Spaces.txt" }} R: {{ with $r }}{{ .Content }}{{ end }}| @@ -300,7 +300,7 @@ data 1.txt Data 1.txt -- content/bundle/Data-1.txt -- Data-1.txt --- layouts/index.html -- +-- layouts/home.html -- {{ $bundle := site.GetPage "bundle" }} {{ $r := $bundle.Resources.Get "data-1.txt" }} R: {{ with $r }}{{ .Content }}{{ end }}|Len: {{ len $bundle.Resources }}|$ @@ -329,9 +329,9 @@ foo.txt p1.txt -- content/s1/p1-foo.txt -- p1-foo.txt --- layouts/_default/list.html -- +-- layouts/list.html -- {{.Title }}| --- layouts/_default/single.html -- +-- layouts/single.html -- {{.Title }}| ` @@ -361,7 +361,7 @@ title: s1 --- -- content/s1x/a.txt -- a.txt --- layouts/index.html -- +-- layouts/home.html -- Home. {{ range .Resources.Match "**" }} {{ .Name }}| @@ -386,7 +386,7 @@ defaultContentLanguageInSubdir = true [languages.en] [sitemap] filename = 'foo.xml' --- layouts/index.html -- +-- layouts/home.html -- irrelevant ` @@ -497,7 +497,7 @@ title: p1
b
-- content/p1/c.html --c
--- layouts/_default/single.html -- +-- layouts/single.html -- Path: {{ .Path }}|{{.Kind }} |{{ (.Resources.Get "a.html").RelPermalink -}} |{{ (.Resources.Get "b.html").RelPermalink -}} diff --git a/hugolib/content_render_hooks_test.go b/hugolib/content_render_hooks_test.go index 063d695da..f6015ad22 100644 --- a/hugolib/content_render_hooks_test.go +++ b/hugolib/content_render_hooks_test.go @@ -26,7 +26,7 @@ func TestRenderHooksRSS(t *testing.T) { -- hugo.toml -- baseURL = "https://example.org" disableKinds = ["taxonomy", "term"] --- layouts/index.html -- +-- layouts/home.html -- {{ $p := site.GetPage "p1.md" }} {{ $p2 := site.GetPage "p2.md" }} P1: {{ $p.Content }} @@ -36,13 +36,13 @@ P2: {{ $p2.Content }} {{ $p3 := site.GetPage "p3.md" }} P2: {{ $p2.Content }} P3: {{ $p3.Content }} --- layouts/_default/_markup/render-link.html -- +-- layouts/_markup/render-link.html -- html-link: {{ .Destination | safeURL }}| --- layouts/_default/_markup/render-link.rss.xml -- +-- layouts/_markup/render-link.rss.xml -- xml-link: {{ .Destination | safeURL }}| --- layouts/_default/_markup/render-heading.html -- +-- layouts/_markup/render-heading.html -- html-heading: {{ .Text }}| --- layouts/_default/_markup/render-heading.rss.xml -- +-- layouts/_markup/render-heading.rss.xml -- xml-heading: {{ .Text }}| -- content/p1.md -- --- @@ -87,7 +87,7 @@ func TestRenderHooksRSSOnly(t *testing.T) { -- hugo.toml -- baseURL = "https://example.org" disableKinds = ["taxonomy", "term"] --- layouts/index.html -- +-- layouts/home.html -- {{ $p := site.GetPage "p1.md" }} {{ $p2 := site.GetPage "p2.md" }} P1: {{ $p.Content }} @@ -97,9 +97,9 @@ P2: {{ $p2.Content }} {{ $p3 := site.GetPage "p3.md" }} P2: {{ $p2.Content }} P3: {{ $p3.Content }} --- layouts/_default/_markup/render-link.rss.xml -- +-- layouts/_markup/render-link.rss.xml -- xml-link: {{ .Destination | safeURL }}| --- layouts/_default/_markup/render-heading.rss.xml -- +-- layouts/_markup/render-heading.rss.xml -- xml-heading: {{ .Text }}| -- content/p1.md -- --- @@ -150,12 +150,12 @@ baseURL="https://example.org" [markup.goldmark] [markup.goldmark.renderer] unsafe = true --- layouts/index.html -- +-- layouts/home.html -- {{ $p := site.GetPage "p1.md" }} P1: {{ $p.Content }} --- layouts/_default/_markup/render-link.html -- +-- layouts/_markup/render-link.html -- html-link: {{ .Destination | safeURL }}|Text: {{ .Text }}|Plain: {{ .PlainText | safeHTML }} --- layouts/_default/_markup/render-image.html -- +-- layouts/_markup/render-image.html -- html-image: {{ .Destination | safeURL }}|Text: {{ .Text }}|Plain: {{ .PlainText | safeHTML }} -- content/p1.md -- --- @@ -203,7 +203,7 @@ title: "p2" ## E ## F --- layouts/_default/_markup/render-heading.html -- +-- layouts/_markup/render-heading.html -- Heading: {{ .Text }}| {{ with .Page }} Self Fragments: {{ .Fragments.Identifiers }}| @@ -211,7 +211,7 @@ Self Fragments: {{ .Fragments.Identifiers }}| {{ with (site.GetPage "p1.md") }} P1 Fragments: {{ .Fragments.Identifiers }}| {{ end }} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Content}} ` @@ -276,7 +276,7 @@ title: "p2 en" iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg== -- content/p2/pixel.png -- iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg== --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }}|{{ .Content }}|$ ` @@ -322,7 +322,7 @@ Link: [text-"<>&](/destination-"<> 'title-"<>&') Image:  {class=">" id="baz"} --- layouts/index.html -- +-- layouts/home.html -- {{ .Content }} ` @@ -362,9 +362,9 @@ title: "p1" First line. Second line. ---------------- --- layouts/_default/_markup/render-heading.html -- +-- layouts/_markup/render-heading.html -- Plain text: {{ .PlainText }}|Text: {{ .Text }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Content: {{ .Content}}| } ` @@ -379,13 +379,13 @@ Content: {{ .Content}}| func TestContentOutputReuseRenderHooksAndShortcodesHTMLOnly(t *testing.T) { files := ` -- hugo.toml -- --- layouts/index.html -- +-- layouts/home.html -- HTML: {{ .Title }}|{{ .Content }}| -- layouts/index.xml -- XML: {{ .Title }}|{{ .Content }}| -- layouts/_markup/render-heading.html -- Render heading. --- layouts/shortcodes/myshortcode.html -- +-- layouts/_shortcodes/myshortcode.html -- My shortcode. -- content/_index.md -- --- @@ -407,7 +407,7 @@ func TestContentOutputNoReuseRenderHooksInBothHTMLAnXML(t *testing.T) { files := ` -- hugo.toml -- disableKinds = ["taxonomy", "term"] --- layouts/index.html -- +-- layouts/home.html -- HTML: {{ .Title }}|{{ .Content }}| -- layouts/index.xml -- XML: {{ .Title }}|{{ .Content }}| @@ -435,16 +435,16 @@ func TestContentOutputNoReuseShortcodesInBothHTMLAnXML(t *testing.T) { files := ` -- hugo.toml -- disableKinds = ["taxonomy", "term"] --- layouts/index.html -- +-- layouts/home.html -- HTML: {{ .Title }}|{{ .Content }}| -- layouts/index.xml -- XML: {{ .Title }}|{{ .Content }}| -- layouts/_markup/render-heading.html -- Render heading. --- layouts/shortcodes/myshortcode.html -- +-- layouts/_shortcodes/myshortcode.html -- My shortcode HTML. --- layouts/shortcodes/myshortcode.xml -- +-- layouts/_shortcodes/myshortcode.xml -- My shortcode XML. -- content/_index.md -- --- diff --git a/hugolib/datafiles_test.go b/hugolib/datafiles_test.go index 657e6020c..4b1b6739f 100644 --- a/hugolib/datafiles_test.go +++ b/hugolib/datafiles_test.go @@ -36,7 +36,7 @@ v1: c_d_v1 v1 = "a_v1_theme" -- themes/mytheme/data/d.toml -- v1 = "d_v1_theme" --- layouts/index.html -- +-- layouts/home.html -- a: {{ site.Data.a.v1 }}| b: {{ site.Data.b.v1 }}| cd: {{ site.Data.c.d.v1 }}| @@ -56,7 +56,7 @@ func TestDataMixedCaseFolders(t *testing.T) { baseURL = "https://example.com" -- data/MyFolder/MyData.toml -- v1 = "my_v1" --- layouts/index.html -- +-- layouts/home.html -- {{ site.Data }} v1: {{ site.Data.MyFolder.MyData.v1 }}| ` @@ -74,7 +74,7 @@ func TestDataNoAssets(t *testing.T) { disableKinds = ['page','rss','section','sitemap','taxonomy','term'] -- assets/data/foo.toml -- content = "I am assets/data/foo.toml" --- layouts/index.html -- +-- layouts/home.html -- |{{ site.Data.foo.content }}| ` diff --git a/hugolib/dates_test.go b/hugolib/dates_test.go index c99545e8a..64c9e3dfb 100644 --- a/hugolib/dates_test.go +++ b/hugolib/dates_test.go @@ -44,7 +44,7 @@ date: 2021-07-18 title: Page date: 2021-07-18 --- --- layouts/index.html -- +-- layouts/home.html -- Date: {{ .Date | time.Format ":date_long" }} ` @@ -111,7 +111,7 @@ weight=10 [languages.nn] timeZone="America/Antigua" weight=20 --- layouts/_default/single.html -- +-- layouts/single.html -- Date: {{ .Date | safeHTML }} Lastmod: {{ .Lastmod | safeHTML }} PublishDate: {{ .PublishDate | safeHTML }} @@ -192,7 +192,7 @@ func TestTimeOnError(t *testing.T) { files := ` -- hugo.toml -- --- layouts/index.html -- +-- layouts/home.html -- time: {{ time "2020-10-20" "invalid-timezone" }} -- content/p1.md -- ` @@ -228,7 +228,7 @@ talks = [ { date = 2050-02-12, name = "Future talk 1" }, { date = 2050-02-13, name = "Future talk 2" }, ] --- layouts/index.html -- +-- layouts/home.html -- {{ $futureTalks := where site.Data.mydata.talks "date" ">" now }} {{ $pastTalks := where site.Data.mydata.talks "date" "<" now }} @@ -266,11 +266,11 @@ func TestPublisDateRollupIssue12438(t *testing.T) { disableKinds = ['home','rss','sitemap'] [taxonomies] tag = 'tags' --- layouts/_default/list.html -- +-- layouts/list.html -- Date: {{ .Date.Format "2006-01-02" }} PublishDate: {{ .PublishDate.Format "2006-01-02" }} Lastmod: {{ .Lastmod.Format "2006-01-02" }} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }} -- content/s1/p1.md -- --- diff --git a/hugolib/disableKinds_test.go b/hugolib/disableKinds_test.go index 1ee312347..25a8c94f6 100644 --- a/hugolib/disableKinds_test.go +++ b/hugolib/disableKinds_test.go @@ -28,7 +28,7 @@ baseURL = "http://example.com/blog" enableRobotsTXT = true ignoreErrors = ["error-disable-taxonomy"] disableKinds = ["%s"] --- layouts/_default/single.html -- +-- layouts/single.html -- single -- content/sect/page.md -- --- @@ -209,7 +209,7 @@ func TestDisableRSSWithRSSInCustomOutputs(t *testing.T) { disableKinds = ["term", "taxonomy", "RSS"] [outputs] home = [ "HTML", "RSS" ] --- layouts/index.html -- +-- layouts/home.html -- Home ` b := Test(t, files) @@ -224,7 +224,7 @@ func TestBundleNoPublishResources(t *testing.T) { files := ` -- hugo.toml -- baseURL = "http://example.com" --- layouts/index.html -- +-- layouts/home.html -- {{ $bundle := site.GetPage "section/bundle-false" }} {{ $data1 := $bundle.Resources.GetMatch "data1*" }} Data1: {{ $data1.RelPermalink }} @@ -256,7 +256,7 @@ func TestNoRenderAndNoPublishResources(t *testing.T) { files := ` -- hugo.toml -- baseURL = "http://example.com" --- layouts/index.html -- +-- layouts/home.html -- {{ $page := site.GetPage "sect/no-render" }} {{ $sect := site.GetPage "sect-no-render" }} @@ -321,7 +321,7 @@ title: "Page 1 en" --- title: "Page 2 nn" --- --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }} ` b := Test(t, files) diff --git a/hugolib/embedded_templates_test.go b/hugolib/embedded_templates_test.go index 80f773099..c93ccdf9f 100644 --- a/hugolib/embedded_templates_test.go +++ b/hugolib/embedded_templates_test.go @@ -41,7 +41,7 @@ lastmod: 2021-05-22T19:25:00+01:00 --- title: My Site --- --- layouts/_default/single.html -- +-- layouts/single.html -- {{ template "_internal/twitter_cards.html" . }} {{ template "_internal/opengraph.html" . }} @@ -138,7 +138,7 @@ title: p09 --- title: p10 --- --- layouts/index.html -- +-- layouts/home.html -- {{ .Paginate (where site.RegularPages "Section" "s1") }}` + variant + ` ` b := Test(t, files) diff --git a/hugolib/filesystems/basefs_test.go b/hugolib/filesystems/basefs_test.go index 4a6e0bbaf..6f02f2c7f 100644 --- a/hugolib/filesystems/basefs_test.go +++ b/hugolib/filesystems/basefs_test.go @@ -480,7 +480,7 @@ target = "content/posts" [[module.mounts]] source = "docs" target = "content/mydocs" --- layouts/index.html -- +-- layouts/home.html -- Home. ` @@ -554,7 +554,7 @@ JS. body { color: red; } -- assets/scss/app.scss -- body { color: blue; } --- layouts/index.html -- +-- layouts/home.html -- Home. SCSS: {{ with resources.Get "scss/app.scss" }}{{ .RelPermalink }}|{{ .Content }}{{ end }}| # Note that the pattern below will match 2 resources, which doesn't make much sense, diff --git a/hugolib/frontmatter_test.go b/hugolib/frontmatter_test.go index c4cbfa72e..8b8937f49 100644 --- a/hugolib/frontmatter_test.go +++ b/hugolib/frontmatter_test.go @@ -26,7 +26,7 @@ ints: [1, 2, 3] mixed: ["1", 2, 3] strings: ["1", "2","3"] --- --- layouts/_default/single.html -- +-- layouts/single.html -- Ints: {{ printf "%T" .Params.ints }} {{ range .Params.ints }}Int: {{ fmt.Printf "%[1]v (%[1]T)" . }}|{{ end }} Mixed: {{ printf "%T" .Params.mixed }} {{ range .Params.mixed }}Mixed: {{ fmt.Printf "%[1]v (%[1]T)" . }}|{{ end }} Strings: {{ printf "%T" .Params.strings }} {{ range .Params.strings }}Strings: {{ fmt.Printf "%[1]v (%[1]T)" . }}|{{ end }} diff --git a/hugolib/hugo_modules_test.go b/hugolib/hugo_modules_test.go index 03c70239d..84c41a216 100644 --- a/hugolib/hugo_modules_test.go +++ b/hugolib/hugo_modules_test.go @@ -82,7 +82,7 @@ languageName = "French" weight = 4 title = "French Title" --- layouts/index.html -- +-- layouts/home.html -- {{ range .Site.RegularPages }} |{{ .Title }}|{{ .RelPermalink }}|{{ .Plain }} {{ end }} @@ -158,7 +158,7 @@ ignoreConfig=true -- themes/a/config.toml -- [params] a = "Should Be Ignored!" --- layouts/index.html -- +-- layouts/home.html -- Params: {{ .Site.Params }} ` Test(t, files).AssertFileContent("public/index.html", "! Ignored") @@ -182,7 +182,7 @@ a = "A param" -- themes/b/config.toml -- [params] b = "B param" --- layouts/index.html -- +-- layouts/home.html -- Params: {{ .Site.Params }} ` Test(t, files).AssertFileContent("public/index.html", "A param", "! B param") @@ -236,7 +236,7 @@ baseURL="https://example.org" [[module.mounts]] source="mycontent" target="content" --- layouts/_default/single.html -- +-- layouts/single.html -- Permalink: {{ .Permalink }}| -- mycontent/mypage.md -- --- @@ -260,7 +260,7 @@ source = "README.md" target = "content/_index.md" -- README.md -- # Hello World --- layouts/index.html -- +-- layouts/home.html -- Home: {{ .Title }}|{{ .Content }}| ` b := Test(t, files) @@ -303,7 +303,7 @@ target = "content/resources-a" [[module.mounts]] source = "extra-content" target = "content/resources-b" --- layouts/_default/single.html -- +-- layouts/single.html -- Single -- content/p1.md -- -- extra-content/_index.md -- @@ -332,7 +332,7 @@ source = "extra-data" target = "data/extra" -- extra-data/test.yaml -- message: Hugo Rocks --- layouts/index.html -- +-- layouts/home.html -- {{ site.Data.extra.test.message }} ` diff --git a/hugolib/hugo_sites_build_errors_test.go b/hugolib/hugo_sites_build_errors_test.go index 709f1c34d..345790dc6 100644 --- a/hugolib/hugo_sites_build_errors_test.go +++ b/hugolib/hugo_sites_build_errors_test.go @@ -62,13 +62,13 @@ func TestSiteBuildErrors(t *testing.T) { return ` -- hugo.toml -- baseURL = "https://example.com" --- layouts/shortcodes/sc.html -- +-- layouts/_shortcodes/sc.html -- ` + f(shortcode, `SHORTCODE L1 SHORTCODE L2 SHORTCODE L3: SHORTCODE L4: {{ .Page.Title }} `) + ` --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- ` + f(base, `BASEOF L1 BASEOF L2 BASEOF L3 @@ -76,7 +76,7 @@ BASEOF L4{{ if .Title }}{{ end }} {{block "main" .}}This is the main content.{{end}} BASEOF L6 `) + ` --- layouts/_default/single.html -- +-- layouts/single.html -- ` + f(single, `{{ define "main" }} SINGLE L2: SINGLE L3: @@ -169,7 +169,7 @@ Some content. fe := a.getFileError(err) a.c.Assert(fe.Position().LineNumber, qt.Equals, 5) a.c.Assert(fe.Position().ColumnNumber, qt.Equals, 14) - a.assertErrorMessage("\"layouts/_default/single.html:5:14\": execute of template failed", fe.Error()) + a.assertErrorMessage("\"layouts/single.html:5:14\": execute of template failed", fe.Error()) }, }, { @@ -182,7 +182,7 @@ Some content. fe := a.getFileError(err) a.c.Assert(fe.Position().LineNumber, qt.Equals, 5) a.c.Assert(fe.Position().ColumnNumber, qt.Equals, 14) - a.assertErrorMessage("\"layouts/_default/single.html:5:14\": execute of template failed", fe.Error()) + a.assertErrorMessage("\"layouts/single.html:5:14\": execute of template failed", fe.Error()) }, }, { @@ -204,7 +204,7 @@ Some content. assertErr: func(a testSiteBuildErrorAsserter, err error) { fe := a.getFileError(err) // Make sure that it contains both the content file and template - a.assertErrorMessage(`"content/myyaml.md:7:10": failed to render shortcode "sc": failed to process shortcode: "layouts/shortcodes/sc.html:4:22": execute of template failed: template: shortcodes/sc.html:4:22: executing "shortcodes/sc.html" at <.Page.Titles>: can't evaluate field Titles in type page.Page`, fe.Error()) + a.assertErrorMessage(`"content/myyaml.md:7:10": failed to render shortcode "sc": failed to process shortcode: "layouts/_shortcodes/sc.html:4:22": execute of template failed: template: shortcodes/sc.html:4:22: executing "shortcodes/sc.html" at <.Page.Titles>: can't evaluate field Titles in type page.Page`, fe.Error()) a.c.Assert(fe.Position().LineNumber, qt.Equals, 7) }, }, @@ -309,7 +309,7 @@ func TestErrorMinify(t *testing.T) { [minify] minifyOutput = true --- layouts/index.html -- +-- layouts/home.html -- @@ -338,16 +338,16 @@ func TestErrorNestedRender(t *testing.T) { --- title: "Home" --- --- layouts/index.html -- +-- layouts/home.html -- line 1 line 2 1{{ .Render "myview" }} --- layouts/_default/myview.html -- +-- layouts/myview.html -- line 1 12{{ partial "foo.html" . }} line 4 line 5 --- layouts/partials/foo.html -- +-- layouts/_partials/foo.html -- line 1 line 2 123{{ .ThisDoesNotExist }} @@ -361,7 +361,7 @@ line 4 b.Assert(errors, qt.HasLen, 4) b.Assert(errors[0].Position().LineNumber, qt.Equals, 3) b.Assert(errors[0].Position().ColumnNumber, qt.Equals, 4) - b.Assert(errors[0].Error(), qt.Contains, filepath.FromSlash(`"/layouts/index.html:3:4": execute of template failed`)) + b.Assert(errors[0].Error(), qt.Contains, filepath.FromSlash(`"/layouts/home.html:3:4": execute of template failed`)) b.Assert(errors[0].ErrorContext().Lines, qt.DeepEquals, []string{"line 1", "line 2", "1{{ .Render \"myview\" }}"}) b.Assert(errors[2].Position().LineNumber, qt.Equals, 2) b.Assert(errors[2].Position().ColumnNumber, qt.Equals, 5) @@ -385,17 +385,17 @@ title: "Home" ## Hello {{< hello >}} --- layouts/index.html -- +-- layouts/home.html -- line 1 line 2 {{ .Content }} line 5 --- layouts/shortcodes/hello.html -- +-- layouts/_shortcodes/hello.html -- line 1 12{{ partial "foo.html" . }} line 4 line 5 --- layouts/partials/foo.html -- +-- layouts/_partials/foo.html -- line 1 line 2 123{{ .ThisDoesNotExist }} @@ -412,7 +412,7 @@ line 4 b.Assert(errors[1].Position().LineNumber, qt.Equals, 6) b.Assert(errors[1].Position().ColumnNumber, qt.Equals, 1) b.Assert(errors[1].ErrorContext().ChromaLexer, qt.Equals, "md") - b.Assert(errors[1].Error(), qt.Contains, filepath.FromSlash(`"/content/_index.md:6:1": failed to render shortcode "hello": failed to process shortcode: "/layouts/shortcodes/hello.html:2:5":`)) + b.Assert(errors[1].Error(), qt.Contains, filepath.FromSlash(`"/content/_index.md:6:1": failed to render shortcode "hello": failed to process shortcode: "/layouts/_shortcodes/hello.html:2:5":`)) b.Assert(errors[1].ErrorContext().Lines, qt.DeepEquals, []string{"", "## Hello", "{{< hello >}}", ""}) b.Assert(errors[2].ErrorContext().Lines, qt.DeepEquals, []string{"line 1", "12{{ partial \"foo.html\" . }}", "line 4", "line 5"}) b.Assert(errors[3].Position().LineNumber, qt.Equals, 3) @@ -432,12 +432,12 @@ title: "Home" ## Hello --- layouts/index.html -- +-- layouts/home.html -- line 1 line 2 {{ .Content }} line 5 --- layouts/_default/_markup/render-heading.html -- +-- layouts/_markup/render-heading.html -- line 1 12{{ .Levels }} line 4 @@ -450,7 +450,7 @@ line 5 errors := herrors.UnwrapFileErrorsWithErrorContext(err) b.Assert(errors, qt.HasLen, 3) - b.Assert(errors[0].Error(), qt.Contains, filepath.FromSlash(`"/content/_index.md:2:5": "/layouts/_default/_markup/render-heading.html:2:5": execute of template failed`)) + b.Assert(errors[0].Error(), qt.Contains, filepath.FromSlash(`"/content/_index.md:2:5": "/layouts/_markup/render-heading.html:2:5": execute of template failed`)) } func TestErrorRenderHookCodeblock(t *testing.T) { @@ -470,12 +470,12 @@ bar §§§ --- layouts/index.html -- +-- layouts/home.html -- line 1 line 2 {{ .Content }} line 5 --- layouts/_default/_markup/render-codeblock-foo.html -- +-- layouts/_markup/render-codeblock-foo.html -- line 1 12{{ .Foo }} line 4 @@ -489,7 +489,7 @@ line 5 b.Assert(errors, qt.HasLen, 3) first := errors[0] - b.Assert(first.Error(), qt.Contains, filepath.FromSlash(`"/content/_index.md:7:1": "/layouts/_default/_markup/render-codeblock-foo.html:2:5": execute of template failed`)) + b.Assert(first.Error(), qt.Contains, filepath.FromSlash(`"/content/_index.md:7:1": "/layouts/_markup/render-codeblock-foo.html:2:5": execute of template failed`)) } func TestErrorInBaseTemplate(t *testing.T) { @@ -507,7 +507,7 @@ line 2 base {{ block "main" . }}empty{{ end }} line 4 base {{ block "toc" . }}empty{{ end }} --- layouts/index.html -- +-- layouts/home.html -- {{ define "main" }} line 2 index line 3 index @@ -516,7 +516,7 @@ line 4 index {{ define "toc" }} TOC: {{ partial "toc.html" . }} {{ end }} --- layouts/partials/toc.html -- +-- layouts/_partials/toc.html -- toc line 1 toc line 2 toc line 3 @@ -534,13 +534,13 @@ toc line 4 b.Assert(err.Error(), qt.Contains, `baseof.html:4:6`) }) - t.Run("index template", func(t *testing.T) { + t.Run("home template", func(t *testing.T) { files := strings.Replace(filesTemplate, "line 3 index", "1234{{ .ThisDoesNotExist \"abc\" }}", 1) b, err := TestE(t, files) b.Assert(err, qt.IsNotNil) - b.Assert(err.Error(), qt.Contains, `index.html:3:7"`) + b.Assert(err.Error(), qt.Contains, `home.html:3:7"`) }) t.Run("partial from define", func(t *testing.T) { @@ -561,9 +561,9 @@ func TestSiteBuildTimeout(t *testing.T) { filesBuilder.WriteString(` -- hugo.toml -- timeout = 5 --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .WordCount }} --- layouts/shortcodes/c.html -- +-- layouts/_shortcodes/c.html -- {{ range .Page.Site.RegularPages }} {{ .WordCount }} {{ end }} @@ -591,7 +591,7 @@ func TestErrorTemplateRuntime(t *testing.T) { files := ` -- hugo.toml -- --- layouts/index.html -- +-- layouts/home.html -- Home. {{ .ThisDoesNotExist }} ` @@ -599,7 +599,7 @@ Home. b, err := TestE(t, files) b.Assert(err, qt.Not(qt.IsNil)) - b.Assert(err.Error(), qt.Contains, filepath.FromSlash(`/layouts/index.html:2:3`)) + b.Assert(err.Error(), qt.Contains, filepath.FromSlash(`/layouts/home.html:2:3`)) b.Assert(err.Error(), qt.Contains, `can't evaluate field ThisDoesNotExist`) } diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go index b32d6b2d8..d4456aebb 100644 --- a/hugolib/hugo_sites_build_test.go +++ b/hugolib/hugo_sites_build_test.go @@ -33,7 +33,7 @@ title: doc1 en title: doc1 fr slug: doc1-fr --- --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Title }}|{{ .Lang }}|{{ .RelPermalink }}| ` diff --git a/hugolib/hugo_sites_multihost_test.go b/hugolib/hugo_sites_multihost_test.go index 738aa4b34..e090e03cc 100644 --- a/hugolib/hugo_sites_multihost_test.go +++ b/hugolib/hugo_sites_multihost_test.go @@ -54,9 +54,9 @@ title: "My Bundle en" My Bundle -- content/mysect/mybundle/foo.txt -- Foo --- layouts/_default/list.html -- +-- layouts/list.html -- List|{{ .Title }}|{{ .Lang }}|{{ .Permalink}}|{{ .RelPermalink }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Single|{{ .Title }}|{{ .Lang }}|{{ .Permalink}}|{{ .RelPermalink }}| {{ $foo := .Resources.Get "foo.txt" | fingerprint }} Foo: {{ $foo.Permalink }}| @@ -147,7 +147,7 @@ title: "Mybundle fr" .body { color: french; } --- layouts/_default/single.html -- +-- layouts/single.html -- {{ $data := .Resources.GetMatch "styles*" | minify }} {{ .Lang }}: {{ $data.Content}}|{{ $data.RelPermalink }}| @@ -191,7 +191,7 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAA --- title: mybundle-en --- --- layouts/_default/single.html -- +-- layouts/single.html -- {{ with .Resources.Get "pixel.png" }} {{ with .Resize "2x2" }} {{ .RelPermalink }}| @@ -240,7 +240,7 @@ File 1 fr. File 1 en. -- content/en/section/mybundle/file2.txt -- File 2 en. --- layouts/_default/single.html -- +-- layouts/single.html -- {{ $files := .Resources.Match "file*" }} Files: {{ range $files }}{{ .Permalink }}|{{ end }}$ @@ -274,7 +274,7 @@ baseURL = "https://example.fr" weight = 2 -- assets/css/main.css -- body { color: red; } --- layouts/index.html -- +-- layouts/home.html -- {{ $css := resources.Get "css/main.css" | minify }} CSS: {{ $css.Permalink }}|{{ $css.RelPermalink }}| ` diff --git a/hugolib/hugo_sites_test.go b/hugolib/hugo_sites_test.go index 6b076ee71..4bdcfa7ee 100644 --- a/hugolib/hugo_sites_test.go +++ b/hugolib/hugo_sites_test.go @@ -27,7 +27,7 @@ weight = 1 weight = 2 [languages.de] weight = 3 --- layouts/index.html -- +-- layouts/home.html -- {{ $bundle := site.GetPage "bundle" }} Bundle all translations: {{ range $bundle.AllTranslations }}{{ .Lang }}|{{ end }}$ Bundle translations: {{ range $bundle.Translations }}{{ .Lang }}|{{ end }}$ diff --git a/hugolib/hugo_smoke_test.go b/hugolib/hugo_smoke_test.go index f8ae8a80a..923827d2d 100644 --- a/hugolib/hugo_smoke_test.go +++ b/hugolib/hugo_smoke_test.go @@ -34,7 +34,7 @@ disableKinds = ["term", "taxonomy", "section", "page"] --- title: Page --- --- layouts/index.html -- +-- layouts/home.html -- Home: {{ .Title }} ` @@ -135,9 +135,9 @@ Rotate(language): {{ range .Rotate "language" }}{{ .Lang }}|{{ .Title }}|{{ end mytext.txt: {{ with .Resources.GetMatch "**.txt" }}{{ .Content }}|{{ .RelPermalink }}{{ end }}| mypage.md: {{ with .Resources.GetMatch "**.md" }}{{ .Content }}|{{ .RelPermalink }}{{ end }}| RenderString with shortcode: {{ .RenderString "{{< myshortcode >}}" }}| --- layouts/shortcodes/myshortcode.html -- +-- layouts/_shortcodes/myshortcode.html -- myshortcode.html --- layouts/shortcodes/myshortcode.en.html -- +-- layouts/_shortcodes/myshortcode.en.html -- myshortcode.en.html ` @@ -322,11 +322,11 @@ title: Page --- Page. --- layouts/_default/list.html -- +-- layouts/list.html -- List: {{ .Title }}|{{ .RelPermalink}}|{{ range .OutputFormats }}{{ .Name }}: {{ .RelPermalink }}|{{ end }}$ --- layouts/_default/list.xml -- +-- layouts/list.xml -- List xml: {{ .Title }}|{{ .RelPermalink}}|{{ range .OutputFormats }}{{ .Name }}: {{ .RelPermalink }}|{{ end }}$ --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Title }}|{{ .RelPermalink}}|{{ range .OutputFormats }}{{ .Name }}: {{ .RelPermalink }}|{{ end }}$ ` @@ -387,7 +387,7 @@ hugo = "Rules!" [outputs] home = ["html", "json", "rss"] --- layouts/index.html -- +-- layouts/home.html -- Home: {{ .Lang}}|{{ .Kind }}|{{ .RelPermalink }}|{{ .Title }}|{{ .Content }}|Len Resources: {{ len .Resources }}|HTML Resources: {{ range .Resources }}{{ .ResourceType }}|{{ .RelPermalink }}|{{ .MediaType }} - {{ end }}| Site last mod: {{ site.Lastmod.Format "2006-02-01" }}| @@ -403,7 +403,7 @@ RenderString with shortcode: {{ .RenderString "{{% hello %}}" }}| Paginate: {{ .Paginator.PageNumber }}/{{ .Paginator.TotalPages }}| -- layouts/index.json -- Home:{{ .Lang}}|{{ .Kind }}|{{ .RelPermalink }}|{{ .Title }}|{{ .Content }}|Len Resources: {{ len .Resources }}|JSON --- layouts/_default/list.html -- +-- layouts/list.html -- List: {{ .Lang}}|{{ .Kind }}|{{ .RelPermalink }}|{{ .Title }}|{{ .Content }}|Len Resources: {{ len .Resources }}| Resources: {{ range .Resources }}{{ .ResourceType }}|{{ .RelPermalink }}|{{ .MediaType }} - {{ end }} Pages Length: {{ len .Pages }} @@ -414,7 +414,7 @@ Background: {{ .Params.background }}| Kind: {{ .Kind }} Type: {{ .Type }} Paginate: {{ .Paginator.PageNumber }}/{{ .Paginator.TotalPages }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Lang}}|{{ .Kind }}|{{ .RelPermalink }}|{{ .Title }}|{{ .Content }}|Len Resources: {{ len .Resources }}|Background: {{ .Params.background }}| Resources: {{ range .Resources }}{{ .ResourceType }}|{{ .RelPermalink }}|{{ .MediaType }}|{{ .Params }} - {{ end }} {{ $textResource := .Resources.GetMatch "**.txt" }} @@ -426,7 +426,7 @@ Icon fingerprinted: {{ with $textResourceFingerprinted }}{{ .Params.icon }}|{{ . NextInSection: {{ with .NextInSection }}{{ .RelPermalink }}|{{ .Title }}{{ end }}| PrevInSection: {{ with .PrevInSection }}{{ .RelPermalink }}|{{ .Title }}{{ end }}| GetTerms: {{ range .GetTerms "tags" }}name: {{ .Name }}, title: {{ .Title }}|{{ end }} --- layouts/shortcodes/hello.html -- +-- layouts/_shortcodes/hello.html -- Hello. -- content/_index.md -- --- @@ -630,7 +630,7 @@ target = "content" lang = "nn" [[module.imports]] path = "mytheme" --- layouts/index.html -- +-- layouts/home.html -- i18n s1: {{ i18n "s1" }}| i18n s2: {{ i18n "s2" }}| data s1: {{ site.Data.d1.s1 }}| @@ -716,9 +716,9 @@ mediaType = "text/csv" isPlainText = true isHTML = false --- layouts/_default/single.html -- +-- layouts/single.html -- HTML Single: {{ .Data.Pages }} --- layouts/_default/list.html -- +-- layouts/list.html -- HTML List: {{ .Data.Pages }} -- content/_index.md -- --- @@ -820,13 +820,13 @@ weight = 3 [languages.sv] title = "Svenska" weight = 4 --- layouts/_default/list.html -- +-- layouts/list.html -- {{ .Title }} {{ .Content }} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }} {{ .Content }} --- layouts/shortcodes/myshort.html -- +-- layouts/_shortcodes/myshort.html -- {{ .Inner }} ` diff --git a/hugolib/hugolib_integration_test.go b/hugolib/hugolib_integration_test.go index 250c7bcec..0293e34d1 100644 --- a/hugolib/hugolib_integration_test.go +++ b/hugolib/hugolib_integration_test.go @@ -52,9 +52,9 @@ tags: ['T1'] title: P1 tags: ['T1'] --- --- layouts/_default/single.html -- +-- layouts/single.html --{{- .RenderString "foo" -}}
{{- end -}} {{- range .Site.Home.AllTranslations -}}{{- .RenderString "bar" -}}
{{- end -}} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Content }} -- layouts/index.json -- {"Title": "My Site"} @@ -921,7 +921,7 @@ defaultContentLanguage = "en"P1 Content.
\n") b.AssertFileContent("public/p1/index.json", "Single JSON: P1|P1 Content.
\n") - b.EditFileReplaceAll("layouts/_default/single.html", "Single HTML", "Single HTML Edited").Build() + b.EditFileReplaceAll("layouts/single.html", "Single HTML", "Single HTML Edited").Build() b.AssertFileContent("public/p1/index.html", "Single HTML Edited: P1|P1 Content.
\n") b.AssertRenderCountPage(1) // Edit shortcode. Note that this is reused across all output formats. - b.EditFileReplaceAll("layouts/shortcodes/myshort.html", "My short", "My short edited").Build() + b.EditFileReplaceAll("layouts/_shortcodes/myshort.html", "My short", "My short edited").Build() b.AssertFileContent("public/p1/index.html", "My short edited") b.AssertFileContent("public/p1/index.json", "My short edited") b.AssertRenderCountPage(3) // rss (uses .Content) + 2 single pages. @@ -489,17 +489,17 @@ title = "Hugo Site" baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- Baseof: {{ .Title }}| {{ block "main" . }}default{{ end }} --- layouts/index.html -- +-- layouts/home.html -- {{ define "main" }} Home: {{ .Title }}|{{ .Content }}| {{ end }} ` testRebuildBothWatchingAndRunning(t, files, func(b *IntegrationTestBuilder) { b.AssertFileContent("public/index.html", "Baseof: Hugo Site|", "Home: Hugo Site||") - b.EditFileReplaceFunc("layouts/_default/baseof.html", func(s string) string { + b.EditFileReplaceFunc("layouts/baseof.html", func(s string) string { return strings.Replace(s, "Baseof", "Baseof Edited", 1) }).Build() b.AssertFileContent("public/index.html", "Baseof Edited: Hugo Site|", "Home: Hugo Site||") @@ -520,7 +520,7 @@ disableLiveReload = true title: "P1" --- P1 Content. --- layouts/index.html -- +-- layouts/home.html -- Home. -- layouts/single.html -- Single: {{ .Title }}|{{ .Content }}| @@ -557,22 +557,22 @@ title: "P1" --- P1 Content. [foo](/foo) --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- Baseof: {{ .Title }}| {{ block "main" . }}default{{ end }} {{ with (templates.Defer (dict "foo" "bar")) }} Defer. {{ end }} --- layouts/index.html -- +-- layouts/home.html -- Home. --- layouts/_default/single.html -- +-- layouts/single.html -- {{ define "main" }} Single: {{ .Title }}|{{ .Content }}| {{ end }} ` b := Test(t, files, TestOptRunning()) b.AssertFileContent("public/p1/index.html", "Single: P1|") - b.EditFileReplaceFunc("layouts/_default/single.html", func(s string) string { + b.EditFileReplaceFunc("layouts/single.html", func(s string) string { return strings.Replace(s, "Single", "Single Edited", 1) }).Build() b.AssertFileContent("public/p1/index.html", "Single Edited") @@ -593,15 +593,15 @@ title: "P1" --- P1 Content. [foo](/foo) --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- Baseof: {{ .Title }}| {{ block "main" . }}default{{ end }} {{ with (templates.Defer (dict "foo" "bar")) }} Defer. {{ end }} --- layouts/index.html -- +-- layouts/home.html -- Home. --- layouts/_default/single.html -- +-- layouts/single.html -- {{ define "main" }} Single: {{ .Title }}|{{ .Content }}| {{ end }} @@ -609,7 +609,7 @@ Single: {{ .Title }}|{{ .Content }}| b := Test(t, files, TestOptRunning()) b.AssertFileContent("public/p1/index.html", "Single: P1|") fmt.Println("===============") - b.EditFileReplaceAll("layouts/_default/baseof.html", "Baseof", "Baseof Edited").Build() + b.EditFileReplaceAll("layouts/baseof.html", "Baseof", "Baseof Edited").Build() b.AssertFileContent("public/p1/index.html", "Baseof Edited") } @@ -628,7 +628,7 @@ title: "P1" --- P1 Content. [foo](/foo) --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- Baseof: {{ .Title }}| {{ block "main" . }}default{{ end }} {{ with (templates.Defer (dict "foo" "bar")) }} @@ -638,12 +638,12 @@ Defer. {{ define "main" }} Single: {{ .Title }}|{{ .Content }}| {{ end }} --- layouts/_default/_markup/render-link.html -- +-- layouts/_markup/render-link.html -- Render Link. ` b := Test(t, files, TestOptRunning()) // Edit render hook. - b.EditFileReplaceAll("layouts/_default/_markup/render-link.html", "Render Link", "Render Link Edited").Build() + b.EditFileReplaceAll("layouts/_markup/render-link.html", "Render Link", "Render Link Edited").Build() b.AssertFileContent("public/p1/index.html", "Render Link Edited") } @@ -668,12 +668,12 @@ layout: "l2" P2 Content. -- assets/mytext.txt -- My Text --- layouts/_default/l1.html -- +-- layouts/l1.html -- {{ $r := partial "get-resource.html" . }} L1: {{ .Title }}|{{ .Content }}|R: {{ $r.Content }}| --- layouts/_default/l2.html -- +-- layouts/l2.html -- L2. --- layouts/partials/get-resource.html -- +-- layouts/_partials/get-resource.html -- {{ $mytext := resources.Get "mytext.txt" }} {{ $txt := printf "Text: %s" $mytext.Content }} {{ $r := resources.FromString "r.txt" $txt }} @@ -727,11 +727,11 @@ title: "P6" --- title: "P7" --- --- layouts/_default/list.html -- +-- layouts/list.html -- List. --- layouts/_default/single.html -- +-- layouts/single.html -- Single. --- layouts/_default/single.html -- +-- layouts/single.html -- Next: {{ with .PrevInSection }}{{ .Title }}{{ end }}| Prev: {{ with .NextInSection }}{{ .Title }}{{ end }}| @@ -919,19 +919,19 @@ P7 EN Content. title: "P7 NN" --- P7 NN Content. --- layouts/index.html -- +-- layouts/home.html -- Home: {{ .Title }}|{{ .Content }}| RegularPages: {{ range .RegularPages }}{{ .RelPermalink }}|{{ end }}$ Len RegularPagesRecursive: {{ len .RegularPagesRecursive }} Site.Lastmod: {{ .Site.Lastmod.Format "2006-01-02" }}| Paginate: {{ range (.Paginate .Site.RegularPages).Pages }}{{ .RelPermalink }}|{{ .Title }}|{{ end }}$ --- layouts/_default/single.html -- +-- layouts/single.html -- Single: .Site: {{ .Site }} Single: {{ .Title }}|{{ .Content }}| Single Partial Cached: {{ partialCached "pcached" . }}| Page.Lastmod: {{ .Lastmod.Format "2006-01-02" }}| Cascade param: {{ .Params.cascadeparam }}| --- layouts/_default/list.html -- +-- layouts/list.html -- List: {{ .Title }}|{{ .Content }}| RegularPages: {{ range .RegularPages }}{{ .Title }}|{{ end }}$ Len RegularPagesRecursive: {{ len .RegularPagesRecursive }} @@ -939,11 +939,11 @@ RegularPagesRecursive: {{ range .RegularPagesRecursive }}{{ .RelPermalink }}|{{ List Partial P1: {{ partial "p1" . }}| Page.Lastmod: {{ .Lastmod.Format "2006-01-02" }}| Cascade param: {{ .Params.cascadeparam }}| --- layouts/partials/p1.html -- +-- layouts/_partials/p1.html -- Partial P1. --- layouts/partials/pcached.html -- +-- layouts/_partials/pcached.html -- Partial Pcached. --- layouts/shortcodes/include.html -- +-- layouts/_shortcodes/include.html -- {{ $p := site.GetPage (.Get 0)}} .Page.Site: {{ .Page.Site }} :: site: {{ site }} {{ with $p }} @@ -951,7 +951,7 @@ Shortcode Include: {{ .Title }}| {{ end }} Shortcode .Page.Title: {{ .Page.Title }}| Shortcode Partial P1: {{ partial "p1" . }}| --- layouts/_default/_markup/render-codeblock.html -- +-- layouts/_markup/render-codeblock.html -- {{ $p := site.GetPage (.Attributes.page)}} {{ with $p }} Codeblock Include: {{ .Title }}| @@ -1046,26 +1046,26 @@ Codeblock Include: {{ .Title }}| b.AssertFileContent("public/en/translations/index.html", "RegularPagesRecursive: /en/translations/p7/") // Edit shortcode - editFile("layouts/shortcodes/include.html", func(s string) string { + editFile("layouts/_shortcodes/include.html", func(s string) string { return s + "\nShortcode Include Edited." }) b.AssertFileContent("public/mysect/p1/index.html", "Shortcode Include Edited.") // Edit render hook - editFile("layouts/_default/_markup/render-codeblock.html", func(s string) string { + editFile("layouts/_markup/render-codeblock.html", func(s string) string { return s + "\nCodeblock Include Edited." }) b.AssertFileContent("public/mysect/p1/index.html", "Codeblock Include Edited.") // Edit partial p1 - editFile("layouts/partials/p1.html", func(s string) string { + editFile("layouts/_partials/p1.html", func(s string) string { return strings.Replace(s, "Partial P1", "Partial P1 Edited", 1) }) b.AssertFileContent("public/mysect/index.html", "List Partial P1: Partial P1 Edited.") b.AssertFileContent("public/mysect/p1/index.html", "Shortcode Partial P1: Partial P1 Edited.") // Edit partial cached. - editFile("layouts/partials/pcached.html", func(s string) string { + editFile("layouts/_partials/pcached.html", func(s string) string { return strings.Replace(s, "Partial Pcached", "Partial Pcached Edited", 1) }) b.AssertFileContent("public/mysect/p1/index.html", "Pcached Edited.") @@ -1142,7 +1142,7 @@ body { } -- layouts/default/list.html -- List. --- layouts/_default/single.html -- +-- layouts/single.html -- Single. {{ $css := resources.Get "main.css" | minify }} RelPermalink: {{ $css.RelPermalink }}| @@ -1192,13 +1192,13 @@ title: "P4" P4. -- assets/js/main.js -- console.log("Hello"); --- layouts/_default/list.html -- +-- layouts/list.html -- List. {{ partial "head.html" . }}$ --- layouts/_default/single.html -- +-- layouts/single.html -- Single. {{ partial "head.html" . }}$ --- layouts/partials/head.html -- +-- layouts/_partials/head.html -- {{ partialCached "js.html" . }}$ --- layouts/partials/js.html -- +-- layouts/_partials/js.html -- {{ $js := resources.Get "js/main.js" | js.Build | fingerprint }} RelPermalink: {{ $js.RelPermalink }}| ` @@ -1227,14 +1227,14 @@ disableKinds = ["term", "taxonomy", "sitemap", "robotsTXT", "404", "rss"] disableLiveReload = true -- assets/js/main.js -- console.log("Hello"); --- layouts/_default/baseof.html -- +-- layouts/baseof.html -- Base. {{ partial "common/head.html" . }}$ {{ block "main" . }}default{{ end }} --- layouts/_default/list.html -- +-- layouts/list.html -- {{ define "main" }}main{{ end }} --- layouts/partials/common/head.html -- +-- layouts/_partials/common/head.html -- {{ partial "myfiles/js.html" . }}$ --- layouts/partials/myfiles/js.html -- +-- layouts/_partials/myfiles/js.html -- {{ $js := resources.Get "js/main.js" | js.Build | fingerprint }} RelPermalink: {{ $js.RelPermalink }}| ` @@ -1280,24 +1280,24 @@ layout: "plain" console.log("Hello"); -- content/foo.js -- console.log("Foo"); --- layouts/index.html -- +-- layouts/home.html -- Home. {{ $js := site.Home.Resources.Get "main.js" }} {{ with $js }} {{ end }} --- layouts/_default/single.html -- +-- layouts/single.html -- Single. Deliberately no .Content in here. --- layouts/_default/plain.html -- +-- layouts/plain.html -- Content: {{ .Content }}| --- layouts/_default/main.html -- +-- layouts/main.html -- {{ $js := site.Home.Resources.Get "main.js" }} {{ with $js }} {{ end }} --- layouts/shortcodes/jsfingerprinted.html -- +-- layouts/_shortcodes/jsfingerprinted.html -- {{ $js := site.Home.Resources.Get "foo.js" | fingerprint }} ` @@ -1368,13 +1368,13 @@ title: "P1" --- Foo inline: {{< foo.inline >}}{{ site.Data.mydata.foo }}|{{< /foo.inline >}} --- layouts/shortcodes/data.html -- +-- layouts/_shortcodes/data.html -- {{ $path := split (.Get 0) "." }} {{ $data := index site.Data $path }} Foo: {{ $data }}| --- layouts/index.html -- +-- layouts/home.html -- Content: {{ .Content }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Content }}| ` b := TestRunning(t, files) @@ -1400,7 +1400,7 @@ disableLiveReload = true title: "Home" --- Home. --- layouts/index.html -- +-- layouts/home.html -- Content: {{ .Content }} ` b := TestRunning(t, files) @@ -1436,9 +1436,9 @@ disableKinds = ["taxonomy", "term", "sitemap", "robotsTXT", "404"] title: "Home" --- Home. --- layouts/index.html -- +-- layouts/home.html -- Home. --- layouts/_default/index.searchindex.txt -- +-- layouts/index.searchindex.txt -- Text. {{ .Title }}|{{ .RelPermalink }}| ` @@ -1446,7 +1446,7 @@ Text. {{ .Title }}|{{ .RelPermalink }}| b.AssertFileContent("public/search.txt", "Text.") - b.EditFileReplaceAll("layouts/_default/index.searchindex.txt", "Text.", "Text Edited.").Build() + b.EditFileReplaceAll("layouts/index.searchindex.txt", "Text.", "Text Edited.").Build() b.BuildPartial("/docs/search.txt") @@ -1460,7 +1460,7 @@ func TestRebuildVariationsAssetsJSImport(t *testing.T) { baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true --- layouts/index.html -- +-- layouts/home.html -- Home. {{ now }} {{ with (resources.Get "js/main.js" | js.Build | fingerprint) }} @@ -1529,28 +1529,28 @@ title: "P3" layout: "foo" --- {{< notfingerprinted >}} --- layouts/shortcodes/fingerprinted.html -- +-- layouts/_shortcodes/fingerprinted.html -- Fingerprinted. {{ $opts := dict "inlineImports" true "noMap" true }} {{ with (resources.Get "css/main.css" | postCSS $opts | fingerprint) }} {{ end }} --- layouts/shortcodes/notfingerprinted.html -- +-- layouts/_shortcodes/notfingerprinted.html -- Fingerprinted. {{ $opts := dict "inlineImports" true "noMap" true }} {{ with (resources.Get "css/main.css" | postCSS $opts) }} {{ end }} --- layouts/index.html -- +-- layouts/home.html -- Home. {{ $opts := dict "inlineImports" true "noMap" true }} {{ with (resources.Get "css/main.css" | postCSS $opts) }} {{ end }} --- layouts/_default/foo.html -- +-- layouts/foo.html -- Foo. {{ .Title }}|{{ .Content }}| --- layouts/_default/single.html -- +-- layouts/single.html -- Single. {{ $opts := dict "inlineImports" true "noMap" true }} {{ with (resources.Get "css/main.css" | postCSS $opts) }} @@ -1592,7 +1592,7 @@ baseURL = "https://example.com" disableLiveReload = true -- i18n/en.toml -- hello = "Hello" --- layouts/index.html -- +-- layouts/home.html -- Hello: {{ i18n "hello" }} ` @@ -1643,7 +1643,7 @@ title: "B nn" B nn. -- content/p1/f1.nn.txt -- F1 nn --- layouts/_default/all.html -- +-- layouts/all.html -- All: {{ .Title }}|{{ .Kind }}|{{ .Content }}|Bundled File: {{ with .Resources.GetMatch "f1.*" }}{{ .Content }}{{ end }}|Bundled Page: {{ with .Resources.GetMatch "b.*" }}{{ .Content }}{{ end }}| ` @@ -1683,7 +1683,7 @@ title: "P1 en" title: "P1 nn" --- P1 nn. --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Title }}|{{ .Content }}| ` @@ -1710,7 +1710,7 @@ body { } -- assets/css/main.scss -- @import "lib/foo"; --- layouts/index.html -- +-- layouts/home.html -- Home. {{ $opts := dict "transpiler" "TRANSPILER" }} {{ with (resources.Get "css/main.scss" | toCSS $opts) }} @@ -1756,9 +1756,9 @@ func benchmarkFilesEdit(count int) string { baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Title }}|{{ .Content }}| --- layouts/_default/list.html -- +-- layouts/list.html -- List: {{ .Title }}|{{ .Content }}| -- content/mysect/_index.md -- --- @@ -1815,7 +1815,7 @@ c c1 -- assets/common/c2.css -- c2 --- layouts/index.html -- +-- layouts/home.html -- {{ $a := resources.Get "a.css" }} {{ $b := resources.Get "b.css" }} {{ $common := resources.Match "common/*.css" | resources.Concat "common.css" | minify }} @@ -1856,9 +1856,9 @@ func TestRebuildEditMixedCaseTemplateFileIssue12165(t *testing.T) { -- hugo.toml -- baseURL = "https://example.com" disableLiveReload = true --- layouts/partials/MyTemplate.html -- +-- layouts/_partials/MyTemplate.html -- MyTemplate --- layouts/index.html -- +-- layouts/home.html -- MyTemplate: {{ partial "MyTemplate.html" . }}| @@ -1868,7 +1868,7 @@ MyTemplate: {{ partial "MyTemplate.html" . }}| b.AssertFileContent("public/index.html", "MyTemplate: MyTemplate") - b.EditFileReplaceAll("layouts/partials/MyTemplate.html", "MyTemplate", "MyTemplate Edited").Build() + b.EditFileReplaceAll("layouts/_partials/MyTemplate.html", "MyTemplate", "MyTemplate Edited").Build() b.AssertFileContent("public/index.html", "MyTemplate: MyTemplate Edited") } @@ -1949,7 +1949,7 @@ P1 Content. title: "P2" --- P2 Content. --- layouts/_default/single.html -- +-- layouts/single.html -- Single: {{ .Title }}|{{ .Content }}| ` b := TestRunning(t, files) @@ -1972,9 +1972,9 @@ func TestRebuildEditSingleListChangeUbuntuIssue12362(t *testing.T) { -- hugo.toml -- disableKinds = ['rss','section','sitemap','taxonomy','term'] disableLiveReload = true --- layouts/_default/list.html -- +-- layouts/list.html -- {{ range .Pages }}{{ .Title }}|{{ end }} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Title }} -- content/p1.md -- --- @@ -1997,9 +1997,9 @@ func TestRebuildHomeThenPageIssue12436(t *testing.T) { baseURL = "https://example.com" disableKinds = ['sitemap','taxonomy','term'] disableLiveReload = true --- layouts/_default/list.html -- +-- layouts/list.html -- {{ .Content }} --- layouts/_default/single.html -- +-- layouts/single.html -- {{ .Content }} -- content/_index.md -- --- diff --git a/hugolib/rendershortcodes_test.go b/hugolib/rendershortcodes_test.go index d8b51d3ed..a961680a9 100644 --- a/hugolib/rendershortcodes_test.go +++ b/hugolib/rendershortcodes_test.go @@ -50,16 +50,16 @@ title: "p3" ### p3-h2 {{% withmarkdown %}} {{< level3 >}} --- layouts/shortcodes/include.html -- +-- layouts/_shortcodes/include.html -- {{ $p := site.GetPage (.Get 0) }} {{ $p.RenderShortcodes }} --- layouts/shortcodes/withhtml.html -- +-- layouts/_shortcodes/withhtml.html --{{ .Inner | safeHTML }}
`
@@ -467,10 +467,10 @@ title: "p2"
### p2-h1
This is some **markup**.
--- layouts/shortcodes/include.html --
+-- layouts/_shortcodes/include.html --
{{ $p := site.GetPage (.Get 0) -}}
{{ $p.RenderShortcodes -}}
--- layouts/_default/single.html --
+-- layouts/single.html --
{{ .Content }}
`
b := TestRunning(t, files)
@@ -488,11 +488,11 @@ func TestRenderShortcodesEmptyParagraph(t *testing.T) {
files := `
-- hugo.toml --
disableKinds = ['section','rss','sitemap','taxonomy','term']
--- layouts/_default/home.html --
+-- layouts/home.html --
{{ .Content }}
--- layouts/_default/single.html --
+-- layouts/single.html --
{{ .Content }}
--- layouts/shortcodes/include.html --
+-- layouts/_shortcodes/include.html --
{{ with site.GetPage (.Get 0) }}
{{ .RenderShortcodes }}
{{ end }}
diff --git a/hugolib/renderstring_test.go b/hugolib/renderstring_test.go
index e72ced2f9..80dd5d842 100644
--- a/hugolib/renderstring_test.go
+++ b/hugolib/renderstring_test.go
@@ -25,7 +25,7 @@ func TestRenderString(t *testing.T) {
files := `
-- hugo.toml --
baseURL = "http://example.com/"
--- layouts/index.html --
+-- layouts/home.html --
{{ $p := site.GetPage "p1.md" }}
{{ $optBlock := dict "display" "block" }}
{{ $optOrg := dict "markup" "org" }}
@@ -33,7 +33,7 @@ RSTART:{{ "**Bold Markdown**" | $p.RenderString }}:REND
RSTART:{{ "**Bold Block Markdown**" | $p.RenderString $optBlock }}:REND
RSTART:{{ "/italic org mode/" | $p.RenderString $optOrg }}:REND
RSTART:{{ "## Header2" | $p.RenderString }}:REND
--- layouts/_default/_markup/render-heading.html --
+-- layouts/_markup/render-heading.html --
Hook Heading: {{ .Level }}
-- content/p1.md --
---
@@ -57,11 +57,11 @@ func TestRenderStringOnListPage(t *testing.T) {
files := `
-- hugo.toml --
baseURL = "http://example.com/"
--- layouts/index.html --
+-- layouts/home.html --
{{ .RenderString "**Hello**" }}
--- layouts/_default/list.html --
+-- layouts/list.html --
{{ .RenderString "**Hello**" }}
--- layouts/_default/single.html --
+-- layouts/single.html --
{{ .RenderString "**Hello**" }}
-- content/mysection/p1.md --
FOO
@@ -86,7 +86,7 @@ func TestRenderStringOnPageNotBackedByAFile(t *testing.T) {
files := `
-- hugo.toml --
disableKinds = ["page", "section", "taxonomy", "term"]
--- layouts/index.html --
+-- layouts/home.html --
{{ .RenderString "**Hello**" }}
-- content/p1.md --
`
@@ -106,18 +106,18 @@ enableInlineShortcodes = true
title: "P1"
---
## First
--- layouts/shortcodes/mark1.md --
+-- layouts/_shortcodes/mark1.md --
{{ .Inner }}
--- layouts/shortcodes/mark2.md --
+-- layouts/_shortcodes/mark2.md --
1. Item Mark2 1
1. Item Mark2 2
1. Item Mark2 2-1
1. Item Mark2 3
--- layouts/shortcodes/myhthml.html --
+-- layouts/_shortcodes/myhthml.html --
Title: {{ .Page.Title }}
TableOfContents: {{ .Page.TableOfContents }}
Page Type: {{ printf "%T" .Page }}
--- layouts/_default/single.html --
+-- layouts/single.html --
{{ .RenderString "Markdown: {{% mark2 %}}|HTML: {{< myhthml >}}|Inline: {{< foo.inline >}}{{ site.Title }}{{< /foo.inline >}}|" }}
HasShortcode: mark2:{{ .HasShortcode "mark2" }}:true
HasShortcode: foo:{{ .HasShortcode "foo" }}:false
@@ -153,7 +153,7 @@ Page Type: *hugolib.pageForShortcode`,
},
).Build()
- b.EditFiles("layouts/shortcodes/myhthml.html", "Edit shortcode").Build()
+ b.EditFiles("layouts/_shortcodes/myhthml.html", "Edit shortcode").Build()
b.AssertFileContent("public/p1/index.html",
`Edit shortcode`,
@@ -167,9 +167,9 @@ func TestRenderStringWithShortcodeInPageWithNoContentFile(t *testing.T) {
files := `
-- config.toml --
--- layouts/shortcodes/myshort.html --
+-- layouts/_shortcodes/myshort.html --
Page Kind: {{ .Page.Kind }}
--- layouts/index.html --
+-- layouts/home.html --
Short: {{ .RenderString "{{< myshort >}}" }}
Has myshort: {{ .HasShortcode "myshort" }}
Has other: {{ .HasShortcode "other" }}
@@ -204,11 +204,11 @@ title: "P1"
{{ not a shortcode
{{< /noop >}}
}
--- layouts/shortcodes/noop.html --
+-- layouts/_shortcodes/noop.html --
{{ .Inner | $.Page.RenderString }}
--- layouts/shortcodes/toc.html --
+-- layouts/_shortcodes/toc.html --
{{ .Page.TableOfContents }}
--- layouts/_default/single.html --
+-- layouts/single.html --
{{ .Content }}
`
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index 382de4605..978fa3713 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -47,7 +47,7 @@ func TestResourceChainBasic(t *testing.T) {
baseURL = "http://example.com/"
-- assets/images/sunset.jpg --
` + getTestSunset(t) + `
--- layouts/index.html --
+-- layouts/home.html --
{{ $hello := "