Replace deprecated Page.Dir with Page.File.Dir

Page.Dir has been deprecated for a while, and was finally removed in hugo v0.93.0.

This commit replaces instances of Page.Dir with Page.File.Dir.
This commit is contained in:
Andrew Morgan 2022-03-08 14:02:21 +00:00
parent 3747d8b8e2
commit cd0d6116b6
2 changed files with 3 additions and 3 deletions

View file

@ -9,5 +9,5 @@
{{ $name := .Params.name }}
{{ $page := .Site.GetPage (path.Join .Page.Dir "modules" (printf "%s%s" $name ".md"))}}
{{ $page.Content }}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "modules" (printf "%s%s" $name ".md"))}}
{{ $page.Content }}

View file

@ -17,7 +17,7 @@
{{ $name := .Params.name }}
{{ $withVersioning := .Params.withVersioning }}
{{ $page := .Site.GetPage (path.Join .Page.Dir "fragments" (printf "%s%s" $name ".md"))}}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "fragments" (printf "%s%s" $name ".md"))}}
{{ $content := $page.Content }}
{{ if not $withVersioning }}
{{ $content = (replace $content "[New in this version]" "") }}