Improve Organization
This commit is contained in:
@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
{{ $pages := shuffle (where site.RegularPages "Section" "tools") | first 20 }}
|
{{ $pages := shuffle (where site.RegularPages "Section" "tools") | first 20 }}
|
||||||
<section>
|
<section>
|
||||||
<h2>Featured Tools</h2>
|
<h2>Try Something New</h2>
|
||||||
|
<p>This list shows a selection of 20 random tools, refreshed every time this site is updated.</p>
|
||||||
{{ range $pages }}
|
{{ range $pages }}
|
||||||
<article class="tool-card">
|
<article class="tool-card">
|
||||||
<h3>
|
<h3>
|
||||||
|
@ -1,7 +1,41 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
|
{{ $allPages := slice }}
|
||||||
|
{{ $sections := slice }}
|
||||||
|
{{ range .Pages }}
|
||||||
|
{{ if .IsSection }}
|
||||||
|
{{ $sections = $sections | append . }}
|
||||||
|
{{ range .Pages }}
|
||||||
|
{{ $allPages = $allPages | append . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $allPages = $allPages | append . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ $sortedSections := sort $sections "LinkTitle" }}
|
||||||
|
{{ $sortedPages := sort $allPages "LinkTitle" }}
|
||||||
|
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
<section id="tools-list">
|
<section id="tools-list">
|
||||||
|
{{ if gt (len $sortedSections) 0 }}
|
||||||
|
<!-- <h2>Sections</h2> -->
|
||||||
|
<!-- <p>This list shows all sections, sorted alphabetically.</p> -->
|
||||||
|
<div id="link-list" style="align-items: left; justify-content: left;">
|
||||||
|
<ul>
|
||||||
|
{{ range $sortedSections }}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if gt (len $sortedPages) 0 }}
|
||||||
|
<h2>Tools</h2>
|
||||||
|
<p>This list shows all tools, sorted alphabetically.</p>
|
||||||
|
{{ else }}
|
||||||
|
<p>No tools found.</p>
|
||||||
|
{{ end }}
|
||||||
<table id="taxonomy-table">
|
<table id="taxonomy-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -12,18 +46,18 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{ range .Pages }}
|
{{ range $sortedPages }}
|
||||||
<tr onclick="window.location='{{ .RelPermalink }}'" style="cursor:pointer;"></tr>
|
<tr onclick="window.location='{{ .RelPermalink }}'" style="cursor:pointer;">
|
||||||
<td><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></td>
|
<td><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></td>
|
||||||
<td>
|
<td>
|
||||||
{{ $sep := "" }}
|
{{ $sep := "" }}
|
||||||
{{ range $key, $vals := .Params }}
|
{{ range $key, $vals := .Params }}
|
||||||
{{ if (in (slice "applications") $key) }}
|
{{ if (in (slice "applications") $key) }}
|
||||||
{{ $sep }}
|
{{ $sep }}
|
||||||
{{ range $i, $val := $vals }}
|
{{ range $i, $val := $vals }}
|
||||||
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $sep = "; " }}
|
{{ $sep = "; " }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</td>
|
</td>
|
||||||
@ -31,28 +65,77 @@
|
|||||||
{{ $sep := "" }}
|
{{ $sep := "" }}
|
||||||
{{ range $key, $vals := .Params }}
|
{{ range $key, $vals := .Params }}
|
||||||
{{ if (in (slice "developers") $key) }}
|
{{ if (in (slice "developers") $key) }}
|
||||||
{{ $sep }}
|
{{ $sep }}
|
||||||
{{ range $i, $val := $vals }}
|
{{ range $i, $val := $vals }}
|
||||||
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $sep = "; " }}
|
{{ $sep = "; " }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</td>
|
</td>
|
||||||
<!-- <td>
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
<!-- {{ range .Pages }}
|
||||||
|
{{ if .IsSection }}
|
||||||
|
{{ range .Pages }}
|
||||||
|
<tr onclick="window.location='{{ .RelPermalink }}'" style="cursor:pointer;">
|
||||||
|
<td><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></td>
|
||||||
|
<td>
|
||||||
{{ $sep := "" }}
|
{{ $sep := "" }}
|
||||||
{{ range $key, $vals := .Params }}
|
{{ range $key, $vals := .Params }}
|
||||||
{{ if (in (slice "licenses") $key) }}
|
{{ if (in (slice "applications") $key) }}
|
||||||
|
{{ $sep }}
|
||||||
|
{{ range $i, $val := $vals }}
|
||||||
|
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
||||||
|
{{ end }}
|
||||||
|
{{ $sep = "; " }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $sep := "" }}
|
||||||
|
{{ range $key, $vals := .Params }}
|
||||||
|
{{ if (in (slice "developers") $key) }}
|
||||||
|
{{ $sep }}
|
||||||
|
{{ range $i, $val := $vals }}
|
||||||
|
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
||||||
|
{{ end }}
|
||||||
|
{{ $sep = "; " }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
<tr onclick="window.location='{{ .RelPermalink }}'" style="cursor:pointer;">
|
||||||
|
<td><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></td>
|
||||||
|
<td>
|
||||||
|
{{ $sep := "" }}
|
||||||
|
{{ range $key, $vals := .Params }}
|
||||||
|
{{ if (in (slice "applications") $key) }}
|
||||||
{{ $sep }}
|
{{ $sep }}
|
||||||
{{ range $i, $val := $vals }}
|
{{ range $i, $val := $vals }}
|
||||||
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $sep = "; " }}
|
{{ $sep = "; " }}
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</td> -->
|
{{ end }}
|
||||||
</tr>
|
</td>
|
||||||
{{ end }}
|
<td>
|
||||||
|
{{ $sep := "" }}
|
||||||
|
{{ range $key, $vals := .Params }}
|
||||||
|
{{ if (in (slice "developers") $key) }}
|
||||||
|
{{ $sep }}
|
||||||
|
{{ range $i, $val := $vals }}
|
||||||
|
{{ partial "term-link.html" (dict "name" $val "taxonomy" $key) }}
|
||||||
|
{{ end }}
|
||||||
|
{{ $sep = "; " }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }} -->
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Reference in New Issue
Block a user