From 5f2dbb76fada4d1e63f5f5dfaac2b86f7aab320d Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Mon, 4 Aug 2025 13:07:05 +0200 Subject: [PATCH] Make sure that edit and commit URls are clean --- layouts/_partials/docs/links/commit.html | 4 ++-- layouts/_partials/docs/links/edit.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_partials/docs/links/commit.html b/layouts/_partials/docs/links/commit.html index 48deeab..5d94b37 100644 --- a/layouts/_partials/docs/links/commit.html +++ b/layouts/_partials/docs/links/commit.html @@ -1,5 +1,5 @@ -{{- return partial "docs/text/template" (dict "Template" .Site.Params.BookLastChangeLink "Context" (dict +{{- return (partial "docs/text/template" (dict "Template" .Site.Params.BookLastChangeLink "Context" (dict "Site" .Site "Page" .Page "GitInfo" .GitInfo -)) -}} \ No newline at end of file +)) | path.Clean) -}} \ No newline at end of file diff --git a/layouts/_partials/docs/links/edit.html b/layouts/_partials/docs/links/edit.html index 103bc5b..cf81194 100644 --- a/layouts/_partials/docs/links/edit.html +++ b/layouts/_partials/docs/links/edit.html @@ -1,5 +1,5 @@ -{{- return partial "docs/text/template" (dict "Template" .Site.Params.BookEditLink "Context" (dict +{{- return (partial "docs/text/template" (dict "Template" .Site.Params.BookEditLink "Context" (dict "Site" .Site "Page" .Page "Path" (strings.TrimPrefix hugo.WorkingDir .Page.File.Filename) -)) -}} \ No newline at end of file +)) | path.Clean) -}} \ No newline at end of file