From 9b20ef637095413a8e7bde6701b8ad2379b4e7aa Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Feb 2025 12:06:36 +0800 Subject: [PATCH] repo_*_{dir,file}: Add ref params if not head --- templates/repo_raw_dir.html.tmpl | 4 +++- templates/repo_tree_dir.html.tmpl | 4 +++- templates/repo_tree_file.html.tmpl | 2 +- diff --git a/templates/repo_raw_dir.html.tmpl b/templates/repo_raw_dir.html.tmpl index a264d243ae38e2619d1b5a1ecec5c9774a37b75d..dc1a5b64ae905743cfe162436ecdca8d94255d57 100644 --- a/templates/repo_raw_dir.html.tmpl +++ b/templates/repo_raw_dir.html.tmpl @@ -18,10 +18,12 @@ {{- $path_spec := .path_spec }} + {{- $ref := .ref }} + {{- $ref_type := .ref_type }} {{- range .files }} {{ .Mode }} - {{ .Name }}{{ if not .Is_file }}/{{ end }} + {{ .Name }}{{ if not .Is_file }}/{{ end }} {{ .Size }} {{- end }} diff --git a/templates/repo_tree_dir.html.tmpl b/templates/repo_tree_dir.html.tmpl index d7fbb10d8032f757cf8afa1216c4f1be8a6f07e1..5e56dc9e87ff19a48175fadf972797105d9eab30 100644 --- a/templates/repo_tree_dir.html.tmpl +++ b/templates/repo_tree_dir.html.tmpl @@ -18,10 +18,12 @@ {{- $path_spec := .path_spec }} + {{- $ref := .ref }} + {{- $ref_type := .ref_type }} {{- range .files }} {{ .Mode }} - {{ .Name }}{{ if not .Is_file }}/{{ end }} + {{ .Name }}{{ if not .Is_file }}/{{ end }} {{ .Size }} {{- end }} diff --git a/templates/repo_tree_file.html.tmpl b/templates/repo_tree_file.html.tmpl index 6931c4ec696051ab3a7857884ba7d1c39280bfa6..0bf9164146eb6b7ef6c8cd34bac8615b0b3f4469 100644 --- a/templates/repo_tree_file.html.tmpl +++ b/templates/repo_tree_file.html.tmpl @@ -10,7 +10,7 @@ {{ template "header" . }}

- /{{ .path_spec }} (raw) + /{{ .path_spec }} (raw)

{{ .file_contents }}
-- 2.48.1