{{ define "title" }}{{ .Path }} at {{ .Ref }} · {{ .RepoInfo.FullName }}{{ end }} {{ define "extrameta" }} {{ template "repo/fragments/meta" . }} {{ $title := printf "%s at %s · %s" .Path .Ref .RepoInfo.FullName }} {{ $url := printf "https://tangled.org/%s/blob/%s/%s" .RepoInfo.FullName .Ref .Path }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} {{ end }} {{ define "repoContent" }} {{ $linkstyle := "no-underline hover:underline" }} {{ if .LastCommitInfo }}
{{ $messageParts := splitN .LastCommitInfo.Message "\n\n" 2 }}
{{ index $messageParts 0 }} {{ if gt (len $messageParts) 1 }} {{ end }}
{{ if gt (len $messageParts) 1 }} {{ end }}
{{ if .LastCommit.Author }} {{ $authorDid := index .EmailToDid .LastCommit.Author.Email }} {{ if $authorDid }} {{ template "user/fragments/picHandleLink" $authorDid }} {{ else }} {{ placeholderAvatar "tiny" }} {{ .LastCommit.Author.Name }} {{ end }} {{ end }} {{ template "repo/fragments/time" .LastCommitInfo.When }} {{ slice .LastCommitInfo.Hash.String 0 8 }}
{{ end }}
at {{ .Ref }} {{ if .BlobView.ShowingText }} {{ .BlobView.Lines }} lines {{ end }} {{ if .BlobView.SizeHint }} {{ byteFmt .BlobView.SizeHint }} {{ end }} {{ if .BlobView.HasRawView }} view raw {{ end }} {{ if .BlobView.ShowToggle }} view {{ if .BlobView.ShowingRendered }}code{{ else }}rendered{{ end }} {{ end }}
{{ if .BlobView.IsUnsupported }}

Previews are not supported for this file type.

{{ else if .BlobView.ContentType.IsSubmodule }}

This directory is a git submodule of {{ .BlobView.ContentSrc }}.

{{ else if .BlobView.ContentType.IsImage }}
{{ .Path }}
{{ else if .BlobView.ContentType.IsVideo }}
{{ else if .BlobView.ContentType.IsSvg }}
{{ if .BlobView.ShowingRendered }}
{{ .Path }}
{{ else }}
{{ code .BlobView.Contents .Path | escapeHtml }}
{{ end }}
{{ else if .BlobView.ContentType.IsMarkup }}
{{ if .BlobView.ShowingRendered }}
{{ .BlobView.Contents | readme }}
{{ else }}
{{ code .BlobView.Contents .Path | escapeHtml }}
{{ end }}
{{ else if .BlobView.ContentType.IsCode }}
{{ code .BlobView.Contents .Path | escapeHtml }}
{{ end }} {{ template "fragments/multiline-select" }} {{ end }}