From 61fcfac541fe2271c052771b1c33b7511efb75bb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 27 Jul 2024 08:00:00 +0800 Subject: Indent the HTML with tabs --- templates/404.html | 17 ++-- templates/500.html | 17 ++-- templates/commit.html | 192 ++++++++++++++++++++++----------------------- templates/file.html | 46 +++++------ templates/head.html | 58 +++++++------- templates/index.html | 30 +++---- templates/log.html | 38 ++++----- templates/nav.html | 24 +++--- templates/refs.html | 68 ++++++++-------- templates/repo-header.html | 16 ++-- templates/repo.html | 52 ++++++------ templates/tree.html | 94 +++++++++++----------- 12 files changed, 322 insertions(+), 330 deletions(-) diff --git a/templates/404.html b/templates/404.html index bca9d35..dd8c813 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,14 +1,13 @@ {{ define "404" }} - 404 -{{ template "head" . }} - - {{ template "nav" . }} -
-

404 — nothing like that here.

-
- - + 404 Not Found + {{ template "head" . }} + + {{ template "nav" . }} +
+

404 Not Found

+
+ {{ end }} diff --git a/templates/500.html b/templates/500.html index 164700c..6217541 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,14 +1,13 @@ {{ define "500" }} - 500 -{{ template "head" . }} - - {{ template "nav" . }} -
-

500 — something broke!

-
- - + 500 + {{ template "head" . }} + + {{ template "nav" . }} +
+

500 — something broke!

+
+ {{ end }} diff --git a/templates/commit.html b/templates/commit.html index 49f4574..c592523 100644 --- a/templates/commit.html +++ b/templates/commit.html @@ -2,104 +2,104 @@ {{ template "head" . }} +{{ template "repoheader" . }} + + {{ template "nav" . }} +
+
+
{{- .commit.Message -}}
+
+ {{ .commit.Author.Name }} {{ .commit.Author.Email}} +
{{ .commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
+
- {{ template "repoheader" . }} - - {{ template "nav" . }} -
-
-
-          {{- .commit.Message -}}
-        
-
- {{ .commit.Author.Name }} {{ .commit.Author.Email}} -
{{ .commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
+
+ commit +

+ + {{ .commit.This }} + +

+
- + {{ if .commit.Parent }} + + {{ end }} - {{ if .commit.Parent }} - - - {{ end }} -
-
- {{ .stat.FilesChanged }} files changed, - {{ .stat.Insertions }} insertions(+), - {{ .stat.Deletions }} deletions(-) -
-
-
- jump to - {{ range .diff }} - - {{ end }} -
-
-
-
- {{ $repo := .name }} - {{ $this := .commit.This }} - {{ $parent := .commit.Parent }} - {{ range .diff }} -
-
- {{ if .IsNew }} - A - {{ end }} - {{ if .IsDelete }} - D - {{ end }} - {{ if not (or .IsNew .IsDelete) }} - M - {{ end }} - {{ if .Name.Old }} - {{ .Name.Old }} - {{ if .Name.New }} - → - {{ .Name.New }} - {{ end }} - {{ else }} - {{ .Name.New }} - {{- end -}} - {{ if .IsBinary }} -

Not showing binary file.

- {{ else }} -
-            {{- range .TextFragments -}}
-            

{{- .Header -}}

- {{- range .Lines -}} - {{- if eq .Op.String "+" -}} - {{ .String }} - {{- end -}} - {{- if eq .Op.String "-" -}} - {{ .String }} - {{- end -}} - {{- if eq .Op.String " " -}} - {{ .String }} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} -
-
-
- {{ end }} -
-
- +
+
+ {{ .stat.FilesChanged }} files changed, + {{ .stat.Insertions }} insertions(+), + {{ .stat.Deletions }} deletions(-) +
+
+
+ jump to + {{ range .diff }} + + {{ end }} +
+
+
+
+ {{ $repo := .name }} + {{ $this := .commit.This }} + {{ $parent := .commit.Parent }} + {{ range .diff }} +
+
+ {{ if .IsNew }} + A + {{ end }} + {{ if .IsDelete }} + D + {{ end }} + {{ if not (or .IsNew .IsDelete) }} + M + {{ end }} + {{ if .Name.Old }} + {{ .Name.Old }} + {{ if .Name.New }} + → + {{ .Name.New }} + {{ end }} + {{ else }} + {{ .Name.New }} + {{- end -}} + {{ if .IsBinary }} +

Not showing binary file.

+ {{ else }} +
+					{{- range .TextFragments -}}
+					

{{- .Header -}}

+ {{- range .Lines -}} + {{- if eq .Op.String "+" -}} + {{ .String }} + {{- end -}} + {{- if eq .Op.String "-" -}} + {{ .String }} + {{- end -}} + {{- if eq .Op.String " " -}} + {{ .String }} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} +
+
+
+ {{ end }} +
+
+ {{ end }} diff --git a/templates/file.html b/templates/file.html index d18340a..a40f071 100644 --- a/templates/file.html +++ b/templates/file.html @@ -1,31 +1,25 @@ {{ define "file" }} - {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
-

{{ .path }} (view raw)

-
- - - - - -
-
-            {{- range .linecount }}
- {{ . }}
-            {{- end -}}
-              
-
-
-             {{- .content -}}
-              
-
-
-
- + {{ template "head" . }} + {{ template "repoheader" . }} + + {{ template "nav" . }} +
+

{{ .path }} (view raw)

+
+ + + + + +
+
{{- range .linecount }}{{ . }}{{- end -}}
+
+
{{- .content -}}
+
+
+
+ {{ end }} diff --git a/templates/head.html b/templates/head.html index b3f71c9..b5be55d 100644 --- a/templates/head.html +++ b/templates/head.html @@ -1,32 +1,32 @@ {{ define "head" }} - - - - - - {{ if .parent }} - {{ .meta.Title }} — {{ .name }} ({{ .ref }}): {{ .parent }}/ + + + + + + {{ if .parent }} + {{ .meta.Title }} — {{ .name }} ({{ .ref }}): {{ .parent }}/ - {{ else if .path }} - {{ .meta.Title }} — {{ .name }} ({{ .ref }}): {{ .path }} - {{ else if .files }} - {{ .meta.Title }} — {{ .name }} ({{ .ref }}) - {{ else if .commit }} - {{ .meta.Title }} — {{ .name }}: {{ .commit.This }} - {{ else if .branches }} - {{ .meta.Title }} — {{ .name }}: refs - {{ else if .commits }} - {{ if .log }} - {{ .meta.Title }} — {{ .name }}: log - {{ else }} - {{ .meta.Title }} — {{ .name }} - {{ end }} - {{ else }} - {{ .meta.Title }} - {{ end }} - {{ if and .servername .gomod }} - - {{ end }} - - + {{ else if .path }} + {{ .meta.Title }} — {{ .name }} ({{ .ref }}): {{ .path }} + {{ else if .files }} + {{ .meta.Title }} — {{ .name }} ({{ .ref }}) + {{ else if .commit }} + {{ .meta.Title }} — {{ .name }}: {{ .commit.This }} + {{ else if .branches }} + {{ .meta.Title }} — {{ .name }}: refs + {{ else if .commits }} + {{ if .log }} + {{ .meta.Title }} — {{ .name }}: log + {{ else }} + {{ .meta.Title }} — {{ .name }} + {{ end }} + {{ else }} + {{ .meta.Title }} + {{ end }} + {{ if and .servername .gomod }} + + {{ end }} + + {{ end }} diff --git a/templates/index.html b/templates/index.html index 740d2b3..52830d9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,20 +3,20 @@ {{ template "head" . }} -
-

{{ .meta.Title }}

-

{{ .meta.Description }}

-
- -
-
- {{ range .info }} - -
{{ .Desc }}
-
{{ .Idle }}
- {{ end }} -
-
- +
+

{{ .meta.Title }}

+

{{ .meta.Description }}

+
+ +
+
+ {{ range .info }} + +
{{ .Desc }}
+
{{ .Idle }}
+ {{ end }} +
+
+ {{ end }} diff --git a/templates/log.html b/templates/log.html index d097990..4312d66 100644 --- a/templates/log.html +++ b/templates/log.html @@ -3,24 +3,24 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $repo := .name }} -
- {{ range .commits }} -
-
{{ slice .Hash.String 0 8 }}
-
{{ .Message }}
-
-
- {{ .Author.Name }} {{ .Author.Email }} -
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
- {{ end }} -
-
- + {{ template "repoheader" . }} + + {{ template "nav" . }} +
+ {{ $repo := .name }} +
+ {{ range .commits }} +
+
{{ slice .Hash.String 0 8 }}
+
{{ .Message }}
+
+
+ {{ .Author.Name }} {{ .Author.Email }} +
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
+
+ {{ end }} +
+
+ {{ end }} diff --git a/templates/nav.html b/templates/nav.html index 51c9a34..3d40495 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,14 +1,14 @@ {{ define "nav" }} - + {{ end }} diff --git a/templates/refs.html b/templates/refs.html index f0e591f..f121d3e 100644 --- a/templates/refs.html +++ b/templates/refs.html @@ -3,39 +3,39 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $name := .name }} -

branches

-
- {{ range .branches }} -
- {{ .Name.Short }} - browse - log - tar.gz -
- {{ end }} -
- {{ if .tags }} -

tags

-
- {{ range .tags }} -
- {{ .Name }} - browse - log - tar.gz - {{ if .Message }} -
{{ .Message }}
-
- {{ end }} - {{ end }} -
- {{ end }} -
- + {{ template "repoheader" . }} + + {{ template "nav" . }} +
+ {{ $name := .name }} +

branches

+
+ {{ range .branches }} +
+ {{ .Name.Short }} + browse + log + tar.gz +
+ {{ end }} +
+ {{ if .tags }} +

tags

+
+ {{ range .tags }} +
+ {{ .Name }} + browse + log + tar.gz + {{ if .Message }} +
{{ .Message }}
+
+ {{ end }} + {{ end }} +
+ {{ end }} +
+ {{ end }} diff --git a/templates/repo-header.html b/templates/repo-header.html index 0420da7..e0b293a 100644 --- a/templates/repo-header.html +++ b/templates/repo-header.html @@ -1,12 +1,12 @@ {{ define "repoheader" }}
-

- all repos - — {{ .displayname }} - {{ if .ref }} - @ {{ .ref }} - {{ end }} -

-

{{ .desc }}

+

+ all repos + — {{ .displayname }} + {{ if .ref }} + @ {{ .ref }} + {{ end }} +

+

{{ .desc }}

{{ end }} diff --git a/templates/repo.html b/templates/repo.html index 68ab269..a9f4a49 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -5,35 +5,35 @@ {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $repo := .name }} -
- {{ range .commits }} -
-
{{ slice .Hash.String 0 8 }}
-
{{ .Message }}
-
-
- {{ .Author.Name }} {{ .Author.Email }} -
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
- {{ end }} -
+ + {{ template "nav" . }} +
+ {{ $repo := .name }} +
+ {{ range .commits }} +
+ +
{{ .Message }}
+
+
+ {{ .Author.Name }} {{ .Author.Email }} +
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
+
+ {{ end }} +
{{- if .readme }} -
- {{- .readme -}} -
+
+ {{- .readme -}} +
{{- end -}} -
- clone -
+			
+ clone +
 git clone https://{{ .servername }}/{{ .name }}
-        
-
-
- + + +
+ {{ end }} diff --git a/templates/tree.html b/templates/tree.html index 7ba065b..6e48dc1 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -4,53 +4,53 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $repo := .name }} - {{ $ref := .ref }} - {{ $parent := .parent }} + {{ template "repoheader" . }} + + {{ template "nav" . }} +
+ {{ $repo := .name }} + {{ $ref := .ref }} + {{ $parent := .parent }} -
- {{ if $parent }} -
-
-
..
- {{ end }} - {{ range .files }} - {{ if not .IsFile }} -
{{ .Mode }}
-
{{ .Size }}
-
- {{ if $parent }} - {{ .Name }}/ - {{ else }} - {{ .Name }}/ - {{ end }} -
- {{ end }} - {{ end }} - {{ range .files }} - {{ if .IsFile }} -
{{ .Mode }}
-
{{ .Size }}
-
- {{ if $parent }} - {{ .Name }} - {{ else }} - {{ .Name }} - {{ end }} -
- {{ end }} - {{ end }} -
-
-
-          {{- if .readme }}{{ .readme }}{{- end -}}
-        
-
-
- +
+ {{ if $parent }} +
+
+
..
+ {{ end }} + {{ range .files }} + {{ if not .IsFile }} +
{{ .Mode }}
+
{{ .Size }}
+
+ {{ if $parent }} + {{ .Name }}/ + {{ else }} + {{ .Name }}/ + {{ end }} +
+ {{ end }} + {{ end }} + {{ range .files }} + {{ if .IsFile }} +
{{ .Mode }}
+
{{ .Size }}
+
+ {{ if $parent }} + {{ .Name }} + {{ else }} + {{ .Name }} + {{ end }} +
+ {{ end }} + {{ end }} +
+
+
+					{{- if .readme }}{{ .readme }}{{- end -}}
+				
+
+
+ {{ end }} -- cgit v1.2.3