Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-08 10:19:49 +02:00
parent 7ef9274268
commit ccabcf9d5b
10 changed files with 119 additions and 21 deletions

View File

@@ -21,3 +21,19 @@ h6 {
margin: 0;
font-weight: 500;
}
figure {
margin: 0;
}
body {
margin: 0.5rem;
min-height: calc(100vh - 1rem);
display: flex;
flex-direction: column;
main {
flex: 1;
}
}

11
assets/sass/content.scss Normal file
View File

@@ -0,0 +1,11 @@
.content {
max-width: $width-content;
margin: 0 auto;
padding: 2rem;
}
@media (max-width: $width-mobile) {
.content {
padding: 1rem;
}
}

27
assets/sass/hero.scss Normal file
View File

@@ -0,0 +1,27 @@
.hero {
max-width: $width-content;
margin: 0 auto;
padding: 2rem 2rem 0 2rem;
.meta {
font-size: 0.8rem;
.date {
color: var(--text-600);
}
.duration {
color: color-mix(in srgb, var(--text) 50%, var(--background));
}
}
}
.hero + .content {
padding-top: 0;
}
@media (max-width: $width-mobile) {
.hero {
padding: 1rem 1em 0 1rem;
}
}

15
assets/sass/image.scss Normal file
View File

@@ -0,0 +1,15 @@
.image {
width: 100%;
padding: 1rem 0;
img {
width: 100%;
display: block;
}
figcaption {
text-align: center;
padding-top: 0.5rem;
color: color-mix(in srgb, var(--text) 50%, var(--background));
}
}

View File

@@ -4,9 +4,12 @@ $width-max: 60rem;
@import "colors";
@import "fonts";
@import "size";
@import "common";
@import "image";
@import "header";
@import "posts";
@import "content";
@import "hero";
@import "footer";

View File

@@ -12,10 +12,6 @@
font-size: 2.25rem;
}
.summary {
font-size: 1.1rem;
}
.meta {
font-size: 0.8rem;
@@ -34,3 +30,13 @@
color: var(--text-900);
}
}
@media (max-width: $width-mobile) {
.posts-list {
.post {
&:not(:first-child) {
margin-top: 2rem;
}
}
}
}

View File

@@ -1,16 +0,0 @@
body {
margin: 0.5rem;
min-height: calc(100vh - 1rem);
display: flex;
flex-direction: column;
main {
flex: 1;
.content {
max-width: $width-content;
margin: 0 auto;
padding: 2.5rem;
}
}
}

View File

@@ -0,0 +1,8 @@
{{ define "main" }}
<main>
{{ partial (printf "posts/%s.html" (.Params.heroType | default "hero")) . }}
<div class="content">
{{ .Content }}
</div>
</main>
{{ end }}

View File

@@ -0,0 +1,12 @@
{{- $path := .path -}}
{{- $alt := .alt -}}
{{- $caption := .caption -}}
{{ if $path }}
<figure class="image">
<img src="{{- $path | absURL -}}" {{ with $alt }}alt="{{- . -}}"{{ end }} />
{{ with $caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure>
{{ end }}

View File

@@ -0,0 +1,16 @@
<section class="hero">
<h1>{{ .Title }}</h1>
<div class="meta">
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
&middot;
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
</div>
{{ with .Params.heroImage }}
{{ partial "image.html" (dict
"path" .path
"alt" .alt
"caption" .caption
)
}}
{{ end }}
</section>