From 9b7319587bc4e95a0678b16be520cee04a14b731 Mon Sep 17 00:00:00 2001 From: limichange Date: Sat, 18 Sep 2021 14:15:41 +0800 Subject: [PATCH] fix: edit-page multi-language support --- layouts/partials/main/edit-page.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/layouts/partials/main/edit-page.html b/layouts/partials/main/edit-page.html index 77189ee..d685b2d 100644 --- a/layouts/partials/main/edit-page.html +++ b/layouts/partials/main/edit-page.html @@ -1 +1,16 @@ -

Edit this page on GitHub

+{{ $filePath := replace .File.Path "\\" "/" }} +{{ $contentPath := print .Site.Params.docsRepo "/blob/" .Site.Params.docsRepoBranch "/content/" }} +{{ $url := print $contentPath $filePath }} + +{{ if .Site.Params.options.multilingualMode }} + {{ $url = print $contentPath .Lang "/" $filePath }} +{{ end }} + +

+ + + + + Edit this page on GitHub + +