package site const pageTemplate = ` {{.Title}}
{{if eq .Kind "repo"}}
{{if .RepoAvatarURL}}{{else}}{{icon "repo"}}{{end}}{{.RepoName}}Public
{{icon "fork"}} Import to GitHub
{{template "branch-menu" .}} {{template "go-file-button" .}} {{template "clone-menu" .}}
{{template "tree" .}} {{if .Readme}}
{{icon "book"}}{{.ReadmeName}}
{{.Readme}}
{{end}}
{{else if eq .Kind "tree"}}
{{template "branch-menu" .}} {{template "go-file-button" .}} {{template "clone-menu" .}}
{{template "tree" .}}
{{else if eq .Kind "commits"}}
{{template "branch-menu" .}} {{template "go-file-button" .}} {{icon "history"}} commits

Commit history

Browse every commit reachable from {{.Branch}}.

{{range .CommitGroups}}

Commits on {{.Date}}

{{range .Commits}}
{{.Message}} {{.Author}}{{if .DistinctCommitter}} authored and {{.Committer}}{{end}} committed on
{{.ShortOID}}
{{end}}
{{end}}
{{else if eq .Kind "commit"}}

Commit {{.ViewedCommit.Commit.ShortOID}}

{{.ViewedCommit.Commit.Author}}{{if .ViewedCommit.Commit.DistinctCommitter}} authored and {{.ViewedCommit.Commit.Committer}}{{end}} committed on
{{.ViewedCommit.Commit.Message}}
{{if .ViewedCommit.Commit.Body}}
{{.ViewedCommit.Commit.Body}}
{{end}}
commit {{.ViewedCommit.Commit.OID}} {{range .ViewedCommit.Parents}}parent {{.ShortOID}}{{end}}
{{if .ViewedCommit.Truncated}}Large commit{{else}}{{.ViewedCommit.FileCount}} changed files{{end}} {{if gt (len .ViewedCommit.Parents) 1}}Diffed against the first of {{len .ViewedCommit.Parents}} parents.{{end}} +{{.ViewedCommit.Additions}}−{{.ViewedCommit.Deletions}}
{{if .ViewedCommit.Truncated}}
Diff too large to render

This commit's patch exceeds the 8 MB static-page limit. Clone the repository to inspect the complete change.

{{else if .ViewedCommit.Files}}
{{range .ViewedCommit.Files}}
{{.Status}}{{.DisplayPath}} +{{.Additions}}−{{.Deletions}}
{{if .Binary}}
Binary file changed.
{{else if not .Rows}}
{{if .Truncated}}Diff omitted because this commit exceeds the static-page render limit.{{else}}File metadata changed without textual changes.{{end}}
{{else}}
{{range .Rows}}{{if .Hunk}}{{else}}{{end}}{{end}}
{{.Header}}
{{if .OldPresent}}{{.OldNumber}}{{end}} {{if .OldPresent}}{{.OldCode}}{{end}} {{if .NewPresent}}{{.NewNumber}}{{end}} {{if .NewPresent}}{{.NewCode}}{{end}}
{{if .Truncated}}
Diff truncated after the static-page render limit. Clone the repository to inspect the complete change.
{{end}}{{end}}
{{end}}
{{else}}
{{if .ViewedCommit.Binaries}}Binary changes omitted

Binary files are not rendered in static diffs.

{{else}}No file changes

This commit has no changes relative to its first parent.

{{end}}
{{end}}
{{else}}
{{template "go-file-button" .}} {{template "clone-menu" .}}
{{.Path}}{{humanSize .FileSize}} · {{.Language}}
Raw
{{if .IsSubmodule}}
{{icon "repo"}}Submodule

Points to commit {{.SubmoduleOID}}.

{{if .SubmoduleURL}}Open submodule{{end}}
{{else if .IsImage}}
{{.Path}}
{{else if .IsMarkdown}}
{{.Markdown}}
{{else if .Code}}
{{.Code}}
{{else}}
{{icon "file"}}Preview unavailable

This file is binary or too large to render safely.

Download raw file
{{end}}
{{end}}
{{define "branch-menu"}}
{{end}} {{define "go-file-button"}}{{end}} {{define "clone-menu"}}
{{end}} {{define "tree"}}
{{.Commit.Author}}{{.Commit.Message}}
{{.Commit.ShortOID}} {{icon "history"}} commits
{{if .ParentURL}}{{end}} {{range .Entries}}
{{if eq .Type "tree"}}{{icon "folder"}}{{else if eq .Type "commit"}}{{icon "repo"}}{{else}}{{icon "file"}}{{end}} {{.Name}} {{.CommitMessage}}
{{end}}
{{end}}`