From 32d164f08b3312858c39893254769e4859fe5a86 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 10 Feb 2025 19:25:44 +0800 Subject: head.html: Add a common head template I tried to define a base.html and extend it from there, but Go's templating system doesn't support that. --- templates/base.html | 26 -------------------------- templates/category_index.html | 2 +- templates/head.html | 5 +++++ templates/index.html | 2 +- templates/repo_index.html | 2 +- templates/repo_tree_dir.html | 2 +- templates/repo_tree_file.html | 2 +- 7 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 templates/base.html create mode 100644 templates/head.html (limited to 'templates') diff --git a/templates/base.html b/templates/base.html deleted file mode 100644 index 67bc7b6..0000000 --- a/templates/base.html +++ /dev/null @@ -1,26 +0,0 @@ -{{- define "base" -}} - - - - - - - {{ block "title" . }}Lindenii Forge{{ end }} - - -
- - {{ block "forge-title" . }} - Lindenii Forge - {{ end }} - - - -
-
- {{ block "main" . }} - {{ end }} -
- - -{{- end -}} diff --git a/templates/category_index.html b/templates/category_index.html index cd5e95c..6ee729e 100644 --- a/templates/category_index.html +++ b/templates/category_index.html @@ -2,7 +2,7 @@ - + {{ template "head_common" . }} {{ .category_name }} diff --git a/templates/head.html b/templates/head.html new file mode 100644 index 0000000..b2cd487 --- /dev/null +++ b/templates/head.html @@ -0,0 +1,5 @@ +{{- define "head_common" -}} + + + +{{- end -}} diff --git a/templates/index.html b/templates/index.html index be02d7c..cbf7012 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,7 +2,7 @@ - + {{ template "head_common" . }} Forge diff --git a/templates/repo_index.html b/templates/repo_index.html index aa708c4..fc2ac51 100644 --- a/templates/repo_index.html +++ b/templates/repo_index.html @@ -2,7 +2,7 @@ - + {{ template "head_common" . }} {{ .category_name }}/repos/{{ .repo_name }} diff --git a/templates/repo_tree_dir.html b/templates/repo_tree_dir.html index ffdb64d..609d17e 100644 --- a/templates/repo_tree_dir.html +++ b/templates/repo_tree_dir.html @@ -2,7 +2,7 @@ - + {{ template "head_common" . }} {{ .category_name }}/repos/{{ .repo_name }}/{{ .path_spec }} diff --git a/templates/repo_tree_file.html b/templates/repo_tree_file.html index 9874cde..cd51108 100644 --- a/templates/repo_tree_file.html +++ b/templates/repo_tree_file.html @@ -2,7 +2,7 @@ - + {{ template "head_common" . }} {{ .category_name }}/repos/{{ .repo_name }}/{{ .path_spec }} -- cgit v1.2.3