all repos — nirvash @ main

modular CMS using the quartzgun library

templates/cms_list.html (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{{ $pages := ((.Context).Value "adapter").ListPages }}

{{ template "header" .}}

<h2>Pages</h2>

<div class="new-page-button-wrapper">
  <a class="new-page-button" href="/new">New Page</a>
</div>

<div class="page-list">
  <ul>
  {{ range $slug, $title := $pages }}
    {{ if eq $title "NAVIGATION" }}
    <li><a href="/edit/{{$slug}}">{{$title}}</a></li>
    {{ end }}
  {{ end }}
  {{ range $slug, $title := $pages }}
    {{ if ne $title "NAVIGATION" }}
    <li><a href="/edit/{{$slug}}">{{$title}}</a></li>
    {{ end }}
  {{ end }}
  </ul>
</div>

{{ template "footer" .}}