Add blog posts to front page
This commit is contained in:
parent
4abc52a274
commit
fb14b39f4a
|
@ -91,7 +91,7 @@ main {
|
|||
padding: 1rem;
|
||||
|
||||
& > :last-child {
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
& > p > img {
|
||||
|
@ -157,26 +157,55 @@ nav {
|
|||
article {
|
||||
display: flex;
|
||||
|
||||
& > .text {
|
||||
width: 100%;
|
||||
|
||||
@media screen and (min-width: $small) {
|
||||
width: 40%;
|
||||
}
|
||||
}
|
||||
|
||||
& > .image {
|
||||
display: none;
|
||||
text-align: right;
|
||||
|
||||
& > img {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media screen and (min-width: $small) {
|
||||
display: block;
|
||||
padding-left: 1.5em;
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
& > img {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
&.preview {
|
||||
margin-bottom: 3rem;
|
||||
|
||||
& > .image {
|
||||
align-items: center;
|
||||
height: 200px;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
padding-right: 1.5rem;
|
||||
width: 200px;
|
||||
|
||||
@media screen and (min-width: $small) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
& > .text {
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&.page {
|
||||
& > .image {
|
||||
text-align: right;
|
||||
|
||||
@media screen and (min-width: $small) {
|
||||
padding-left: 1.5em;
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
& > .text {
|
||||
width: 100%;
|
||||
|
||||
@media screen and (min-width: $small) {
|
||||
width: 40%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -219,6 +248,14 @@ hr {
|
|||
}
|
||||
}
|
||||
|
||||
.date {
|
||||
margin-bottom: 0;
|
||||
|
||||
@media screen and (min-width: $small) {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-burger {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
|
|
|
@ -7,3 +7,5 @@ menu:
|
|||
|
||||
![kontakt – Das Kulturfestival (Symbolbild)](/symbolbild.jpg)
|
||||
by [ChrisU](https://instagram.com/chrisu_photography)
|
||||
|
||||
# Aktuelles
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<h1>{{ .Title }}</h1>
|
||||
{{ $textContent := .Content }}
|
||||
{{ with .Resources.GetMatch "image.jpg" }}
|
||||
<article>
|
||||
<article class="page">
|
||||
<section class="text">{{ $textContent }}</section>
|
||||
<section class="image">
|
||||
<img alt="{{ .Title }}" src="{{ .RelPermalink }}">
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
{{ $pagination := .Paginate .RegularPages }}
|
||||
{{ with .Content }}{{ with $pagination.Pages }}<hr>{{ end }}{{ end }}
|
||||
{{ $days := dict "Monday" "Mo" "Tuesday" "Di" "Wednesday" "Mi" "Thursday" "Do" "Friday" "Fr" "Saturday" "Sa" "Sunday" "So" }}
|
||||
{{ $months := dict "January" "Januar" "February" "Februar" "March" "März" "April" "April" "May" "Mai" "June" "Juni" "July" "Juli" "August" "August" "September" "September" "October" "Oktober" "November" "November" "December" "Dezember" }}
|
||||
{{ range $pagination.Pages }}
|
||||
<h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
|
||||
{{ .Content }}
|
||||
{{ if ne .Slug (index (last 1 $pagination.Pages) 0).Slug }}<hr>{{ end }}
|
||||
<p class="date">{{ index $days (.Date.Format "Monday") }}, {{ .Date.Format "02" }}. {{ index $months (.Date.Format "January") }} {{ .Date.Format "2006" }}</p>
|
||||
{{ $page := . }}
|
||||
<article class="preview">
|
||||
{{ with .Resources.GetMatch "image.jpg" }}
|
||||
<section class="image"><img alt="{{ .Title }}" src="{{ .RelPermalink }}"></section>
|
||||
{{ end }}
|
||||
<section class="text">
|
||||
<h2><a href="{{ $page.RelPermalink }}">{{ $page.Title }}</a></h2>
|
||||
{{ $page.Summary }}
|
||||
</section>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ with $pagination }}
|
||||
{{ if gt .TotalPages 1 }}
|
||||
|
|
Loading…
Reference in New Issue