Style blog previes on homepage, add headers for articles and author field

This commit is contained in:
Konstantin Kollar
2022-10-05 22:59:57 +02:00
parent 2178454478
commit a83381b903
23 changed files with 389 additions and 97 deletions
+266 -38
View File
@@ -1383,8 +1383,8 @@ video {
left: 0px;
}
.z-50 {
z-index: 50;
.m-4 {
margin: 1rem;
}
.mx-2 {
@@ -1402,8 +1402,12 @@ video {
margin-right: 1rem;
}
.mt-6 {
margin-top: 1.5rem;
.mb-8 {
margin-bottom: 2rem;
}
.mt-10 {
margin-top: 2.5rem;
}
.ml-4 {
@@ -1414,10 +1418,6 @@ video {
margin-right: 1rem;
}
.mb-8 {
margin-bottom: 2rem;
}
.ml-6 {
margin-left: 1.5rem;
}
@@ -1434,8 +1434,24 @@ video {
margin-top: 2rem;
}
.mt-10 {
margin-top: 2.5rem;
.mb-4 {
margin-bottom: 1rem;
}
.mt-4 {
margin-top: 1rem;
}
.mt-6 {
margin-top: 1.5rem;
}
.mb-2 {
margin-bottom: 0.5rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.block {
@@ -1462,6 +1478,20 @@ video {
height: 2.5rem;
}
.h-16 {
height: 4rem;
}
.h-32 {
height: 8rem;
}
.h-fit {
height: -webkit-fit-content;
height: -moz-fit-content;
height: fit-content;
}
.min-h-\[80vh\] {
min-height: 80vh;
}
@@ -1494,22 +1524,84 @@ video {
width: 83.333333%;
}
.w-16 {
width: 4rem;
}
.w-14 {
width: 3.5rem;
}
.w-12 {
width: 3rem;
}
.w-8 {
width: 2rem;
}
.w-6 {
width: 1.5rem;
}
.w-1\/2 {
width: 50%;
}
.w-3\/5 {
width: 60%;
}
.w-7\/12 {
width: 58.333333%;
}
.w-2\/3 {
width: 66.666667%;
}
.w-auto {
width: auto;
}
.w-32 {
width: 8rem;
}
.w-fit {
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.max-w-sm {
max-width: 24rem;
}
.grow-0 {
flex-grow: 0;
.flex-initial {
flex: 0 1 auto;
}
.grow {
flex-grow: 1;
}
.grow-0 {
flex-grow: 0;
}
.basis-1\/4 {
flex-basis: 25%;
}
.basis-2\/3 {
flex-basis: 66.666667%;
}
.basis-3\/4 {
flex-basis: 75%;
}
.cursor-pointer {
cursor: pointer;
}
@@ -1538,12 +1630,20 @@ video {
flex-direction: column;
}
.items-center {
align-items: center;
.flex-wrap {
flex-wrap: wrap;
}
.justify-start {
justify-content: flex-start;
.place-content-center {
place-content: center;
}
.content-center {
align-content: center;
}
.items-center {
align-items: center;
}
.justify-center {
@@ -1554,10 +1654,27 @@ video {
justify-content: space-between;
}
.gap-2 {
gap: 0.5rem;
}
.gap-4 {
gap: 1rem;
}
.gap-8 {
gap: 2rem;
}
.gap-y-4 {
row-gap: 1rem;
}
.gap-x-8 {
-moz-column-gap: 2rem;
column-gap: 2rem;
}
.overflow-y-auto {
overflow-y: auto;
}
@@ -1609,9 +1726,9 @@ video {
border-color: rgb(212 212 212 / var(--tw-border-opacity));
}
.bg-white {
.bg-neutral-100 {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
}
.bg-primary-400 {
@@ -1624,24 +1741,14 @@ video {
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
}
.bg-primary-300 {
.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(233 241 255 / var(--tw-bg-opacity));
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.bg-neutral-200 {
--tw-bg-opacity: 1;
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
}
.bg-neutral-100 {
--tw-bg-opacity: 1;
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
}
.bg-neutral-50 {
--tw-bg-opacity: 1;
background-color: rgb(250 250 250 / var(--tw-bg-opacity));
.object-center {
-o-object-position: center;
object-position: center;
}
.p-4 {
@@ -1658,6 +1765,11 @@ video {
padding-right: 2rem;
}
.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}
.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
@@ -1668,9 +1780,14 @@ video {
padding-right: 0.5rem;
}
.px-4 {
padding-left: 1rem;
padding-right: 1rem;
.px-0 {
padding-left: 0px;
padding-right: 0px;
}
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.pt-4 {
@@ -1691,6 +1808,21 @@ video {
line-height: 1.75rem;
}
.text-xl {
font-size: 1.25rem;
line-height: 1.75rem;
}
.text-2xl {
font-size: 1.5rem;
line-height: 2rem;
}
.text-3xl {
font-size: 1.875rem;
line-height: 2.25rem;
}
.font-bold {
font-weight: 700;
}
@@ -1704,6 +1836,11 @@ video {
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.text-neutral-600 {
--tw-text-opacity: 1;
color: rgb(82 82 82 / var(--tw-text-opacity));
}
.text-primary-400 {
--tw-text-opacity: 1;
color: rgb(123 164 238 / var(--tw-text-opacity));
@@ -1719,14 +1856,34 @@ video {
color: rgb(115 115 115 / var(--tw-text-opacity));
}
.text-neutral-800 {
--tw-text-opacity: 1;
color: rgb(38 38 38 / var(--tw-text-opacity));
}
.text-neutral-700 {
--tw-text-opacity: 1;
color: rgb(64 64 64 / var(--tw-text-opacity));
}
.text-neutral-600 {
.text-primary-700 {
--tw-text-opacity: 1;
color: rgb(82 82 82 / var(--tw-text-opacity));
color: rgb(7 12 20 / var(--tw-text-opacity));
}
.text-primary-600 {
--tw-text-opacity: 1;
color: rgb(35 69 131 / var(--tw-text-opacity));
}
.text-neutral-400 {
--tw-text-opacity: 1;
color: rgb(163 163 163 / var(--tw-text-opacity));
}
.underline {
-webkit-text-decoration-line: underline;
text-decoration-line: underline;
}
.no-underline {
@@ -1795,6 +1952,26 @@ video {
width: 66.666667%;
}
.md\:flex-grow-0 {
flex-grow: 0;
}
.md\:grow-0 {
flex-grow: 0;
}
.md\:flex-row {
flex-direction: row;
}
.md\:flex-nowrap {
flex-wrap: nowrap;
}
.md\:justify-center {
justify-content: center;
}
.md\:border-x-\[20px\] {
border-left-width: 20px;
border-right-width: 20px;
@@ -1812,6 +1989,10 @@ video {
}
@media (min-width: 1024px) {
.lg\:col-span-2 {
grid-column: span 2 / span 2;
}
.lg\:mr-6 {
margin-right: 1.5rem;
}
@@ -1828,6 +2009,22 @@ video {
width: 100%;
}
.lg\:w-20 {
width: 5rem;
}
.lg\:flex-none {
flex: none;
}
.lg\:flex-initial {
flex: 0 1 auto;
}
.lg\:grow-0 {
flex-grow: 0;
}
.lg\:basis-2\/3 {
flex-basis: 66.666667%;
}
@@ -1836,7 +2033,38 @@ video {
flex-basis: 33.333333%;
}
.lg\:basis-1\/4 {
flex-basis: 25%;
}
.lg\:basis-3\/4 {
flex-basis: 75%;
}
.lg\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lg\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lg\:flex-row {
flex-direction: row;
}
.lg\:flex-nowrap {
flex-wrap: nowrap;
}
.lg\:py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
}
@media (min-width: 1280px) {
.xl\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@@ -11,7 +11,7 @@
<div class="mb-8 grow">
<div class="" id="content">
<div class="flex justify-center">
<div class="md:w-2/3 md:px-0 px-8">
<div class="md:w-2/3 md:px-0 px-2">
{{- block "main" . }}{{- end }}
</div>
</div>
@@ -25,7 +25,7 @@
id="to-top-button"
onclick="goToTop()"
title="Go To Top"
class="hidden md:hidden fixed z-90 bottom-6 right-8 border-0 w-20 h-20 rounded-full drop-shadow-md hover:bg-primary-500 border-4 border-white bg-primary-400 text-white text-4xl font-bold"
class="hidden md:hidden fixed z-90 bottom-6 right-8 border-0 w-16 h-16 rounded-full drop-shadow-md hover:bg-primary-500 border-4 border-white bg-primary-400 text-white text-4xl font-bold"
>
&uarr;
</button>
+1 -1
View File
@@ -3,7 +3,7 @@
<div class="mx-2 md:mx-0">
<img src="/img/header.jpg" class="lg:w-full my-4" />
</div>
<div class="flex flex-col lg:flex-row px-6 md:px-0">
<div class="flex flex-col lg:flex-row px-2 md:px-0">
<div class="basis-1/1 lg:basis-2/3 lg:mr-6 min-h-[200vh] border-2">
{{ range (.Paginate $p 3 ).Pages }}
{{- partial "blog-preview-homepage.html"
@@ -1,4 +1,30 @@
<div>
<div><a href="{{ .Permalink }}">{{ .Title }}</a></div>
<div>{{ .Summary }}</div>
<div class="m-4">
<div class="mb-4">
<a class="text-3xl font-bold text-neutral-800" href="{{ .Permalink }}"
>{{ .Title }}</a
>
</div>
<div class="grid xl:grid-cols-3 grid-cols-1 justify-center gap-x-8">
<div class="flex flex-col justify-center h-fit mb-2">
{{ $image := .Resources.GetMatch "header" }}
{{ with $image }}
{{ $image := $image.Crop "512x512 Center" }}
<img class="" src="{{ $image.RelPermalink }}" />
{{ end }}
<span class="mt-4 text-neutral-500">{{ .Param "author" }}</span>
<span class="text-neutral-500"
>{{ .Date | time.Format ":date_long" }}</span
>
</div>
<div class="prose lg:col-span-2">
{{ .Summary }}
<div class="mt-6">
<a
class="underline text-primary-600 hover:text-primary-500"
href="{{ .Permalink }}"
>Weiterlesen...</a
>
</div>
</div>
</div>
</div>
@@ -6,7 +6,7 @@
class="flex grid-rows-1 grid-cols-2 justify-between items-center w-full md:w-2/3 px-6 md:px-0"
>
<a href="/" class="flex flex-row items-center" aria-label="logo">
<img class="w-20 py-4" src="/img/logo.svg" />
<img class="w-14 lg:w-20 py-2 lg:py-4" src="/img/logo.svg" />
<h1 class="text-4xl text-primary-400 ml-4 font-bold hidden lg:inline">
Das Knäckeboot
</h1>
@@ -1,17 +1,17 @@
<nav>
<div class="hidden md:flex">
{{ range .Site.Menus.main }}
<a
class="px-2 mx-2 text-lg text-primary-500 font-semibold hover:underline"
href="{{ .URL }}"
>{{ .Name }}</a
>
<a
class="px-2 mx-2 text-lg text-primary-500 font-semibold hover:underline"
href="{{ .URL }}"
>{{ .Name }}</a
>
{{ end }}
</div>
<div class="md:hidden mr-4 pt-4">
<button class="navbar-burger">
<svg viewBox="0 0 10 8" width="" class="w-10">
<svg viewBox="0 0 10 8" width="" class="w-6">
<path
d="M1 1h8M1 4h 8M1 7h8"
stroke="#FFFFFF"
@@ -26,12 +26,12 @@
<nav class="navbar-menu absolute hidden">
<div class="navbar-backdrop fixed inset-0 bg-gray-800 opacity-25"></div>
<div
class="fixed top-0 left-0 bottom-0 flex flex-col w-5/6 max-w-sm bg-primary-400 border-r-2 border-neutral-300 overflow-y-auto"
class="fixed top-0 left-0 bottom-0 flex flex-col w-2/3 max-w-sm bg-primary-400 border-r-2 border-neutral-300 overflow-y-auto"
>
<div
class="grid grid-rows-1 grid-cols-2 justify-between items-center mb-8 bg-white shadow-md"
>
<a href="/"> <img class="w-20 py-4 ml-6" src="/img/logo.svg" /></a>
<a href="/"> <img class="w-14 py-2 ml-6" src="/img/logo.svg" /></a>
<button class="navbar-close ml-auto mr-6">
<svg
class="h-10 w-10 text-primary-400 cursor-pointer hover:text-primary-500"
@@ -50,16 +50,20 @@
</button>
</div>
<div class="mt-8 grid grid-cols-1 gap-y-4">
{{ range .Site.Menus.main }}
<a
class="text-l mx-4 p-4 font-semibold text-white text-center no-underline hover:bg-primary-500 rounded"
href="{{ .URL }}"
>{{ .Name }}</a
href="/"
>Home</a
>
{{ range .Site.Menus.main }}
<a
class="text-l mx-4 p-4 font-semibold text-white text-center no-underline hover:bg-primary-500 rounded"
href="{{ .URL }}"
>{{ .Name }}</a
>
{{ end }}
</div>
</div>
</nav>
<script src="js/mobile-menu.js"></script>
<script src="/js/mobile-menu.js"></script>