gcg-website/layouts/schulchronik/single.html
Denys Konovalov d4f3400ad6
All checks were successful
continuous-integration/drone/push Build is passing
Chronik Update
2023-02-09 19:58:09 +01:00

64 lines
2.3 KiB
HTML

{{ define "main" }}
<section class="section-sm">
<div class="container">
<div class="row">
<div class="col-12 mb-4">
{{ if .Params.Cantorpreisträger }}
<div class="col-12">
<h2 class="mb-3">{{ i18n "cantorpreisträger" }}</h2>
{{ range where (where .Site.RegularPages "Title" .Params.Title ) "Type" "=" "cantorpreis" }}
<div class="d-flex justify-content-between align-items-center flex-wrap">
<div class="media mb-2 mb-sm-0 align-items-center">
<img class="mr-4 img-fluid person-thumb-sm" src="{{ .Params.Image | relURL }}" alt="{{ .Title }}">
<div class="media-body">
<h4 class="mt-0"><a href="{{ .Permalink }}">{{ .Params.Name }}</a></h4>
{{ .Description }}
</div>
</div>
</div>
{{ end }}
<div class="border-bottom border-primary mt-4"></div>
</div>
{{ end }}
{{ range .Params.topics }}
{{ partial "chronik-modal" (dict "id" (md5 .title) "title" .title "content" .content) }}
{{ end }}
{{ if and .Params.pretext (ne .Params.pretext "\n\n\n") }}
{{ partial "chronik-modal" (dict "id" "pretext" "title" .Title "content" .Params.pretext) }}
{{ end }}
<div id="wc-canvas"></div>
{{ $topics := slice (slice .Params.Title 100 "pretext") }}
{{ range .Params.topics }}
{{ $topics = $topics | append (slice (slice .title 40 (md5 .title) )) }}
{{ end }}
{{ $topics = $topics | jsonify }}
<script>
WordCloud(
document.getElementById('wc-canvas'),
{
click: function (item) {
if (item[1] != 100 || (item[1] == 100 && item[2] == "pretext")) {
$('#' + item[2]).modal('show');
}
},
color: function (word, weight) {
return (weight === 100) ? '#ffbc3b' : '#1a1a37';
},
fontFamily: 'Fira Sans, serif',
fontWeight: 700,
list: JSON.parse("{{ $topics }}"),
shrinkToFit: true,
gridSize: 25,
rotateRatio: 0,
}
);
</script>
{{ .Content }}
</div>
</div>
</div>
</section>
{{ end }}