Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ relativeURLs = true
weight = 50
[menu.main.params]
icon = "fa-brands fa-github"

[taxonomies]
poster = "poster"
8 changes: 8 additions & 0 deletions content/leaderboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Leaderboard

Remember that all submissions are reviewed. Sending in junk submissions to get high
up on the leaderboard means that they will be rejected, your placing on the leaderboard
will be penalised, and you will not see the light of heaven. Be told.

{{< leaderboard >}}

36 changes: 36 additions & 0 deletions themes/ndt2/layouts/shortcodes/leaderboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{ $taxonomyObject := .Site.Taxonomies.poster }}
{{ $ageRecent := -2 }}
{{ $startRecent := time.AsTime ( now.AddDate 0 0 $ageRecent) }}
{{ $recent := where .Site.Taxonomies.poster "Date" "gt" $startRecent }}


<h2>Last {{ $ageRecent}} days leaderboard (filtering by time)</h2>
<ol>
{{ range $recent.ByCount }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ol>

<h2>All-time leaderboard: Stuart (filtering by name)</h2>
<ol>
{{ range (where ($taxonomyObject.ByCount ) "Name" "stuart langridge") }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ol>

<h2>All-time leaderboard: top 10 (showing only some)</h2>
<ol>
{{ range (first 10 ($taxonomyObject.ByCount )) }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ol>

<h2>All-time leaderboard: everybody (show the lot)</h2>
<ol>
{{ range $taxonomyObject.ByCount }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ol>

<h2>Leaderboard actual data for reference</h2>
<pre>{{ debug.Dump $taxonomyObject.ByCount }}</pre>