{{ define "tree.html" }}{{ template "base" . }}{{ end }} {{ define "styles" }} {{ end }} {{ define "main" }} {{ $slug := print "/" .Info.Slug }} {{ $root := eq .Path "" }} {{ if $root }} {{ $m := mod "meta" }}

{{ $m.Title }}

{{ with $m.Description }}

{{ . }}

{{ end }}
default branch {{ $m.DefaultRef }}
updated {{ with $m.LastCommit }}{{ else }}never{{ end }}
{{ with $m.Section }}
section {{ . }}
{{ end }} {{ with $m.Clone }}
clone {{ . }}
{{ end }} {{ with $m.Owner }}
owner {{ . }}
{{ end }}
{{/* `with` on .Commits, not index 0 -- an empty repo has no commits and indexing would abort the render. */}} {{ with (mod "log" "1").Commits }}{{ with index . 0 }} {{ .Short }} {{ trunc 88 .Subject }} {{ .Author }} · {{ end }}{{ end }} {{ end }} {{/* An empty repo (unborn HEAD) has no commit to list a tree at -- mod "tree" would 404 on it, where this page used to render fine. Only call it once there's a real commit to resolve against. */}} {{ if .Commit }} {{ $tree := mod "tree" }} {{ if $root }}

{{ .Ref }} · {{ len $tree.Entries }} entries

{{ else }}

Files

{{ .Ref }} · {{ len $tree.Entries }} entries{{ with $tree.Path }} in {{ . }}{{ end }}

{{ end }} {{ template "tree-table" (dict "Base" $slug "Ref" .Ref "Entries" $tree.Entries) }} {{ end }} {{ if $root }} {{ with modOr "readme" }}
{{ .HTML }}
{{ end }} {{ end }} {{/* Everything else moved to its own page. Modules are lazy, so the ones this view no longer calls cost nothing -- to put authors back, this is the entire change: {{ with mod "authors" }} {{ end }} */}} {{ end }}