From 1d36ef43c2d6c2f9b106821ac04552d359f47116 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 31 Mar 2025 00:35:29 +0800 Subject: [PATCH] Use ref_query for ?branch=x, etc --- templates/_ref_query.tmpl | 3 +++ templates/repo_index.tmpl | 9 +++++---- templates/repo_raw_dir.tmpl | 5 ++--- templates/repo_tree_dir.tmpl | 5 ++--- templates/repo_tree_file.tmpl | 3 ++- diff --git a/templates/_ref_query.tmpl b/templates/_ref_query.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..2f78955b0e426ecbcf59ffd167642a6a99cca7fb --- /dev/null +++ b/templates/_ref_query.tmpl @@ -0,0 +1,3 @@ +{{- define "ref_query" -}} +{{- if .ref_type -}}?{{- .ref_type -}}={{- .ref_name -}}{{- end -}} +{{- end -}} diff --git a/templates/repo_index.tmpl b/templates/repo_index.tmpl index 767e0c8b1f8a07faf77d94d01ba0d606b5f2d362..6db5b0579bd0829f577d6f8bd900c6d690e8bd6e 100644 --- a/templates/repo_index.tmpl +++ b/templates/repo_index.tmpl @@ -3,6 +3,7 @@ SPDX-License-Identifier: AGPL-3.0-only SPDX-FileContributor: Runxi Yu */}} {{- define "repo_index" -}} +{{- $root := . -}} @@ -14,13 +15,13 @@ {{- template "header" . -}}