UNPKG

tw-runner

Version:

Run and manage Tower Website projects with this utility.

45 lines (41 loc) 1.66 kB
{{ define "main" }} <section class="my-12 grid gap-6"> <header class="grid gap-4 text-center"> <h1 class="text-4xl font-mono font-bold text-center">{{ .Title }}</h1> <nav class="box box-sm opacity-65"> <ol id="breadcrumbs" class="flex justify-center gap-2"> {{- range .Ancestors.Reverse }} <li class="btn-link"><a href="{{ .Permalink }}">{{ .Title }}</a></li> <span>/</span> {{- end }} <li class="font-thin">{{ .Title }}</li> </ol> </nav> {{ $subjects := .Sections }} {{ if $subjects }} <h2 class="font-thin">Jump to a Subject</h2> <div class="w-full flex flex-wrap justify-center gap-4 mb-6"> {{ range $subjects }} <a href="#{{ .Params.id }}" class="btn btn-xl btn-primary"> {{ .Title | title }} </a> {{ end }} </div> {{ end }} </header> <main class="grid gap-6"> {{ if $subjects }} {{ range $subjects }} {{ $indexPage := . }} <h2 id="{{ .Params.id | urlize }}" class="text-4xl font-extralight mt-8">{{ .Title | title }}</h2> {{ $topArticles := first 4 (sort .Pages "Date" "desc") }} {{/* {{ $articles := where .Site.RegularPages "Section" "articles" }} {{ $articles = first 4 (sort $articles "Date" "desc") }} */}} {{ partial "content/articles/collections/list.html" (dict "list" $topArticles "index" $indexPage ) }} {{/* {{ partial "content/articles/collections/list.html" (dict "pages" $topArticles "drillsDown" true "category" . ) }} */}} {{ end }} {{ else }} {{ partial "content/articles/collections/list.html" (dict "list" .Pages) }} {{ end }} </main> </section> {{ end }}