forked from ruangrupa/lumbung.space
Merge pull request 'front page redesign & post filtering' (#63) from r/lumbung.space:main into main
Reviewed-on: ruangrupa/lumbung.space#63
This commit is contained in:
@ -1,32 +1,50 @@
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<section class='entries'>
|
||||
<div class="h-feed">
|
||||
{{ range (.Paginate (.Site.RegularPages.GroupByDate "January 2006") 20 ).PageGroups }}
|
||||
|
||||
<div class="h-feed">
|
||||
{{ $range := .Site.RegularPages }}
|
||||
{{ $paginator := .Paginate $range }}
|
||||
{{ $pageSize := $paginator.PageSize }}
|
||||
{{ $totalPostsToShow := mul $paginator.PageNumber $pageSize }}
|
||||
{{ range $index, $el := (first $totalPostsToShow .Site.RegularPages) }}
|
||||
|
||||
<div class='post {{if eq .Section "tv"}}tv{{ end }}' {{ if eq $index (sub $totalPostsToShow $pageSize) }}id="newpage"{{ end }}>
|
||||
{{if eq .Section "tv"}}
|
||||
{{- partial "video_box.html" . -}}
|
||||
|
||||
<span class="date-marker">{{ .Key }}</span>
|
||||
{{ range .Pages }}
|
||||
{{ if in .Params.categories "tv"}}
|
||||
{{- partial "video_box.html" . -}}
|
||||
{{ else if in .Params.categories "calendar" }}
|
||||
{{- partial "calendar_card.html" . -}}
|
||||
{{ else if in .Params.categories "network" }}
|
||||
{{- partial "network_card.html" . -}}
|
||||
{{ else if in .Params.categories "pen" }}
|
||||
{{- partial "pen_card.html" . -}}
|
||||
{{ else if in .Params.categories "shouts" }}
|
||||
{{- partial "shout_card.html" . -}}
|
||||
{{ else if in .Params.categories "books.lumbung.space"}}
|
||||
{{- partial "book_card.html" . -}}
|
||||
{{ else }}
|
||||
{{- partial "card.html" . -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else if eq .Section "events" }}
|
||||
{{- partial "partials/calendar_card.html" . -}}
|
||||
|
||||
{{ else if eq .Section "shouts" }}
|
||||
{{ if in .Params.sources "pen.lumbung.space" }}
|
||||
{{- partial "partials/pen_card.html" . -}}
|
||||
{{ else }}
|
||||
{{- partial "partials/shout_card.html" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ else if eq .Section "social" }}
|
||||
{{- partial "partials/social_card.html" . -}}
|
||||
|
||||
{{ else if eq .Section "publications"}}
|
||||
{{- partial "partials/book_card.html" . -}}
|
||||
|
||||
{{ else if eq .Section "sounds"}}
|
||||
{{- partial "sounds_card.html" . -}}
|
||||
|
||||
{{ else }}
|
||||
{{- partial "card.html" . -}}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<nav class="pagination-container">
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</nav>
|
||||
|
||||
<div class="page-nav">
|
||||
{{ if and (gt $paginator.TotalPages 1) ($paginator.HasNext) }}
|
||||
<a id="load-more-paginator" class="nextpage" href="{{ $paginator.Next.URL }}#newpage">load more</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div class="lumbung-radio-player" onclick="window.open('https://lumbungradio.stationofcommons.org', 'Lumbung Radio', 'height=800,width=450')">
|
||||
<svg class="lumbung-radio-play-button" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 4V20L20 12L7 4Z" fill="#CA14D4" stroke="#CA14D4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
@ -34,5 +52,8 @@
|
||||
<span>lumbung radio</span>
|
||||
<img src="/img/lumbung-radio-logo.png" alt="" height="30">
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
|
||||
{{ end }}
|
Reference in New Issue
Block a user