diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-31 00:35:29 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-31 00:35:29 +0800 |
commit | 1d36ef43c2d6c2f9b106821ac04552d359f47116 (patch) | |
tree | 561ebf98fde70403ba8416aa9fc15a46b928fe9f /templates/repo_tree_file.tmpl | |
parent | mandoc in Makefile and forge.5 (diff) | |
download | forge-1d36ef43c2d6c2f9b106821ac04552d359f47116.tar.gz forge-1d36ef43c2d6c2f9b106821ac04552d359f47116.tar.zst forge-1d36ef43c2d6c2f9b106821ac04552d359f47116.zip |
Use ref_query for ?branch=x, etc
Diffstat (limited to 'templates/repo_tree_file.tmpl')
-rw-r--r-- | templates/repo_tree_file.tmpl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/repo_tree_file.tmpl b/templates/repo_tree_file.tmpl index b0ce0f1..037a5af 100644 --- a/templates/repo_tree_file.tmpl +++ b/templates/repo_tree_file.tmpl @@ -3,6 +3,7 @@ SPDX-FileContributor: Runxi Yu <https://runxiyu.org> */}} {{- define "repo_tree_file" -}} +{{- $root := . -}} <!DOCTYPE html> <html lang="en"> <head> @@ -14,7 +15,7 @@ {{- template "header" . -}} <div class="padding"> <p> - /{{ .path_spec }} (<a href="/{{ template "group_path_plain" .group_path }}/:/repos/{{ .repo_name }}/raw/{{ .path_spec }}{{ if .ref_type }}?{{ .ref_type }}={{ .ref_name }}{{ end }}">raw</a>) + /{{ .path_spec }} (<a href="/{{ template "group_path_plain" .group_path }}/:/repos/{{ .repo_name }}/raw/{{ .path_spec }}{{- template "ref_query" $root -}}">raw</a>) </p> {{- .file_contents -}} </div> |