22 changed files with 281 additions and 102 deletions
@ -0,0 +1,10 @@ |
|||||||
|
+++ |
||||||
|
# A tile is shown on the main page. It represents and external website but can also have an |
||||||
|
# blog posts. For this, it must have a corresponding tag. |
||||||
|
# It's image is clickable to call external website. |
||||||
|
title = "{{ replace .Name "-" " " | title }}" |
||||||
|
correspondingTagName = "{{ lower .Name }}" |
||||||
|
urlLink = "kollegen.uber.space/{{ lower .Name }}/" |
||||||
|
cover = "img/{{ lower .Name }}-logo.png" |
||||||
|
coverCredit = "Webseite {{ replace .Name "-" " " | title }}" |
||||||
|
+++ |
||||||
@ -1,6 +1,7 @@ |
|||||||
+++ |
+++ |
||||||
title = "3 Die Runde Stunde" |
title = "Die Runde Stunde" |
||||||
urlLink = "kollegen.uber.space/dierundestunde/" |
urlLink = "kollegen.uber.space/dierundestunde/" |
||||||
cover = "img/drs-logo.png" |
cover = "img/drs-logo.png" |
||||||
coverCredit = "Besuche Die Runde Stunde" |
coverCredit = "Besuche Die Runde Stunde" |
||||||
|
description = "Unterwegs im R15" |
||||||
+++ |
+++ |
||||||
@ -0,0 +1,7 @@ |
|||||||
|
+++ |
||||||
|
title = "Kollegenrunde" |
||||||
|
urlLink = "kollegen.uber.space/kollegenrunde/" |
||||||
|
cover = "img/kollegenrunde-logo.png" |
||||||
|
coverCredit = "Webseite der Kollegenrunde" |
||||||
|
description = "Der Kollege lädt ein" |
||||||
|
+++ |
||||||
@ -0,0 +1,7 @@ |
|||||||
|
+++ |
||||||
|
title = "My Equis" |
||||||
|
urlLink = "kollegen.uber.space/japp/myequis" |
||||||
|
cover = "img/myequis-logo.png" |
||||||
|
coverCredit = "Besuche My Equis" |
||||||
|
description = "In der Fahrrad-Werkstatt" |
||||||
|
+++ |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
+++ |
||||||
|
title = "Pendel" |
||||||
|
urlLink = "earls5.uber.space/pendel/" |
||||||
|
cover = "img/pendel-logo.png" |
||||||
|
coverCredit = "Pendel" |
||||||
|
description = "Leinwand durch Raum und Zeit!" |
||||||
|
+++ |
||||||
|
|
||||||
@ -0,0 +1,7 @@ |
|||||||
|
+++ |
||||||
|
title = "Die Runde Stunde" |
||||||
|
correspondingTagName = "dierundestunde" |
||||||
|
urlLink = "kollegen.uber.space/dierundestunde/" |
||||||
|
cover = "img/drs-logo.png" |
||||||
|
coverCredit = "Besuche Die Runde Stunde" |
||||||
|
+++ |
||||||
@ -1,5 +1,6 @@ |
|||||||
+++ |
+++ |
||||||
title = "2 Kollegenrunde" |
title = "Kollegenrunde" |
||||||
|
correspondingTagName = "Kollegenrunde" |
||||||
urlLink = "kollegen.uber.space/kollegenrunde/" |
urlLink = "kollegen.uber.space/kollegenrunde/" |
||||||
cover = "img/kollegenrunde-logo.png" |
cover = "img/kollegenrunde-logo.png" |
||||||
coverCredit = "Webseite der Kollegenrunde" |
coverCredit = "Webseite der Kollegenrunde" |
||||||
|
|||||||
@ -1,5 +1,6 @@ |
|||||||
+++ |
+++ |
||||||
title = "3 My Equis" |
title = "My Equis" |
||||||
|
correspondingTagName = "myequis" |
||||||
urlLink = "kollegen.uber.space/japp/myequis" |
urlLink = "kollegen.uber.space/japp/myequis" |
||||||
cover = "img/myequis-logo.png" |
cover = "img/myequis-logo.png" |
||||||
coverCredit = "Besuche My Equis" |
coverCredit = "Besuche My Equis" |
||||||
|
|||||||
@ -1,7 +1,9 @@ |
|||||||
+++ |
+++ |
||||||
title = "1 Pendel" |
title = "Pendel" |
||||||
|
correspondingTagName = "pendel" |
||||||
urlLink = "earls5.uber.space/pendel/" |
urlLink = "earls5.uber.space/pendel/" |
||||||
cover = "img/pendel-logo.png" |
cover = "img/pendel-logo.png" |
||||||
coverCredit = "Die Pendel-Website" |
coverCredit = "Die Pendel-Website" |
||||||
|
description = "Leinwand durch Raum und Zeit" |
||||||
+++ |
+++ |
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,25 @@ |
|||||||
|
|
||||||
|
<!-- Function to count number of posts for a given tag name --> |
||||||
|
<!-- Example: Count posts with tag="ddo" --> |
||||||
|
<!-- len={ { partial "count_posts.html" ( dict "context" $PageContext "term" "ddo" ) } } --> |
||||||
|
{{$term := .term}} |
||||||
|
{{$taxo := "tags"}} |
||||||
|
{{ $ret := -1 }} |
||||||
|
|
||||||
|
|
||||||
|
<!-- Get all posts--> |
||||||
|
{{ $posts := where .context.Site.Pages "Type" "posts" }} |
||||||
|
|
||||||
|
{{ $data := newScratch }} |
||||||
|
|
||||||
|
<!-- (re)set the counter to 0 --> |
||||||
|
{{ $data.Set "tagCounter" 0 }} |
||||||
|
<!-- increment counter if post contains the current tag--> |
||||||
|
{{ range $posts}} |
||||||
|
{{ if in .Params.tags $term }} |
||||||
|
{{ $data.Add "tagCounter" 1 }} |
||||||
|
{{ end }} |
||||||
|
{{ end }} |
||||||
|
{{ $ret = $data.Get "tagCounter" }} |
||||||
|
|
||||||
|
{{ return $ret }} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
{{- $cover := false -}} |
||||||
|
{{- $autoCover := default $.Site.Params.autoCover false }} |
||||||
|
{{- if index .Params "cover" -}} |
||||||
|
{{- if .Resources.GetMatch .Params.Cover }} |
||||||
|
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}} |
||||||
|
{{- else -}} |
||||||
|
{{- $cover = absURL .Params.Cover -}} |
||||||
|
{{- end -}} |
||||||
|
{{- else if $.Site.Params.AutoCover -}} |
||||||
|
{{- if (not .Params.Cover) -}} |
||||||
|
{{- if .Resources.GetMatch "cover.*" -}} |
||||||
|
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}} |
||||||
|
{{- end -}} |
||||||
|
{{- end -}} |
||||||
|
{{- end -}} |
||||||
|
|
||||||
|
{{ if .Params.urlLink }} |
||||||
|
{{if $cover -}} |
||||||
|
<!-- Cover image found --> |
||||||
|
<div> |
||||||
|
<a href="https://{{ .Params.urlLink }}" class="nodeco x post-meta"> |
||||||
|
<img src="{{ $cover }}" class="headerimage" |
||||||
|
alt="{{ .Title | plainify | default " " }}" |
||||||
|
title="{{ .Params.urlLink |plainify|default "Cover Image" }}" /> |
||||||
|
{{ .Params.urlLink }} |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
{{- end }} |
||||||
|
{{- end }} |
||||||
@ -1,25 +1,31 @@ |
|||||||
{{- $cover := false -}} |
{{ range where .Site.RegularPages "Type" "tiles" }} |
||||||
{{- $autoCover := default $.Site.Params.autoCover false }} |
|
||||||
|
{{ $count := partial "func/count_posts.html" ( dict "context" . "term" .Params.CorrespondingTagName ) }} |
||||||
{{- if index .Params "cover" -}} |
|
||||||
{{- if .Resources.GetMatch .Params.Cover }} |
<figure > |
||||||
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}} |
|
||||||
{{- else -}} |
{{if .Params.Cover }} |
||||||
{{- $cover = absURL .Params.Cover -}} |
<!-- Cover image found -- found in tiles --> |
||||||
{{- end -}} |
<a href="https://{{ .Params.urlLink }}"> |
||||||
{{- else if $.Site.Params.AutoCover -}} |
<img src="{{ .Params.Cover }}" |
||||||
{{- if (not .Params.Cover) -}} |
alt="{{ .Title | plainify | default " " }}" |
||||||
{{- if .Resources.GetMatch "cover.*" -}} |
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" /></a> |
||||||
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}} |
|
||||||
{{- end -}} |
{{ else }} |
||||||
{{- end -}} |
|
||||||
{{- end -}} |
<!-- No cover image found --> |
||||||
|
<a href="https://{{ .Params.urlLink }}"> |
||||||
{{if $cover -}} |
{{ .Title | plainify | default " " }} </a> |
||||||
<!-- Cover image found --> |
|
||||||
<a href="https://{{ .Params.urlLink }}"> |
{{ end }} |
||||||
<img src="{{ $cover }}" |
|
||||||
alt="{{ .Title | plainify | default " " }}" |
<figcaption > |
||||||
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" /> |
{{ if gt $count 0 }} |
||||||
</a> |
<a href="tags/{{ .Params.CorrespondingTagName }}"> |
||||||
{{- end }} |
#{{ .Params.CorrespondingTagName | plainify }} <small>({{ $count }})</small> </a> |
||||||
|
{{ end }} |
||||||
|
</figcaption > |
||||||
|
|
||||||
|
</figure> |
||||||
|
|
||||||
|
{{ end }} |
||||||
@ -0,0 +1,70 @@ |
|||||||
|
{{ define "main" }} |
||||||
|
<div class="post"> |
||||||
|
<div class="post-meta"> |
||||||
|
<div class="post-content"> |
||||||
|
{{ if .Description }} |
||||||
|
{{ .Description | markdownify }} |
||||||
|
{{ end }} |
||||||
|
<h1 class="post-subtitle">{{ .Title | markdownify }}</h1> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
{{ if .Params.tags }} |
||||||
|
<span class="post-tags"> |
||||||
|
{{ range .Params.tags }} |
||||||
|
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a> |
||||||
|
{{ end }} |
||||||
|
</span> |
||||||
|
{{ end }} |
||||||
|
{{ partial "tag-cover.html" . }} |
||||||
|
|
||||||
|
<div class="posts"> |
||||||
|
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} |
||||||
|
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} |
||||||
|
|
||||||
|
{{ $PageContext := . }} |
||||||
|
{{ if .IsHome }} |
||||||
|
{{ $PageContext = .Site }} |
||||||
|
{{ end }} |
||||||
|
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} |
||||||
|
|
||||||
|
{{ range $paginator.Pages }} |
||||||
|
<div class="post on-list"> |
||||||
|
<h1 class="post-title"> |
||||||
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> |
||||||
|
</h1> |
||||||
|
<div class="post-meta"> |
||||||
|
<span class="post-date"> |
||||||
|
{{ .Date.Format "2006-01-02" }} |
||||||
|
</span> |
||||||
|
{{ with .Params.Author }} |
||||||
|
<span class="post-author">:: {{ . }}</span> |
||||||
|
{{ end }} |
||||||
|
</div> |
||||||
|
|
||||||
|
{{ partial "cover.html" . }} |
||||||
|
|
||||||
|
|
||||||
|
<div class="post-content"> |
||||||
|
{{ if .Params.showFullContent }} |
||||||
|
{{ .Content }} |
||||||
|
{{ else if .Description }} |
||||||
|
{{ .Description | markdownify }} |
||||||
|
{{ else }} |
||||||
|
{{ .Summary | markdownify }} |
||||||
|
{{ end }} |
||||||
|
</div> |
||||||
|
|
||||||
|
{{ if not .Params.showFullContent }} |
||||||
|
<div> |
||||||
|
<a class="read-more button" |
||||||
|
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> |
||||||
|
</div> |
||||||
|
{{ end }} |
||||||
|
</div> |
||||||
|
{{ end }} |
||||||
|
{{ partial "pagination.html" . }} |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
{{ end }} |
||||||
Loading…
Reference in new issue