From 12f11d49195a9467065116230df8fba495a2ae84 Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Fri, 17 Jun 2022 21:24:10 +0800 Subject: [PATCH] Improve page-meta-links page This PR fixes a warning in the page-meta-links.html page where `.Path` is a function to be removed soon. Warning message: ``` WARN 2022/06/17 21:20:35 .Path when the page is backed by a file is deprecated and will be removed in a future release. We plan to use Path for a canonical source path and you probably want to check the source is a file. ``` --- layouts/partials/page-meta-links.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/partials/page-meta-links.html b/layouts/partials/page-meta-links.html index 83571db525..35d19ea73d 100644 --- a/layouts/partials/page-meta-links.html +++ b/layouts/partials/page-meta-links.html @@ -1,6 +1,7 @@ {{/* template adapted from Docsy theme */}} -{{ if .Path }} - {{ $pathFormatted := replace .Path "\\" "/" }} + +{{ if .File.Path }} + {{ $pathFormatted := replace .File.Path "\\" "/" }} {{ $gh_repo := ($.Param "github_repo") }} {{ $gh_subdir := ($.Param "github_subdir") }} {{ $gh_project_repo := ($.Param "github_project_repo") }}