{{define "content"}}{{with .Data}}{{$d := .}}{{$p := .P}}

{{or $p.Title "New page"}}

{{.Kind}} for {{$p.Site}}{{with .From}}, from {{join . "; "}}{{end}}. {{template "page-status" $p}}

{{if or $p.PRURL .Preview $p.LiveNote}}
{{with .Preview}}

Open the preview ↗ built {{ago $d.PreviewAt}} from the branch {{$p.Branch}}

{{end}} {{with $p.PRURL}}

The pull request: {{.}} ↗{{if eq $p.Status "merged"}}, merged {{ago $p.MergedAt}}{{end}}

{{end}} {{with $p.Note}}

{{.}}

{{end}} {{if or (eq $p.Status "merged") (eq $p.Status "removing") (eq $p.Status "removed")}}
{{if not $p.LiveAt.IsZero}}{{if ne $p.Status "removed"}}

On the live site since {{ago $p.LiveAt}}: {{$p.Address}} ↗

{{end}}{{end}} {{if eq $p.Status "removed"}}{{if not $p.GoneAt.IsZero}}

Off the live site since {{ago $p.GoneAt}}.

{{end}}{{end}} {{with $p.LiveNote}}

{{if $d.Late}}{{.}} It's been over two hours since the merge: check that the site's deploy (the Gitea hook) ran.{{else}}{{.}}{{end}} {{if not $p.CheckedAt.IsZero}}Checked {{ago $p.CheckedAt}}.{{end}}

{{end}} {{if $p.Waiting}}
{{end}}
{{end}}
{{end}} {{with $p.Source.Variant}}

Variant {{.}}{{if $p.Source.VariantOf}} of the original page{{end}}.{{if $p.Source.VariantOf}} Its links to your site carry their own utm_content.{{end}}

{{end}} {{with $p.RemovalPRURL}}

The pull request that takes it off the site: {{.}} ↗

{{end}} {{with $p.Error}}{{end}} {{if $p.Editable}}
{{with $p.Warnings}}
To look at:
{{end}} {{with $p.Claims}}
Confirm these are true before the pull request

They claim experience, tests or results. Tick each one that's true; edit the sections to take out any that aren't.

{{range .}}{{end}}
{{end}}

Write it again uses your notes above and keeps what you've edited as its starting point. Push and preview puts the page on its own branch ({{or $p.Branch "supermarket/site-page-…"}}) and builds a preview, without a pull request.

{{else}}
{{$p.Sections}}
{{end}}
{{if eq $p.Status "merged"}}
Opens a pull request deleting the page; merging takes it off.
{{end}} {{if or (eq $p.Status "pr") (eq $p.Status "removing")}}
{{end}}
Forgets the page here. Its branch and pull request on Gitea stay; close them there.
{{end}}{{end}}