fixes for new hugo versions
This commit is contained in:
parent
169e0bc31b
commit
8695df0533
@ -1,6 +1,5 @@
|
|||||||
baseURL: https://cantorgymnasium.de/
|
baseURL: https://cantorgymnasium.de/
|
||||||
title: Georg-Cantor-Gymnasium
|
title: Georg-Cantor-Gymnasium
|
||||||
paginate: 8
|
|
||||||
summaryLength: "10"
|
summaryLength: "10"
|
||||||
defaultContentLanguage: de
|
defaultContentLanguage: de
|
||||||
enableEmoji: true
|
enableEmoji: true
|
||||||
|
@ -182,31 +182,21 @@ aliases:
|
|||||||
right: 10,
|
right: 10,
|
||||||
precision: 1,
|
precision: 1,
|
||||||
pieces: [
|
pieces: [
|
||||||
{
|
|
||||||
gt: 0.9,
|
|
||||||
lte: 1.0,
|
|
||||||
color: "#005da9",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
gt: 1.0,
|
gt: 1.0,
|
||||||
lte: 1.5,
|
lte: 1.5,
|
||||||
color: "#0b9834"
|
color: "#06511c",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
gt: 1.5,
|
gt: 1.5,
|
||||||
lte: 2.0,
|
lte: 2.0,
|
||||||
color: "#93CE07"
|
color: "#0b9834"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
gt: 2.0,
|
gt: 2.0,
|
||||||
lte: 2.5,
|
lte: 2.5,
|
||||||
color: "#FBDB0F"
|
color: "#10df4c"
|
||||||
},
|
}
|
||||||
/*{
|
|
||||||
gt: 2.0,
|
|
||||||
lte: 2.5,
|
|
||||||
color: "#FC7D02"
|
|
||||||
},*/
|
|
||||||
],
|
],
|
||||||
outOfRange: {
|
outOfRange: {
|
||||||
color: "#999"
|
color: "#999"
|
||||||
@ -225,16 +215,19 @@ aliases:
|
|||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
yAxis: 1.4
|
yAxis: 1.25
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
yAxis: 1.7
|
yAxis: 1.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
yAxis: 1.75
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
yAxis: 2.0
|
yAxis: 2.0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
yAxis: 2.3
|
yAxis: 2.25
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
47
layouts/partials/_funcs/get-page-images.html
Normal file
47
layouts/partials/_funcs/get-page-images.html
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{{- $imgs := slice }}
|
||||||
|
{{- $imgParams := slice .Params.image | append .Params.images }}
|
||||||
|
{{- $resources := .Resources.ByType "image" -}}
|
||||||
|
{{/* Find featured image resources if the images parameter is empty. */}}
|
||||||
|
{{- if or (not $imgParams) (eq ($imgParams | len) 0) }}
|
||||||
|
{{- $featured := $resources.GetMatch "*feature*" -}}
|
||||||
|
{{- if not $featured }}{{ $featured = $resources.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
||||||
|
{{- with $featured }}
|
||||||
|
{{- $imgs = $imgs | append (dict
|
||||||
|
"Image" .
|
||||||
|
"RelPermalink" .RelPermalink
|
||||||
|
"Permalink" .Permalink) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{/* Use the first one of site images as the fallback. */}}
|
||||||
|
{{- if and (not $imgParams) (not $imgs) }}
|
||||||
|
{{- with site.Params.images }}
|
||||||
|
{{- $imgParams = first 1 . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{/* Parse page's images parameter. */}}
|
||||||
|
{{- range $imgParams }}
|
||||||
|
{{- $img := . }}
|
||||||
|
{{- $url := urls.Parse $img }}
|
||||||
|
{{- if eq $url.Scheme "" }}
|
||||||
|
{{/* Internal image. */}}
|
||||||
|
{{- with $resources.GetMatch $img -}}
|
||||||
|
{{/* Image resource. */}}
|
||||||
|
{{- $imgs = $imgs | append (dict
|
||||||
|
"Image" .
|
||||||
|
"RelPermalink" .RelPermalink
|
||||||
|
"Permalink" .Permalink) }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $imgs = $imgs | append (dict
|
||||||
|
"RelPermalink" (relURL $img)
|
||||||
|
"Permalink" (absURL $img)
|
||||||
|
) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{/* External image */}}
|
||||||
|
{{- $imgs = $imgs | append (dict
|
||||||
|
"RelPermalink" $img
|
||||||
|
"Permalink" $img
|
||||||
|
) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- return $imgs }}
|
@ -51,6 +51,6 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{ partial "opengraph" . }}
|
{{ template "_internal/opengraph.html" . }}
|
||||||
{{ partial "twitter" . }}
|
{{ template "_internal/twitter_cards.html" . }}
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
<meta property="og:title" content="{{ .Title }}" />
|
|
||||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
|
||||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
|
||||||
<meta property="og:url" content="{{ .Permalink }}" />
|
|
||||||
|
|
||||||
{{- with $.Params.images -}}
|
|
||||||
{{- range first 6 . }}<meta property="og:image" data-pagefind-meta="image[content]" content="{{ . | absURL }}" />{{ end -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $images := $.Resources.ByType "image" -}}
|
|
||||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
|
||||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
|
||||||
{{- with $featured -}}
|
|
||||||
<meta property="og:image" data-pagefind-meta="image[content]" content="{{ $featured.Permalink }}"/>
|
|
||||||
{{- else -}}
|
|
||||||
{{- with $.Params.image -}}
|
|
||||||
<meta property="og:image" data-pagefind-meta="image[content]" content="{{ . | absURL }}"/>
|
|
||||||
{{- else -}}
|
|
||||||
{{- with $.Site.Params.images }}<meta property="og:image" data-pagefind-meta="image[content]" content="{{ index . 0 | absURL }}"/>{{ end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- if .IsPage }}
|
|
||||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
|
||||||
<meta property="article:section" content="{{ .Section }}" />
|
|
||||||
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
|
||||||
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
|
||||||
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
|
|
||||||
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
|
|
||||||
{{- with .Params.videos }}{{- range . }}
|
|
||||||
<meta property="og:video" content="{{ . | absURL }}" />
|
|
||||||
{{ end }}{{ end }}
|
|
||||||
|
|
||||||
{{- /* If it is part of a series, link to related articles */}}
|
|
||||||
{{- $permalink := .Permalink }}
|
|
||||||
{{- $siteSeries := .Site.Taxonomies.series }}
|
|
||||||
{{- if $siteSeries }}
|
|
||||||
{{ with .Params.series }}{{- range $name := . }}
|
|
||||||
{{- $series := index $siteSeries ($name | urlize) }}
|
|
||||||
{{- range $page := first 6 $series.Pages }}
|
|
||||||
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
|
|
||||||
{{- end }}
|
|
||||||
{{ end }}{{ end }}
|
|
||||||
{{- end }}
|
|
@ -1,29 +0,0 @@
|
|||||||
{{- with $.Params.images -}}
|
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
|
||||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
|
|
||||||
{{ else -}}
|
|
||||||
{{- $images := $.Resources.ByType "image" -}}
|
|
||||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
|
||||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
|
||||||
{{- with $featured -}}
|
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
|
||||||
<meta name="twitter:image" content="{{ $featured.Permalink }}"/>
|
|
||||||
{{- else -}}
|
|
||||||
{{- with $.Params.image -}}
|
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
|
||||||
<meta name="twitter:image" content="{{ . | absURL }}"/>
|
|
||||||
{{- else -}}
|
|
||||||
{{- with $.Site.Params.images -}}
|
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
|
||||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
|
|
||||||
{{ else -}}
|
|
||||||
<meta name="twitter:card" content="summary"/>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end }}
|
|
||||||
<meta name="twitter:title" content="{{ .Title }}"/>
|
|
||||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
|
|
||||||
{{ with .Site.Social.twitter -}}
|
|
||||||
<meta name="twitter:site" content="@{{ . }}"/>
|
|
||||||
{{ end -}}
|
|
@ -27,7 +27,7 @@
|
|||||||
<div class="card d-flex flex-row flex-wrap-reverse">
|
<div class="card d-flex flex-row flex-wrap-reverse">
|
||||||
<div class="flex-grow card-body min-w-0">
|
<div class="flex-grow card-body min-w-0">
|
||||||
<a href="{{ .Permalink }}"><h3 class="card-title">{{ .Title }}</h3></a>
|
<a href="{{ .Permalink }}"><h3 class="card-title">{{ .Title }}</h3></a>
|
||||||
{{ range (getJSON "static/data/abiturdurchschnitte.json").abiturdurchschnitte }}
|
{{ range (resources.Get "data/abiturdurchschnitte.json" | transform.Unmarshal).abiturdurchschnitte }}
|
||||||
{{ if eq (string .jahr) $.Title }}<a href="/chronikseiten/abiturdurchschnitte" class="h4 card-text">Abiturdurchschnitt: {{ .schnitt }}</a>{{ end }}
|
{{ if eq (string .jahr) $.Title }}<a href="/chronikseiten/abiturdurchschnitte" class="h4 card-text">Abiturdurchschnitt: {{ .schnitt }}</a>{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -376,15 +376,6 @@ const SettingsCollection = {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
Title(false),
|
Title(false),
|
||||||
{
|
|
||||||
name: "paginate",
|
|
||||||
label: "Anzahl der Seitenelemente",
|
|
||||||
widget: "number",
|
|
||||||
value_type: "int",
|
|
||||||
min: 1,
|
|
||||||
step: 1,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "summaryLength",
|
name: "summaryLength",
|
||||||
label: "Länge von Zusammenfassungen (Zeichenanzahl)",
|
label: "Länge von Zusammenfassungen (Zeichenanzahl)",
|
||||||
|
@ -12,7 +12,7 @@ const StatsCollection = {
|
|||||||
{
|
{
|
||||||
name: "abiturdurchschnitte",
|
name: "abiturdurchschnitte",
|
||||||
label: "Abiturdurchschnitte",
|
label: "Abiturdurchschnitte",
|
||||||
file: "static/data/abiturdurchschnitte.json",
|
file: "assets/data/abiturdurchschnitte.json",
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "abiturdurchschnitte",
|
name: "abiturdurchschnitte",
|
||||||
@ -43,7 +43,7 @@ const StatsCollection = {
|
|||||||
{
|
{
|
||||||
name: "schuelerzahlen",
|
name: "schuelerzahlen",
|
||||||
label: "Schülerzahlen",
|
label: "Schülerzahlen",
|
||||||
file: "static/data/schuelerzahlen.json",
|
file: "assets/data/schuelerzahlen.json",
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "schuelerzahlen",
|
name: "schuelerzahlen",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user