treefmt: fix config, add prettier-plugin-go-template

This commit is contained in:
Jan Kremer 2024-10-17 17:41:01 +02:00
parent 6ccec6f792
commit 9e8f680c52
Signed by: jan
GPG key ID: A7DA689CB3B078EC
10 changed files with 137 additions and 85 deletions

View file

@ -1,14 +1,19 @@
{{ define "main" }} {{ .Content }} {{ $pages := .Paginate (where
.Site.RegularPages "Type" "ne" "page") }} {{ range $pages.Pages }}
<a href="{{ .RelPermalink }}" style="display: block">
<div class="list">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{
$dateHuman := .Date | time.Format "2006-01-02" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
{{ define "main" }}
{{ .Content }}
{{ $pages := .Paginate (where
.Site.RegularPages "Type" "ne" "page")
}}
{{ range $pages.Pages }}
<a href="{{ .RelPermalink }}" style="display: block">
<div class="list">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format "2006-01-02" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
<h2>{{ .Title }}</h2>
<h2>{{ .Title }}</h2>
<p class="lead">{{ .Description }}</p>
</div>
</a>
{{ end }} {{ end }}
<p class="lead">{{ .Description }}</p>
</div>
</a>
{{ end }}
{{ end }}

View file

@ -1,13 +1,16 @@
{{ define "main" }} {{ .Content }} {{ range .Pages }}
<a href="{{ .RelPermalink }}" style="display: block">
<div class="list">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{
$dateHuman := .Date | time.Format "2006-01-02" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
{{ define "main" }}
{{ .Content }}
{{ range .Pages }}
<a href="{{ .RelPermalink }}" style="display: block">
<div class="list">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format "2006-01-02" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
<h2>{{ .Title }}</h2>
<h2>{{ .Title }}</h2>
<p class="lead">{{ .Description }}</p>
</div>
</a>
{{ end }} {{ end }}
<p class="lead">{{ .Description }}</p>
</div>
</a>
{{ end }}
{{ end }}

View file

@ -1,14 +1,15 @@
{{ define "main" }}
<article>
{{ $dateMachine := .Lastmod | time.Format "2006-01-02T15:04:05-07:00" }} {{
$dateHuman := .Lastmod | time.Format "2006-01-02" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
<br />
<article>
{{ $dateMachine := .Lastmod | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Lastmod | time.Format "2006-01-02" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
<br />
<h1>{{ .Title }}</h1>
<h1>{{ .Title }}</h1>
<p class="lead">{{ .Description }}</p>
<p class="lead">{{ .Description }}</p>
{{ .Content }}
</article>
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ end }}
{{ .Content }}
</article>
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ end }}