{{ define "blob.html" }}{{ template "base" . }}{{ end }} {{ define "styles" }}{{ end }} {{ define "main" }} {{ $slug := print "/" .Info.Slug }} {{ $b := mod "blob" }}

{{ $b.Path }}

{{ .Ref }} {{ if not $b.Submodule }} · {{ bytes64 $b.Size }}{{ if not $b.Binary }} · {{ len $b.Lines }} lines{{ end }} raw {{ if $b.Image }}download{{ end }} {{ end }}

{{ if $b.Submodule }}
This is a submodule, pinned at {{ if $b.Submodule.Remote }}{{ $b.Submodule.Remote }}:{{ end }}{{ $b.Submodule.SHA }}.
{{ else if $b.Preview }}
{{ $b.Path }}
{{ else if $b.Image }}
This image is {{ bytes64 $b.Size }}, over the {{ bytes64 $b.PreviewLimit }} preview limit. Download it to view it locally.
{{ else if $b.Binary }}
This is a binary file. Fetch it with raw.
{{ else }} {{ if $b.Oversize }}
This {{ if eq $b.Lang "json" }}JSON{{ else }}YAML{{ end }} file is {{ bytes64 $b.Size }}, over the {{ bytes64 $b.StructuredLimit }} limit for parsing. It is shown as plain numbered lines. Fetch the raw file to work with it locally.
{{ end }} {{ if $b.ParseErr }}
Invalid {{ if eq $b.Lang "json" }}JSON{{ else }}YAML{{ end }} {{ if $b.ParseErr.Line }}— line {{ $b.ParseErr.Line }}{{ end }}: {{ $b.ParseErr.Msg }}
{{ end }}
{{ range $b.Lines }} {{ end }}
{{ .N }} {{ .Text }}{{ with .Anchor }}{{ if .Uses }}{{ .Uses }} use{{ if ne .Uses 1 }}s{{ end }}{{ end }}{{ end }}{{ with .Ref }}→ {{ .Line }}{{ end }}
{{ end }} {{ end }} {{ define "scripts" }}{{ if (mod "blob").Structured }}{{ end }}{{ end }}