From e9edbba217d944ef4389fc45c0e7b82dfc8d4845 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Tue, 1 Oct 2024 19:50:42 +0800 Subject: [PATCH] :sparkles: Feat: add params.sourceURL and params.editURL for special pages --- layouts/partials/init/index.html | 2 +- layouts/partials/single/footer.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index e56ef44d..e2caa220 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.13-b44555d4" -}} +{{- .Scratch.Set "version" "v0.3.13-9e9bc9ef" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html index f39489ec..26cd97d8 100644 --- a/layouts/partials/single/footer.html +++ b/layouts/partials/single/footer.html @@ -54,13 +54,14 @@ {{- end -}} {{- if $params.LinkToSource | and $gitRepo -}} {{- $link := replace $blobURL "{path}" $.File.Path -}} - {{- $sourceURL = add $link "?plain=1" -}} + {{- $sourceURL = $params.sourceURL | default (add $link "?plain=1") -}} {{- $options := dict "Class" "link-to-source" "Destination" $sourceURL "Title" (T "single.viewSource") "Content" (T "single.viewSource") "externalIcon" false -}} {{- $linkOptions = $linkOptions | append $options -}} {{- end -}} {{- if $params.LinkToEdit | and $gitRepo -}} {{- $link := replace $editURL "{path}" $.File.Path -}} - {{- $options := dict "Class" "link-to-edit" "Destination" $link "Title" (T "single.editThisPage") "Content" (T "single.editThisPage") "externalIcon" false -}} + {{- $editURL = $params.editURL | default $link -}} + {{- $options := dict "Class" "link-to-edit" "Destination" $editURL "Title" (T "single.editThisPage") "Content" (T "single.editThisPage") "externalIcon" false -}} {{- $linkOptions = $linkOptions | append $options -}} {{- end -}} {{- if $params.LinkToReport | and $gitRepo -}}