From c9b4eee4c589b8b40c02d0c96f887ec991580a24 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 6 Apr 2025 09:33:11 +0800 Subject: Restructure static/templates into forged --- forged/templates/400.tmpl | 25 +++++++ forged/templates/400_colon.tmpl | 26 +++++++ forged/templates/403.tmpl | 25 +++++++ forged/templates/404.tmpl | 24 ++++++ forged/templates/451.tmpl | 25 +++++++ forged/templates/500.tmpl | 25 +++++++ forged/templates/501.tmpl | 24 ++++++ forged/templates/_footer.tmpl | 12 +++ forged/templates/_group_path.tmpl | 8 ++ forged/templates/_group_view.tmpl | 56 ++++++++++++++ forged/templates/_head.tmpl | 9 +++ forged/templates/_header.tmpl | 35 +++++++++ forged/templates/_ref_query.tmpl | 3 + forged/templates/group.tmpl | 80 ++++++++++++++++++++ forged/templates/index.tmpl | 63 ++++++++++++++++ forged/templates/login.tmpl | 59 +++++++++++++++ forged/templates/repo_branches.tmpl | 71 ++++++++++++++++++ forged/templates/repo_commit.tmpl | 117 +++++++++++++++++++++++++++++ forged/templates/repo_contrib_index.tmpl | 82 +++++++++++++++++++++ forged/templates/repo_contrib_one.tmpl | 123 +++++++++++++++++++++++++++++++ forged/templates/repo_index.tmpl | 94 +++++++++++++++++++++++ forged/templates/repo_log.tmpl | 90 ++++++++++++++++++++++ forged/templates/repo_raw_dir.tmpl | 88 ++++++++++++++++++++++ forged/templates/repo_tree_dir.tmpl | 93 +++++++++++++++++++++++ forged/templates/repo_tree_file.tmpl | 65 ++++++++++++++++ 25 files changed, 1322 insertions(+) create mode 100644 forged/templates/400.tmpl create mode 100644 forged/templates/400_colon.tmpl create mode 100644 forged/templates/403.tmpl create mode 100644 forged/templates/404.tmpl create mode 100644 forged/templates/451.tmpl create mode 100644 forged/templates/500.tmpl create mode 100644 forged/templates/501.tmpl create mode 100644 forged/templates/_footer.tmpl create mode 100644 forged/templates/_group_path.tmpl create mode 100644 forged/templates/_group_view.tmpl create mode 100644 forged/templates/_head.tmpl create mode 100644 forged/templates/_header.tmpl create mode 100644 forged/templates/_ref_query.tmpl create mode 100644 forged/templates/group.tmpl create mode 100644 forged/templates/index.tmpl create mode 100644 forged/templates/login.tmpl create mode 100644 forged/templates/repo_branches.tmpl create mode 100644 forged/templates/repo_commit.tmpl create mode 100644 forged/templates/repo_contrib_index.tmpl create mode 100644 forged/templates/repo_contrib_one.tmpl create mode 100644 forged/templates/repo_index.tmpl create mode 100644 forged/templates/repo_log.tmpl create mode 100644 forged/templates/repo_raw_dir.tmpl create mode 100644 forged/templates/repo_tree_dir.tmpl create mode 100644 forged/templates/repo_tree_file.tmpl (limited to 'forged/templates') diff --git a/forged/templates/400.tmpl b/forged/templates/400.tmpl new file mode 100644 index 0000000..58ce768 --- /dev/null +++ b/forged/templates/400.tmpl @@ -0,0 +1,25 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "400" -}} + + + + {{- template "head_common" . -}} + 400 Bad Request – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

400 Bad Request

+

{{- .complete_error_msg -}}

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/400_colon.tmpl b/forged/templates/400_colon.tmpl new file mode 100644 index 0000000..470a685 --- /dev/null +++ b/forged/templates/400_colon.tmpl @@ -0,0 +1,26 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "400_colon" -}} + + + + {{- template "head_common" . -}} + 400 Bad Request – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

400 Bad Request

+

We recently switched URL schemes. Previously “:” was used as our URL group separator, but because OpenSMTPD does not implement local-part address quoting properly, we’re unable to include “:” in URLs properly, hence we use “-” now.

+

As a precaution in case visitors get confused, this page was set up. You should probably replace the “:”s with “-”s in the URL bar. If there are colons in the URL that is not the group separator—that’s an edge case that we’ll fix later.

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/403.tmpl b/forged/templates/403.tmpl new file mode 100644 index 0000000..86d5518 --- /dev/null +++ b/forged/templates/403.tmpl @@ -0,0 +1,25 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "403" -}} + + + + {{- template "head_common" . -}} + 403 Forbidden – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

403 Forbidden

+

{{- .complete_error_msg -}}

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/404.tmpl b/forged/templates/404.tmpl new file mode 100644 index 0000000..2eabb06 --- /dev/null +++ b/forged/templates/404.tmpl @@ -0,0 +1,24 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "404" -}} + + + + {{- template "head_common" . -}} + 404 Not Found – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

404 Not Found

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/451.tmpl b/forged/templates/451.tmpl new file mode 100644 index 0000000..ed6343c --- /dev/null +++ b/forged/templates/451.tmpl @@ -0,0 +1,25 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "451" -}} + + + + {{- template "head_common" . -}} + 451 Unavailable For Legal Reasons – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

451 Unavailable For Legal Reasons

+

{{- .complete_error_msg -}}

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/500.tmpl b/forged/templates/500.tmpl new file mode 100644 index 0000000..3a540e6 --- /dev/null +++ b/forged/templates/500.tmpl @@ -0,0 +1,25 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "500" -}} + + + + {{- template "head_common" . -}} + 500 Internal Server Error – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

500 Internal Server Error

+

{{- .complete_error_msg -}}

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/501.tmpl b/forged/templates/501.tmpl new file mode 100644 index 0000000..b6ab2f0 --- /dev/null +++ b/forged/templates/501.tmpl @@ -0,0 +1,24 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "501" -}} + + + + {{- template "head_common" . -}} + 501 Not Implemented – {{ .global.forge_title }} + + + {{- template "header" . -}} +
+

501 Not Implemented

+
+
Lindenii Forge
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/_footer.tmpl b/forged/templates/_footer.tmpl new file mode 100644 index 0000000..f71ea3e --- /dev/null +++ b/forged/templates/_footer.tmpl @@ -0,0 +1,12 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "footer" -}} +Lindenii Forge +{{ .global.forge_version }} +(source, +upstream, +license, +support) +{{- end -}} diff --git a/forged/templates/_group_path.tmpl b/forged/templates/_group_path.tmpl new file mode 100644 index 0000000..f5d3bf8 --- /dev/null +++ b/forged/templates/_group_path.tmpl @@ -0,0 +1,8 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "group_path_plain" -}} +{{- $p := . -}} +{{- range $i, $s := . -}}{{- $s -}}{{- if ne $i (minus (len $p) 1) -}}/{{- end -}}{{- end -}} +{{- end -}} diff --git a/forged/templates/_group_view.tmpl b/forged/templates/_group_view.tmpl new file mode 100644 index 0000000..92b6639 --- /dev/null +++ b/forged/templates/_group_view.tmpl @@ -0,0 +1,56 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "group_view" -}} +{{- if .subgroups -}} + + + + + + + + + + + + {{- range .subgroups -}} + + + + + {{- end -}} + +
Subgroups
NameDescription
+ {{- .Name -}} + + {{- .Description -}} +
+{{- end -}} +{{- if .repos -}} + + + + + + + + + + + + {{- range .repos -}} + + + + + {{- end -}} + +
Repos
NameDescription
+ {{- .Name -}} + + {{- .Description -}} +
+{{- end -}} +{{- end -}} diff --git a/forged/templates/_head.tmpl b/forged/templates/_head.tmpl new file mode 100644 index 0000000..d6d6571 --- /dev/null +++ b/forged/templates/_head.tmpl @@ -0,0 +1,9 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "head_common" -}} + + + +{{- end -}} diff --git a/forged/templates/_header.tmpl b/forged/templates/_header.tmpl new file mode 100644 index 0000000..340a2ac --- /dev/null +++ b/forged/templates/_header.tmpl @@ -0,0 +1,35 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "header" -}} +
+ + +
+ {{- if ne .user_id_string "" -}} + {{- .username -}} + {{- else -}} + Login + {{- end -}} +
+
+{{- end -}} diff --git a/forged/templates/_ref_query.tmpl b/forged/templates/_ref_query.tmpl new file mode 100644 index 0000000..2f78955 --- /dev/null +++ b/forged/templates/_ref_query.tmpl @@ -0,0 +1,3 @@ +{{- define "ref_query" -}} +{{- if .ref_type -}}?{{- .ref_type -}}={{- .ref_name -}}{{- end -}} +{{- end -}} diff --git a/forged/templates/group.tmpl b/forged/templates/group.tmpl new file mode 100644 index 0000000..b15c316 --- /dev/null +++ b/forged/templates/group.tmpl @@ -0,0 +1,80 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "group" -}} +{{- $group_path := .group_path -}} + + + + {{- template "head_common" . -}} + {{- range $i, $s := .group_path -}}{{- $s -}}{{- if ne $i (len $group_path) -}}/{{- end -}}{{- end }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+ {{- if .description -}} +

{{- .description -}}

+ {{- end -}} + {{- template "group_view" . -}} +
+ {{- if .direct_access -}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Create repo +
Name + +
Description + +
Contrib + +
+
+
+
+
+ +
+
+
+
+
+ {{- end -}} +
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/index.tmpl b/forged/templates/index.tmpl new file mode 100644 index 0000000..ff7c127 --- /dev/null +++ b/forged/templates/index.tmpl @@ -0,0 +1,63 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "index" -}} + + + + {{- template "head_common" . -}} + Index – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+ + + + + + + + + + + + {{- range .groups -}} + + + + + {{- end -}} + +
Groups
NameDescription
+ {{- .Name -}} + + {{- .Description -}} +
+ + + + + + + + + + + + + + + + +
+ Info +
SSH public key{{- .global.server_public_key_string -}}
SSH fingerprint{{- .global.server_public_key_fingerprint -}}
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/login.tmpl b/forged/templates/login.tmpl new file mode 100644 index 0000000..1e26c82 --- /dev/null +++ b/forged/templates/login.tmpl @@ -0,0 +1,59 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "login" -}} + + + + {{- template "head_common" . -}} + Login – {{ .global.forge_title -}} + + + {{- .login_error -}} +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ Password authentication +
Username + +
Password + +
+
+
+
+
+ +
+
+
+
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_branches.tmpl b/forged/templates/repo_branches.tmpl new file mode 100644 index 0000000..55ea0a6 --- /dev/null +++ b/forged/templates/repo_branches.tmpl @@ -0,0 +1,71 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_branches" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ + + + + + + + {{- range .branches -}} + + + + {{- end -}} + +
Branches
+ {{ . }} +
+
+ + +{{- end -}} diff --git a/forged/templates/repo_commit.tmpl b/forged/templates/repo_commit.tmpl new file mode 100644 index 0000000..470bba9 --- /dev/null +++ b/forged/templates/repo_commit.tmpl @@ -0,0 +1,117 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_commit" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + Commit {{ .commit_id }} – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+
+
+
Commit info
+
ID
+
{{- .commit_id -}}
+
Author
+
+ {{- .commit_object.Author.Name -}} <{{- .commit_object.Author.Email -}}> +
+
Author date
+
{{- .commit_object.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
+
Committer
+
+ {{- .commit_object.Committer.Name -}} <{{- .commit_object.Committer.Email -}}> +
+
Committer date
+
{{- .commit_object.Committer.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
+
Actions
+
+ Get patch +
+
+
+
+ +
+
{{- .commit_object.Message -}}
+
+
+ {{- $parent_commit_hash := .parent_commit_hash -}} + {{- $commit_object := .commit_object -}} + {{- range .file_patches -}} +
+ + +
+ {{- range .Chunks -}} + {{- if eq .Operation 0 -}} +
{{ .Content }}
+ {{- else if eq .Operation 1 -}} +
{{ .Content }}
+ {{- else if eq .Operation 2 -}} +
{{ .Content }}
+ {{- else -}} +
{{ .Content }}
+ {{- end -}} + {{- end -}} +
+
+ {{- end -}} +
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_contrib_index.tmpl b/forged/templates/repo_contrib_index.tmpl new file mode 100644 index 0000000..172a079 --- /dev/null +++ b/forged/templates/repo_contrib_index.tmpl @@ -0,0 +1,82 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_contrib_index" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + Merge requests – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+

How to submit a merge request

+
git clone {{ .ssh_clone_url }}
+cd {{ .repo_name }}
+git checkout -b contrib/name_of_your_contribution
+# edit and commit stuff
+git push -u origin HEAD
+

Pushes that update branches in other namespaces, or pushes to existing contribution branches belonging to other SSH keys, will be automatically +rejected, unless you are an authenticated maintainer. Otherwise, a merge request is automatically opened, and the maintainers are notified via IRC.

+

Alternatively, you may email patches to {{ .repo_patch_mailing_list }}.

+
+
+ + + + + + + + + + {{- range .merge_requests -}} + + + + + + {{- end -}} + +
IDTitleStatus
{{- .ID -}}{{- .Title -}}{{- .Status -}}
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_contrib_one.tmpl b/forged/templates/repo_contrib_one.tmpl new file mode 100644 index 0000000..a5f35d3 --- /dev/null +++ b/forged/templates/repo_contrib_one.tmpl @@ -0,0 +1,123 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_contrib_one" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + Merge requests – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Merge request info
ID{{- .mr_id -}}
Status{{- .mr_status -}}
Title{{- .mr_title -}}
Source ref{{- .mr_source_ref -}}
Destination branch{{- .mr_destination_branch -}}
Merge base{{- .merge_base.Hash.String -}}
+
+
+ {{- $merge_base := .merge_base -}} + {{- $source_commit := .source_commit -}} + {{- range .file_patches -}} +
+ + +
+ {{- range .Chunks -}} + {{- if eq .Operation 0 -}} +
{{ .Content }}
+ {{- else if eq .Operation 1 -}} +
{{ .Content }}
+ {{- else if eq .Operation 2 -}} +
{{ .Content }}
+ {{- else -}} +
{{ .Content }}
+ {{- end -}} + {{- end -}} +
+
+ {{- end -}} +
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_index.tmpl b/forged/templates/repo_index.tmpl new file mode 100644 index 0000000..d040f3a --- /dev/null +++ b/forged/templates/repo_index.tmpl @@ -0,0 +1,94 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_index" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+ {{- if .notes -}} +
Notes
+
    + {{- range .notes -}}
  • {{- . -}}
  • {{- end -}} +
+ + {{- end -}} +

{{- .ssh_clone_url -}}

+ {{- if .ref_name -}} +

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ {{- end -}} + {{- if .commits -}} +
+ {{- range .commits -}} +
+
+ + {{- .Hash | printf "%.8s" -}} + +  — {{- .Author -}} + + {{- .Date -}} + +
+
{{- .Message | first_line -}}
+
+ {{- end -}} + {{- if dereference_error .commits_err -}} +
+ Error while obtaining commit log: {{ .commits_err }} +
+ {{- end -}} +
+ {{- end -}} + {{- if .readme -}} +
+ {{- .readme -}} +
+ {{- end -}} +
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_log.tmpl b/forged/templates/repo_log.tmpl new file mode 100644 index 0000000..2262902 --- /dev/null +++ b/forged/templates/repo_log.tmpl @@ -0,0 +1,90 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_log" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + Log – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+ {{- if .ref_name -}} +

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ {{- end -}} + + + + + + + + + + + + + + {{- range .commits -}} + + + + + + + {{- end -}} + {{- if dereference_error .commits_err -}} + Error while obtaining commit log: {{ .commits_err }} + {{- end -}} + +
Commits {{ if .ref_name }} on {{ .ref_name }}{{ end -}}
IDTitleAuthorAuthor date
{{- .Hash -}}{{- .Message | first_line -}} + + + {{- .Author.When.Format "2006-01-02 15:04:05 -0700" -}} +
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_raw_dir.tmpl b/forged/templates/repo_raw_dir.tmpl new file mode 100644 index 0000000..a33da4a --- /dev/null +++ b/forged/templates/repo_raw_dir.tmpl @@ -0,0 +1,88 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_raw_dir" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+ {{- if .ref_name -}} +

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ {{- end -}} + + + + + + + + + + + + + {{- $path_spec := .path_spec -}} + {{- range .files -}} + + + + + + {{- end -}} + +
+ (Raw) /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }}{{ if .ref_name }} on {{ .ref_name }}{{ end -}} +
ModeFilenameSize
{{- .Mode -}}{{- .Name -}}{{- if not .IsFile -}}/{{- end -}}{{- .Size -}}
+
+
+
+
+
+
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_tree_dir.tmpl b/forged/templates/repo_tree_dir.tmpl new file mode 100644 index 0000000..fc06646 --- /dev/null +++ b/forged/templates/repo_tree_dir.tmpl @@ -0,0 +1,93 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_tree_dir" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+ {{- if .ref_name -}} +

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ {{- end -}} + + + + + + + + + + + + + {{- $path_spec := .path_spec -}} + {{- range .files -}} + + + + + + {{- end -}} + +
+ /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }}{{ if .ref_name }} on {{ .ref_name }}{{ end -}} +
ModeFilenameSize
{{- .Mode -}}{{- .Name -}}{{- if not .IsFile -}}/{{- end -}}{{- .Size -}}
+
+
+
+
+
+ {{- if .readme -}} +
+ {{- .readme -}} +
+ {{- end -}} +
+ {{- template "footer" . -}} +
+ + +{{- end -}} diff --git a/forged/templates/repo_tree_file.tmpl b/forged/templates/repo_tree_file.tmpl new file mode 100644 index 0000000..76404a9 --- /dev/null +++ b/forged/templates/repo_tree_file.tmpl @@ -0,0 +1,65 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu +*/}} +{{- define "repo_tree_file" -}} +{{- $root := . -}} + + + + {{- template "head_common" . -}} + + /{{ .path_spec }} – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} + + + {{- template "header" . -}} +
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+ {{- if .ref_name -}} +

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ {{- end -}} +

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

+ {{- .file_contents -}} +
+ + + +{{- end -}} -- cgit v1.2.3