@@ -21,3 +21,19 @@ h6 {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
font-weight: 500;
|
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
11
assets/sass/content.scss
Normal 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
27
assets/sass/hero.scss
Normal 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
15
assets/sass/image.scss
Normal 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));
|
||||||
|
}
|
||||||
|
}
|
@@ -4,9 +4,12 @@ $width-max: 60rem;
|
|||||||
|
|
||||||
@import "colors";
|
@import "colors";
|
||||||
@import "fonts";
|
@import "fonts";
|
||||||
@import "size";
|
|
||||||
@import "common";
|
@import "common";
|
||||||
|
|
||||||
|
@import "image";
|
||||||
|
|
||||||
@import "header";
|
@import "header";
|
||||||
@import "posts";
|
@import "posts";
|
||||||
|
@import "content";
|
||||||
|
@import "hero";
|
||||||
@import "footer";
|
@import "footer";
|
||||||
|
@@ -12,10 +12,6 @@
|
|||||||
font-size: 2.25rem;
|
font-size: 2.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
|
|
||||||
@@ -34,3 +30,13 @@
|
|||||||
color: var(--text-900);
|
color: var(--text-900);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: $width-mobile) {
|
||||||
|
.posts-list {
|
||||||
|
.post {
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
8
layouts/_default/single.html
Normal file
8
layouts/_default/single.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<main>
|
||||||
|
{{ partial (printf "posts/%s.html" (.Params.heroType | default "hero")) . }}
|
||||||
|
<div class="content">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{{ end }}
|
12
layouts/partials/image.html
Normal file
12
layouts/partials/image.html
Normal 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 }}
|
16
layouts/partials/posts/hero.html
Normal file
16
layouts/partials/posts/hero.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<section class="hero">
|
||||||
|
<h1>{{ .Title }}</h1>
|
||||||
|
<div class="meta">
|
||||||
|
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||||
|
·
|
||||||
|
<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>
|
Reference in New Issue
Block a user