From 3e84928d4fbf3d1fe9b80613c38f9bf380486d4c Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sun, 31 May 2026 17:15:26 +0900 Subject: [PATCH] appview/pages/templates: expose psermalinkShortcutScript params Signed-off-by: Seongmin Lee --- appview/pages/templates/repo/blob.html | 4 +++- .../pages/templates/repo/fragments/permalinkShortcut.html | 7 +++---- appview/pages/templates/repo/tree.html | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/appview/pages/templates/repo/blob.html b/appview/pages/templates/repo/blob.html index 14ced910..439c4f24 100644 --- a/appview/pages/templates/repo/blob.html +++ b/appview/pages/templates/repo/blob.html @@ -162,5 +162,7 @@ showWrapContentToggleOnOverflow(); })(); - {{ template "repo/fragments/permalinkShortcut" . }} + {{ if .LastCommitInfo }} + {{ template "repo/fragments/permalinkShortcutScript" (printf "/%s/tree/%s/%s" .RepoInfo.RepoIdentifier .LastCommitInfo.Hash .Path) }} + {{ end }} {{ end }} diff --git a/appview/pages/templates/repo/fragments/permalinkShortcut.html b/appview/pages/templates/repo/fragments/permalinkShortcut.html index a6e0bd6a..6267b033 100644 --- a/appview/pages/templates/repo/fragments/permalinkShortcut.html +++ b/appview/pages/templates/repo/fragments/permalinkShortcut.html @@ -1,13 +1,13 @@ -{{ define "repo/fragments/permalinkShortcut" }} +{{ define "repo/fragments/permalinkShortcutScript" }} + {{ $path := . }} {{ end }} diff --git a/appview/pages/templates/repo/tree.html b/appview/pages/templates/repo/tree.html index 75384c97..e7f3c51d 100644 --- a/appview/pages/templates/repo/tree.html +++ b/appview/pages/templates/repo/tree.html @@ -99,7 +99,9 @@ -{{ template "repo/fragments/permalinkShortcut" . }} +{{ if .LastCommitInfo }} + {{ template "repo/fragments/permalinkShortcutScript" (printf "/%s/tree/%s/%s" .RepoInfo.RepoIdentifier .LastCommitInfo.Hash .Path) }} +{{ end }} {{end}} {{ define "repoAfter" }} -- 2.51.2