Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages/templates: expose psermalinkShortcutScript params

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
committer
Tangled
date (Jun 11, 2026, 10:52 AM +0300) commit 3e84928d parent 16ad9473 change-id lwmoptrx
+9 -6
+3 -1
appview/pages/templates/repo/blob.html
··· 162 162 showWrapContentToggleOnOverflow(); 163 163 })(); 164 164 </script> 165 - {{ template "repo/fragments/permalinkShortcut" . }} 165 + {{ if .LastCommitInfo }} 166 + {{ template "repo/fragments/permalinkShortcutScript" (printf "/%s/tree/%s/%s" .RepoInfo.RepoIdentifier .LastCommitInfo.Hash .Path) }} 167 + {{ end }} 166 168 {{ end }}
+3 -4
appview/pages/templates/repo/fragments/permalinkShortcut.html
··· 1 - {{ define "repo/fragments/permalinkShortcut" }} 1 + {{ define "repo/fragments/permalinkShortcutScript" }} 2 + {{ $path := . }} 2 3 <script> 3 4 (() => { 4 - {{ if .LastCommitInfo }} 5 5 const abortController = new AbortController(); 6 6 const scriptEl = document.currentScript; 7 7 document.addEventListener('keydown', (e) => { 8 8 if(e.key === 'y' && !e.ctrlKey && !e.metaKey && !e.altKey) { 9 9 if(e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return; 10 - const permalinkUrl = '/{{ .RepoInfo.RepoIdentifier }}/tree/{{ .LastCommitInfo.Hash }}/{{ .Path }}' + window.location.hash; 10 + const permalinkUrl = '{{ $path }}' + window.location.hash; 11 11 window.location.href = permalinkUrl; 12 12 } 13 13 }, {signal: abortController.signal}); ··· 17 17 abortController.abort(); 18 18 } 19 19 }, {signal: abortController.signal}); 20 - {{ end }} 21 20 })(); 22 21 </script> 23 22 {{ end }}
+3 -1
appview/pages/templates/repo/tree.html
··· 99 99 100 100 </div> 101 101 </main> 102 - {{ template "repo/fragments/permalinkShortcut" . }} 102 + {{ if .LastCommitInfo }} 103 + {{ template "repo/fragments/permalinkShortcutScript" (printf "/%s/tree/%s/%s" .RepoInfo.RepoIdentifier .LastCommitInfo.Hash .Path) }} 104 + {{ end }} 103 105 {{end}} 104 106 105 107 {{ define "repoAfter" }}