diff --git a/config.toml b/config.toml index 14d8fd9..42dec01 100644 --- a/config.toml +++ b/config.toml @@ -21,6 +21,7 @@ archetypeDir = "../kollegen-posts/archetypes" eventtype = "eventtypes" member = "members" location = "locations" + year = "years" [sitemap] changefreq = "monthly" diff --git a/layouts/index.html b/layouts/index.html index 8e80053..875a8f4 100755 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,5 +1,5 @@ {{ define "main" }} -{{ partial "navigation-bar.html" ( dict "context" . "items" (slice "sports" "eventtypes" "members" "locations") )}} +{{ partial "navigation-bar.html" ( dict "context" . "items" (slice "sports" "eventtypes" "members" "locations" "years") )}}
Der Kollege lädt ein, man trifft sich zum Radeln. diff --git a/layouts/partials/years-summary.html b/layouts/partials/years-summary.html new file mode 100644 index 0000000..b75a5ea --- /dev/null +++ b/layouts/partials/years-summary.html @@ -0,0 +1,70 @@ +{{ $key := .page.Title }} +{{ $pages := .pages }} +{{ $count := len $pages }} +{{ $param_name := .param_name }} +{{ $param_title := .param_title }} +{{ $totalWidth := 100.0 }} +{{ $totalHeight := 50.0 }} +{{ $width := div $totalWidth 12 }} + +{{ $color := "#a8c7f0" }} +{{ $strokecolor := "#d3e3f8" }} + + + + + + {{ $month := 0 }} + {{ $actMonth := 0 }} + {{ $maxCount := 0 }} + {{ $actCount := 0 }} + {{ range $pages }} + {{ $month = dateFormat "2006-01" .Date }} + {{ if ne $month $actMonth }} + {{ $actMonth = $month }} + {{ $actCount = 0 }} + {{ end }} + + {{ $actCount = add 1 $actCount }} + + {{ $maxCount = add 1 $maxCount }} + {{ $month = dateFormat "2006-01" .Date }} + + {{ if gt $actCount $maxCount }} + {{ $maxCount = $actCount }} + {{ end }} + {{ end }} + + {{ $x := 0 }} + {{ $month := 0 }} + {{ range sort ( $pages.GroupByDate "2006-01" ) "Key" }} + {{ range first 1 .Pages }} + {{ $month = .Params.Date.Format "01" }} + {{ end }} + + {{ $height := 0 }} + {{ $height = mul (float $totalHeight ) ( div (float ( len .Pages ) ) ( float $maxCount ) ) }} + + {{ $x = mul ( sub ( float $month ) 1 ) $width }} + + + + + {{$x }} + {{ end }} + + + diff --git a/layouts/stats/list.html b/layouts/stats/list.html index c51a7ef..1f5cf0f 100644 --- a/layouts/stats/list.html +++ b/layouts/stats/list.html @@ -99,7 +99,7 @@
diff --git a/layouts/years/term.html b/layouts/years/term.html new file mode 100644 index 0000000..bc25de8 --- /dev/null +++ b/layouts/years/term.html @@ -0,0 +1,42 @@ +{{ define "main" }} + +{{ $nextYear := (int .Title) }} +{{ $pages := where .Site.RegularPages "Type" "in" (slice "posts") }} +{{ $pages = sort $pages "Date" }} + +{{ $pages = first 1 $pages }} + +{{ $next := printf "%s/%s" "years" .Title }} + +{{ partial "navigation-bar.html" ( dict "context" . "items" (slice "years" ) )}} + +
+ +
+
+
+ {{ range .Pages }} +
+ {{ partial "summary-with-thumbnail.html" . }} +
+ {{ end }} +
+
+{{ end }} diff --git a/layouts/years/terms.html b/layouts/years/terms.html new file mode 100644 index 0000000..6624adb --- /dev/null +++ b/layouts/years/terms.html @@ -0,0 +1,48 @@ +{{ define "main" }} + +{{ partial "navigation-bar.html" ( dict "context" . "items" (slice "/" ) )}} + +
+
+
+

Events nach Jahren. Die Pulsbar zeigt die relative Anzahl pro Monat. Navigiere weiter in die Posts eines Jahres.

+
+
+ +
+ {{ range .Data.Terms.Alphabetical.Reverse }} +
+
+ +
+ +
+
+ {{ len .Pages }} +
+
+ +
+
+ {{ humanize .Page.Section }} +
+ + + {{ .Page.Title }} + +
+
+ +
+ {{ partial "years-summary.html" (dict "page" .Page "param_title" .Page.Title "pages" .Pages) }} +
+
+
:
+
+ +
+
+ {{ end }} +
+
+{{ end }}