Create shortcodes and integration of press articles

This commit is contained in:
Christian Wolf 2024-02-14 13:54:18 +01:00
parent 9879042e6e
commit 08b286faf5
4 changed files with 54 additions and 15 deletions

View File

@ -969,6 +969,36 @@ table.time {
} }
} }
.press-articles {
margin: 0 0 2em;
.press-article {
border-bottom: solid 1px $color-hor-line;
margin: 0 0 3em;
padding: 0 0 3em;
&:nth-last-of-type(1) {
border-bottom: none;
padding: 0;
margin: 0;
}
.press-img img {
display: block;
margin: 1em auto;
}
.metadata {
span {
display: block;
&.date {
font-weight: bold;
}
}
}
}
}
.iframe-generic { .iframe-generic {
display: block; display: block;
width: 100%; width: 100%;

View File

@ -3,22 +3,17 @@
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
</a> </a>
{{ .Content }} {{ .Content }}
{{ range .Pages.ByPublishDate.Reverse }} <div class="press-articles">
<div class="press-article"> {{ range .Pages.ByPublishDate.Reverse }}
<div class="title">{{ .Title }}</div> <div class="press-article">
<div class="metadata"> <h2 class="title">{{ .Title }}</h2>
<span class="date">{{ .Date.Format "02.01.2006" }}</span> <div class="metadata">
{{ with .Param "source" }}<span class="source">{{ . }}</span>{{ end }} <span class="date">{{ .Date.Format "02.01.2006" }}</span>
{{ with .Param "source" }}<span class="source">Quelle: {{ . }}</span>{{ end }}
</div>
<div class="content">{{ .Content }}</div>
</div> </div>
<div class="content">{{ .Content }}</div> {{ end }}
</div> </div>
<!--<p>
<h3><a class="title" href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
{{ partial "metadata.html" . }}
<a class="summary" href="{{ .RelPermalink }}">
<p>{{ .Content }}</p>
</a>
</p>-->
{{ end }}
{{ partial "totop" }} {{ partial "totop" }}
{{ end }} {{ end }}

View File

@ -0,0 +1,7 @@
<!--
{{ .Get "url"}}{{ page.Resources}}
-->
{{ $res := page.Resources.GetMatch (.Get "url") }}
<a target="_blank" class="download press-download" href="{{ $res.RelPermalink }}">
{{ .Inner }}
</a>

View File

@ -0,0 +1,7 @@
<!--
{{ .Get "src"}}{{ page.Resources}}
-->
<div class="press-img">
{{- $res := page.Resources.GetMatch (.Get "src") -}}
<img{{ with .Get "alt" }} alt="{{ . }}"{{ end }} src="{{ $res.RelPermalink }}">
</div>