diff --git a/content/en/variables/page.md b/content/en/variables/page.md index c98e2586c..4ba4d3d91 100644 --- a/content/en/variables/page.md +++ b/content/en/variables/page.md @@ -204,7 +204,7 @@ aliased form `.Pages`. ### `.Pages` compared to `.Site.Pages` -{{< insertpages path="readfiles/pages-vs-site-pages.md" >}} +{{< getcontent path="readfiles/pages-vs-site-pages.md" >}} ## Page-level Params diff --git a/content/en/variables/site.md b/content/en/variables/site.md index 0bf54a7fa..03052d053 100644 --- a/content/en/variables/site.md +++ b/content/en/variables/site.md @@ -127,7 +127,7 @@ You can use `.Site.Params` in a [partial template](/templates/partials/) to call ### `.Site.Pages` compared to `.Pages` -{{< insertpages path="readfiles/pages-vs-site-pages.md" >}} +{{< getcontent path="readfiles/pages-vs-site-pages.md" >}} diff --git a/layouts/shortcodes/insertpages.html b/layouts/shortcodes/getcontent.html similarity index 66% rename from layouts/shortcodes/insertpages.html rename to layouts/shortcodes/getcontent.html index a7cfc83fd..61a84e431 100644 --- a/layouts/shortcodes/insertpages.html +++ b/layouts/shortcodes/getcontent.html @@ -1,18 +1,18 @@ {{- $path := .Get "path" -}} {{ $glob := .Get "glob" -}} {{ $scratch := newScratch -}} {{ with $glob -}} - {{ $bundle := site.GetPage (path.Join $path "index.md") -}} + {{ $bundle := site.GetPage $path -}} {{ $scratch.Set "pages" ($bundle.Resources.Match $glob) -}} {{ else -}} - {{ $bundle := site.GetPage (path.Join (path.Dir $path) "index.md") -}} + {{ $bundle := site.GetPage (path.Dir $path) -}} {{ $scratch.Set "pages" ($bundle.Resources.Match (path.Base $path)) -}} {{ end -}}