hugo without theme

This commit is contained in:
2020-10-13 21:44:56 +02:00
parent 611cdec8bd
commit a406d6a66e
723 changed files with 1253 additions and 0 deletions
@@ -0,0 +1,17 @@
<div class="mid-gray overflow-hidden pt2 pb2 pl4 pr4">
<a href="{{ .Permalink }}" class="link black dim">
<h1 class="f6 ">
<div class="flex justify-between">
<div class=" w-50 ">
{{- partial "formatted-date.html" . -}}
</div>
<div class=" w-50 tr">
{{ .Params.Sports }}
</div>
</div>
{{ .Title }} /
{{ .Params.Locations }}
</div>
</h1>
</a>
</div>
+9
View File
@@ -0,0 +1,9 @@
<ul class="pa0">
{{ range .Params.categories }}
<li class="list">
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">
{{- . -}}
</a>
</li>
{{ end }}
</ul>
+5
View File
@@ -0,0 +1,5 @@
<div>
{{ index $.Site.Data.weekday_short (printf "%d" .Date.Weekday) }},
{{ .Date.Day }}.
{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}
</div>
+49
View File
@@ -0,0 +1,49 @@
{{/*
GetHeaderImage
This partial gets the resource for the header image for a given page.
If a header_image was set in the page's front matter, then that will be used.
If not set, this will search page resources to find an image that contains the word
"cover", and if found, returns the path to that resource.
If no header_image was set, and there's no "cover" image in page resources, then
this partial returns an empty string (which evaluates to false).
@return Resource of header image, or an empty string if not found.
*/}}
{{ $headerImage := "" }}
{{/* Defined as params */}}
{{ if isset .context.Params .name }}
{{ $image_name := .context.Param .name }}
{{ with .context.Resources.GetMatch $image_name }}
{{ $headerImage = . }}
{{ end }}
{{ end }}
{{/* Defined as resource */}}
{{ if $headerImage }}
{{ else }}
{{ if .context.Resources.GetMatch .name }}
{{ $img := .context.Resources.GetMatch .name }}
{{ with $img }}
{{ $headerImage = . }}
{{ end }}
{{/* Find the first image with 'cover' in the name in this page bundle. */}}
{{ else }}
{{ $img := (.context.Resources.ByType "image").GetMatch "*cover*" }}
{{ with $img }}
{{ $headerImage = . }}
{{ end }}
{{ end }}
{{ end }}
{{/* return either a Resource, or an empty string. Note that partials can only have a single
return statement, so this needs to be at the end of the partial (and not in the if block) */}}
{{ return $headerImage }}
+26
View File
@@ -0,0 +1,26 @@
{{/*
HeatMeterTile
This partial visualizes a value to it's max value in a small tile. Inputs are following items:
two number values "value" and "max" and integer "precision" and "unit" for printing the value, "color".
@return -
*/}}
{{ $x := 0 }}
{{ if gt .max 0 }}
{{ $x = mul ( div 100.0 (float .max ) ) (float .value ) }}
{{ else }}
{{ $x = 0 }}
{{ end }}
{{ $output := partial "func/NumberFormatter.html" ( dict "number" .value "precision" .precision ) }}
<svg width="98" height="50" xmlns="http://www.w3.org/2000/svg">
<!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
<rect height="100%" width="100%" opacity="0.4" fill="{{ .color }}"/>
<rect height="100%" width="{{ $x }}" fill="{{ .color }}"/>
<text xml:space="preserve" text-anchor="middle" font-family="Helvetica, Arial, sans-serif"
class="f5 b" opacity="0.9" y="90%" x="40%" fill="#ffffff">{{ $output }}{{ .unit }}</text>
</svg>
@@ -0,0 +1,20 @@
{{/*
NumberFormatter
This partial exchanges the characters for thousends and decimals for the give integer,
used in Germany.
Use this for intergers and floats instead of Hugo's lang.NumFmt and float which are
not language specific.
Example
{{ partial "func/NumberFormatter.html" ( dict "number" 123456789.1234 "precision" 1 }}
will return 123.456.789,1
@return String with integer
*/}}
{{ $ret := strings.Replace ( lang.NumFmt .precision .number "- . ," ) "," "t" }}
{{ $ret = strings.Replace $ret "." "d" }}
{{ $ret = strings.Replace $ret "d" "," }}
{{ strings.Replace $ret "t" "." }}
+59
View File
@@ -0,0 +1,59 @@
{{ $key := .Title }}
{{ $pages := where .Site.RegularPages "Type" "in" (slice "posts") }}
{{ $count := len $pages }}
{{ $totalWidth := 100.0 }}
{{ $totalHeight := 50.0 }}
{{/* {{ $width := div $totalWidth ( len ( $pages.GroupByDate "2006" ) ) }} */}}
{{ $width := div $totalWidth ( len ( $pages.GroupByDate "2006" ) ) }}
{{ $color := "#357edd" }}
<svg width="{{ $totalWidth }}%" height="{{ $totalHeight }}"
xmlns="http://www.w3.org/2000/svg">
<rect height="100%" width="100%" opacity="0.1" fill="{{ $color }}"/>
{{ $x := 0 }}
{{ range sort ( $pages.GroupByDate "2006" ) "Key" }}
{{ $maxDist := 0.00 }}
{{ $maxCount := 0 }}
{{ $dist := 0.00 }}
{{ $count := 0 }}
{{ range .Pages }}
{{ $maxCount = add 1 $maxCount }}
{{ $isMember := false }}
{{ range .Params.members }}
{{ if eq . $key }}
{{ $isMember = true }}
{{ $count = add 1 $count }}
{{ end }}
{{ end }}
{{ with .Params.distance_km }}
{{ $maxDist = add . $maxDist }}
{{ if $isMember }}
{{ $dist = add . $dist }}
{{ end }}
{{ end }}
{{ end }}
{{ $height := 0 }}
{{ if gt $maxDist 0 }}
{{ $height = mul (float $totalHeight ) ( div (float $dist ) ( float $maxDist ) ) }}
{{ else }}
{{ $height = mul (float $totalHeight ) ( div (float $count ) ( float $maxCount ) ) }}
{{ end }}
{{/* {{ $maxDist }} */}}
{{/* {{ $dist }} */}}
{{/* {{ $x }} */}}
{{/* {{ $height }} */}}
<rect opacity="0.2" height="{{ $height }}" y="{{ sub $totalHeight $height }}" x="{{ $x }}%"
width="{{ $width }}%" fill="{{ $color }}" stroke-width="1.5" stroke="{{$color}}"/>
{{ $x = add $x $width }}
{{ end }}
</svg>
+20
View File
@@ -0,0 +1,20 @@
<div class="{{ .context.Site.Params.background_color_class | default "bg-black" }} flex flex-wrap justify-left pt1 pb1 pl5">
{{ range $index, $element := .items }}
{{ $url := $element }}
{{ $text := ""}}
{{ if eq $element "/"}}
{{ $text = "Home"}}
{{ else }}
{{ $text = $element}}
{{ end }}
<div class="mr5" >
<a href="{{ $element | relLangURL }}" class="ttu link f5 grow no-underline dib hover-white no-underline white-80 pa2">
{{ $text }}
</a>
</div>
{{ end}}
</div>
+20
View File
@@ -0,0 +1,20 @@
<div class="relative w-100 bg-white nested-copy-line-height">
<div class="bg-white gray overflow-hidden">
<div class="flex">
<div class="f1 pl2 pr2 pt4 pb4 bg-blue white">
{{ len .Data.Pages }}
</div>
<div class="flex flex-column mt3 ml3 ">
<div class="f6 pl2 db">{{ humanize .Section }}</div>
<div class="nested-links f5 lh-copy nested-copy-line-height">
<h1 class="f3 near-black ">
<a href="{{ .Permalink }}" class="link black dim pa2">
{{ .Title }}
</a>
</h1>
</div>
</div>
</div>
</div>
</div>
+30
View File
@@ -0,0 +1,30 @@
{{ $header_image := partial "func/GetNamedImage.html" (dict "context" . "name" "header_image") }}
{{$image_resource := $header_image }}
{{ if $image_resource }}
{{ $header_img := $image_resource.Resize "1200x" }}
{{ $image_url := $header_img.Permalink }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
{{ $image_url := (trim $image_url "/") | absURL }}
<header class="cover bg-top bg-black-80" style="background-image: url('{{ $image_url }}');">
<div class=" pb1-ns bg-black-60">
{{ partial "site-navigation.html" . }}
<div class="tc-l pv6 ph3 ph4-ns">
{{ if not .Params.omit_header_text }}
<h1 class="f2 f1-l fw2 white-90 mb0 lh-title">{{ .Title | default .Site.Title }}</h1>
{{ with .Params.description }}
<h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
{{ . }}
</h2>
{{ end }}
{{ end }}
</div>
</div>
</header>
{{ else }}
<header>
<div class="{{ .Site.Params.background_color_class | default "bg-black" }}">
{{ partial "site-navigation.html" . }}
</div>
</header>
{{ end }}
+14
View File
@@ -0,0 +1,14 @@
{{ $icon_size := "32px" }}
{{ with .Param "strava_activity" }}
<a href="{{ . }}" target="_blank" class="link-transition gitlab link dib z-999 pt3 pt0-l mr1 pr3" title="Strava-Aktivität" rel="noopener" aria-label="Our Strava Club——Opens in a new window">
{{ partial "svg/strava.svg" (dict "size" $icon_size) }}
</a>
{{ end }}
{{ with .Param "velohero_activity" }}
<a href="{{ . }}" target="_blank" class="link-transition facebook link dib z-999 pt3 pt0-l mr1" title="Velohero-Aktivität" rel="noopener" aria-label="Track on Velohero——Opens in a new window">
{{ partial "svg/velohero.svg" (dict "size" $icon_size) }}
</a>
{{ end }}
+86
View File
@@ -0,0 +1,86 @@
<!-- TODO: Add follow intents where available TODO: Revisit color and hover color -->
{{ $icon_size := "32px" }}
{{ with .Param "strava" }}
<a href="{{ . }}" target="_blank" class="link-transition gitlab link dib z-999 pt3 pt0-l mr1" title="Strava link" rel="noopener" aria-label="Our Strava Club——Opens in a new window">
{{ partial "svg/strava.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "stackoverflow" }}
<a href="{{ . }}" target="_blank" class="link-transition stackoverflow link dib z-999 pt3 pt0-l mr1" title="Stack Overflow link" rel="noopener" aria-label="follow on Stack Overflow——Opens in a new window">
{{ partial "svg/stackoverflow.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "facebook" }}
<a href="{{ . }}" target="_blank" class="link-transition facebook link dib z-999 pt3 pt0-l mr1" title="Facebook link" rel="noopener" aria-label="follow on Facebook——Opens in a new window">
{{ partial "svg/facebook.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "twitter" }}
<a href="{{ . }}" target="_blank" class="link-transition twitter link dib z-999 pt3 pt0-l mr1" title="Twitter link" rel="noopener" aria-label="follow on Twitter——Opens in a new window">
{{ partial "svg/twitter.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "instagram" }}
<a href="{{ . }}" target="_blank" class="link-transition instagram link dib z-999 pt3 pt0-l mr1" title="Instagram link" rel="noopener" aria-label="follow on Instagram——Opens in a new window">
{{ partial "svg/instagram.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "youtube" }}
<a href="{{ . }}" target="_blank" class="link-transition youtube link dib z-999 pt3 pt0-l mr1" title="Youtube link" rel="noopener" aria-label="follow on Youtube——Opens in a new window">
{{ partial "svg/youtube.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "linkedin" }}
<a href="{{ . }}" target="_blank" class="link-transition linkedin link dib z-999 pt3 pt0-l mr1" title="LinkedIn link" rel="noopener" aria-label="follow on LinkedIn——Opens in a new window">
{{ partial "svg/linkedin.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "github" }}
<a href="{{ . }}" target="_blank" class="link-transition github link dib z-999 pt3 pt0-l mr1" title="Github link" rel="noopener" aria-label="follow on Github——Opens in a new window">
{{ partial "svg/github.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "gitlab" }}
<a href="{{ . }}" target="_blank" class="link-transition gitlab link dib z-999 pt3 pt0-l mr1" title="Gitlab link" rel="noopener" aria-label="follow on Gitlab——Opens in a new window">
{{ partial "svg/gitlab.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "keybase" }}
<a href="{{ . }}" target="_blank" class="link-transition keybase link dib z-999 pt3 pt0-l mr1" title="Keybase link" rel="noopener" aria-label="follow on Keybase——Opens in a new window">
{{ partial "svg/keybase.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "medium" }}
<a href="{{ . }}" target="_blank" class="link-transition medium link dib z-999 pt3 pt0-l mr1" title="Medium link" rel="noopener" aria-label="follow on Medium——Opens in a new window">
{{ partial "svg/medium.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "mastodon" }}
<a href="{{ . }}" target="_blank" class="link-transition mastodon link dib z-999 pt3 pt0-l mr1" title="Mastodon link" rel="noopener" aria-label="follow on Mastodon——Opens in a new window">
{{ partial "svg/mastodon.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "slack" }}
<a href="{{ . }}" target="_blank" class="link-transition slack link dib z-999 pt3 pt0-l mr1" title="Slack link" rel="noopener" aria-label="follow on Slack——Opens in a new window">
{{ partial "svg/slack.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ with .Param "rss" }}
<a href="{{ . }}" target="_blank" class="link-transition rss link dib z-999 pt3 pt0-l mr1" title="RSS link" rel="noopener" aria-label="RSS——Opens in a new window">
{{ partial "svg/rss.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
+5
View File
@@ -0,0 +1,5 @@
<div>Anzahl Touren: {{ .total_nr }}</div>
<div>Entfernung: {{ partial "func/NumberFormatter.html" ( dict "number" .distance "precision" 0 ) }} km </div>
<div>Aufstieg: {{ partial "func/NumberFormatter.html" ( dict "number" .ascent "precision" 0 ) }} m </div>
+41
View File
@@ -0,0 +1,41 @@
{{ $image := partial "func/GetNamedImage.html" (dict "context" . "name" "featured_image") }}
{{ $image_link := ""}}
{{ with $image }}
{{ $image_link = $image.Permalink }}
{{ end }}
<article class="bb b--.black-10">
<div class="db pv4 ph3 ph0-l no-underline dark-gray">
<div class="f6 small-caps b pa1 mv1 gray bg-light-gray">
<div class="flex justify-between">
<div>
{{- .Params.Sports -}}
</div>
{{ partial "formatted-date.html" . }}
</div>
</div>
<div class="flex flex-column flex-row-ns">
{{ if $image_link }}
<div class="pr3-ns mb4 mb0-ns w-100 w-40-ns">
<a href="{{.Permalink}}" class="db grow">
<img src="{{ $image_link }}" class="img" alt="image from {{ .Title }}">
</a>
</div>
{{ end }}
<div class="blah w-100{{ if $image_link }} w-60-ns pl3-ns{{ end }}">
<h1 class="f3 fw1 athelas mt0 lh-title">
<a href="{{.Permalink}}" class="color-inherit dim link">
{{ .Title }}
</a>
</h1>
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
{{ .Summary }}
</div>
<a href="{{.Permalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{ $.Param "read_more_copy" | default (i18n "readMore") }}</a>
{{/* TODO: add author
<p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
</div>
</div>
</div>
</article>
+23
View File
@@ -0,0 +1,23 @@
<div class="mb3 pa4 mid-gray overflow-hidden">
{{ if .Date }}
<div class="f6">
<div class="flex justify-between">
<div class=" w-50 ">
{{- .Params.Sports -}}
</div>
<div class=" w-50 tr ">
{{- .Params.Location -}},
{{ partial "formatted-date.html" . }}
</div>
</div>
</div>
{{ end }}
<h1 class="f3 near-black">
<a href="{{ .Permalink }}" class="link black dim">
{{ .Title }}
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
{{ .Summary }}
</div>
</div>
+19
View File
@@ -0,0 +1,19 @@
<svg{{ with .size }}
height="{{ . }}" {{ end }}
style="enable-background:new 0 0 100 100;"
version="1.1"
viewBox="0 0 100 100"
width="{{ .size }}"
xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path
style="fill-rule:evenodd;clip-rule:evenodd;"
d="M 43.034178,0.19789991 15.493163,56.12954 H 32.86621 L 43.034178,33.03579 53.2041,56.12954 h 17.373047 z"
/>
<path
d="M 61.439189,99.143912 83.740512,56.12954 H 69.672697 L 61.439189,73.889851 53.2041,56.12954 H 39.136284 Z"
style="fill-rule:evenodd;clip-rule:evenodd;"
/>
</svg>

After

Width:  |  Height:  |  Size: 642 B

+30
View File
@@ -0,0 +1,30 @@
<svg{{ with .size }}
height="{{ . }}" {{ end }}
style="enable-background:new 0 0 100 100;"
version="1.1"
viewBox="0 0 512 512"
width="{{ .size }}"
xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="#418AC9" d="M496.262,58.5c-27.346-21.826-109.516-26.801-177.253-19.826c-66.118,6.812-106.564,23.399-162.844,64.305
c-12.462,9.069-2.103,27.05,12.065,20.644c54.933-24.761,116.668-36.11,176.575-35.83c34.142,0.164,67.924,5.231,101.256,12.275
c15.241,3.23,30.443,7.637,46.082,5.48C519.98,101.726,515.885,74.155,496.262,58.5z"/>
<path d="M120.973,200.133c-4.164-15.958-2.327-29.432,4.04-40.704c-11.816-8.336-30.155-11.045-48.845-5.784
c-28,7.847-46.129,30.506-40.486,50.566c5.637,20.098,32.896,30,60.903,22.13c12.3-3.472,22.698-9.784,30.001-17.491
C124.125,207.154,122.094,204.43,120.973,200.133z"/>
<path d="M107.569,261.129C48.153,261.129,0,309.273,0,368.698c0,59.408,48.152,107.568,107.568,107.568
c59.4,0,107.568-48.16,107.568-107.568C215.137,309.273,166.969,261.129,107.569,261.129z M116.014,442.514
c-35.619,0-64.482-28.863-64.482-64.483s28.863-64.491,64.482-64.491c35.621,0,64.5,28.871,64.5,64.491
C180.514,413.643,151.635,442.514,116.014,442.514z"/>
<path d="M450.973,142.055c-60.101-30.965-333.246-46.697-302.957,55.197c4.896,16.502,26.598,7.2,30.271,6.056
c42.797-13.311,52.512-23.376,84.162-28.389c41.528-6.578,102.953-7.683,118.023,9.963c-43.133,9.878-95.885,11.178-129.871,39.738
c-31.198,26.255-26.029,67.465-15.537,103.513c1.962,6.733,11.988,6.967,13.84,0c6.664-25.143,12.377-38.625,33.783-60.094
c16.854-16.891,47.461-24.652,70.393-29.867c39.349-8.959,67.316-3.518,103.085-12.945c19.079-5.021,29.347-19.865,30.382-35.363
C488.049,167.448,481.479,157.772,450.973,142.055z"/>
<path d="M388.334,261.129c-59.416,0-107.568,48.145-107.568,107.569c0,59.408,48.152,107.568,107.568,107.568
c59.408,0,107.577-48.16,107.577-107.568C495.911,309.273,447.742,261.129,388.334,261.129z M396.781,442.514
c-35.612,0-64.476-28.863-64.476-64.483s28.863-64.491,64.476-64.491c35.62,0,64.491,28.871,64.491,64.491
C461.272,413.643,432.401,442.514,396.781,442.514z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File