From 1d13524bf623469daeb5c4f26bbb8269213ad710 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 21 Aug 2016 18:47:04 +0200 Subject: add shortcodes: map, rating --- content/karte/kartehier.md | 10 +++++++ content/rating/ratemal.md | 14 +++++++++ layouts/shortcodes/map.html | 50 ++++++++++++++++++++++++++++++++ layouts/shortcodes/rate.html | 13 +++++++++ themes/flog/layouts/partials/header.html | 1 + 5 files changed, 88 insertions(+) create mode 100644 content/karte/kartehier.md create mode 100644 content/rating/ratemal.md create mode 100644 layouts/shortcodes/map.html create mode 100644 layouts/shortcodes/rate.html diff --git a/content/karte/kartehier.md b/content/karte/kartehier.md new file mode 100644 index 0000000..72c8d0c --- /dev/null +++ b/content/karte/kartehier.md @@ -0,0 +1,10 @@ +--- +categories: +date: 2016-07-27 +title: Eine Karte +--- + +Ich esse gerne hier. + + +{{< map zoom="15" lat="51.881111" lon="10.562222" >}} diff --git a/content/rating/ratemal.md b/content/rating/ratemal.md new file mode 100644 index 0000000..d8c9156 --- /dev/null +++ b/content/rating/ratemal.md @@ -0,0 +1,14 @@ +--- +categories: +date: 2016-07-26 +title: Rate Me +--- + +Eine Bewertung. + + +Geiles Essen, {{< rate 5 >}} + +Optik Scheiße, {{< rate 0 >}}. + +Mittelding ist {{< rate 2 halb >}}. diff --git a/layouts/shortcodes/map.html b/layouts/shortcodes/map.html new file mode 100644 index 0000000..0ee7d3c --- /dev/null +++ b/layouts/shortcodes/map.html @@ -0,0 +1,50 @@ +
+
+ +
diff --git a/layouts/shortcodes/rate.html b/layouts/shortcodes/rate.html new file mode 100644 index 0000000..bdce5b7 --- /dev/null +++ b/layouts/shortcodes/rate.html @@ -0,0 +1,13 @@ + +{{ range seq (.Get 0) }} +star +{{ end }} +{{ $len := 5 }} +{{ if and (.Get 1) (eq "halb" (.Get 1)) }}{{ $len := 4 }}{{ end }} +{{ if eq 4 $len }} +star_half +{{ end }} +{{ range seq (sub $len (int (.Get 0))) }} +star_border +{{ end }} + diff --git a/themes/flog/layouts/partials/header.html b/themes/flog/layouts/partials/header.html index 5a32775..03331a0 100644 --- a/themes/flog/layouts/partials/header.html +++ b/themes/flog/layouts/partials/header.html @@ -5,6 +5,7 @@ {{ .Hugo.Generator }} + {{ .Title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }} -- cgit v1.3.1