{{if .Source.Lines}}
{{/* sourceContent's field names mirror earlierData so the same
logs-earlier template renders both the initial buffer (.Source)
and the Earlier-handler response. */}}
{{template "logs-earlier" .Source}}
Source: {{.Source.Path}}
{{else}}
No entries in {{.Source.Path}} yet.
{{end}}
{{end}}
{{/* Combined load-more button + lines fragment. Used both as the
initial buffer and as the response to /earlier requests — the old
button is replaced via outerHTML by [new button, new lines],
keeping chronology in the DOM correct.
The button's label depends on whether the next click stays in the
current file ("Load earlier") or crosses into a rotation
("Load previous from messages.0"). */}}
{{define "logs-earlier"}}
{{with .Next}}