Add announcements to left side bar

This commit is contained in:
Christian Wolf 2024-01-04 17:41:21 +01:00
parent 04c9f04146
commit 1a5a525077
4 changed files with 63 additions and 9 deletions

View File

@ -144,12 +144,41 @@ h1 {
display: flex; display: flex;
margin: auto; margin: auto;
> .left-menu { > .left-side {
width: 180px;
margin-right: 40px;
flex: auto 0 0; flex: auto 0 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-right: 40px;
.announcements {
margin-top: 20px;
background-color: #ececec;
.entry {
margin: 25px 0;
padding: 0 15px;
&:first-child {
margin-top: 15px;
}
&:last-child {
margin-bottom: 15px;
}
.time {
font-weight: bold;
}
a {
color: black;
}
}
}
}
.left-menu {
width: 180px;
display: flex;
flex-direction: column;
> a { > a {
text-decoration: none; text-decoration: none;
@ -410,6 +439,16 @@ h1 {
} }
} }
.announcement-list {
.entry {
margin: 0 30px;
.time {
font-weight: bold;
margin-right: 10px;
}
}
}
.tsc-image { .tsc-image {
margin: 0 auto; margin: 0 auto;
width: fit-content; width: fit-content;

View File

@ -7,12 +7,12 @@
{{ $announcements := partial "get-announcement-list" . }} {{ $announcements := partial "get-announcement-list" . }}
{{ range $announcements }} {{ range $announcements }}
{{ $urlBlogEntry := .RelPermalink}} {{ $urlBlogEntry := .RelPermalink}}
<div class="blog-entry"> <div class="entry">
<div class="header"> <span class="time">
{{ (time.AsTime .Params.announcement.date).Format "02.01.2006" }} {{ (time.AsTime .Params.announcement.date).Format "02.01.2006" }}
</span>
<a href="{{ $urlBlogEntry }}">{{ with .Params.announcement.name }}{{.}}{{else}}{{.Title}}{{end}}</a> <a href="{{ $urlBlogEntry }}">{{ with .Params.announcement.name }}{{.}}{{else}}{{.Title}}{{end}}</a>
</div> </div>
</div>
{{ else }} {{ else }}
Aktuell gibt es keine angekündigten Termine. Aktuell gibt es keine angekündigten Termine.
{{ end }} {{ end }}

View File

@ -6,9 +6,12 @@
{{- partial "page/header.html" . -}} {{- partial "page/header.html" . -}}
<div class="main"> <div class="main">
{{ block "left" . }} {{ block "left" . }}
<div class="left-side">
<div class="left-menu"> <div class="left-menu">
{{- partial "page/left_menu" . -}} {{- partial "page/left_menu" . -}}
</div> </div>
{{- partial "page/left-announcements" . -}}
</div>
{{ end }} {{ end }}
<div id="content"> <div id="content">
{{- block "main" . -}}{{- end -}} {{- block "main" . -}}{{- end -}}

View File

@ -0,0 +1,12 @@
{{ $announcements := partial "get-announcement-list" . }}
<div class="announcements">
{{ range $announcements }}
{{ $urlBlogEntry := .RelPermalink}}
<div class="entry">
<div class="time">
{{ (time.AsTime .Params.announcement.date).Format "02.01.2006" }}
</div>
<a href="{{ $urlBlogEntry }}">{{ with .Params.announcement.name }}{{.}}{{else}}{{.Title}}{{end}}</a>
</div>
{{ end }}
</div>