init blog (wip)

This commit is contained in:
Hans Pagel
2021-07-09 18:24:23 +02:00
parent 1b7ef80603
commit 2e40a827fb
17 changed files with 748 additions and 6 deletions

View File

@@ -67,8 +67,8 @@
</h3>
<ul>
<li>
<g-link to="/experiments">
Experiments
<g-link to="/blog">
Blog
</g-link>
</li>
<li>

View File

@@ -0,0 +1,50 @@
<template>
<article class="c-post-detail">
<header class="c-post-detail__header text">
<h1 class="c-post-detail__title">
{{ title }}
</h1>
<p class="c-post-detail__meta">
Published
<time :datetime="publishedAt">
{{ formattedPublishedAt }}
</time>
</p>
</header>
<VueRemarkContent class="text" />
</article>
</template>
<script>
import moment from 'moment'
export default {
props: {
title: {
default: null,
type: String,
},
author: {
default: null,
type: String,
},
content: {
default: null,
type: String,
},
publishedAt: {
default: null,
type: String,
},
},
computed: {
formattedPublishedAt() {
return moment(this.publishedAt).format('MMM Do, YYYY')
},
},
}
</script>
<style lang="scss" src="./style.scss"></style>

View File

@@ -0,0 +1,25 @@
.c-post-detail {
&__header {
margin-bottom: 1.5rem;
@media (min-width: 500px) {
margin-bottom: 3rem;
}
}
&__title {
margin: 0;
}
&__meta {
margin: 0.5rem 0 0 0;
--text-color: rgba(var(--text), 0.4);
color: var(--text-color);
}
&__author {
margin: 2rem 0 0 0;
--text-color: rgba(var(--text), 0.4);
color: var(--text-color);
}
}

View File

@@ -0,0 +1,61 @@
<template>
<article class="c-post-preview">
<g-link
:to="link"
class="c-post-preview__link"
>
<h2 class="is-h3 c-post-preview__title">
{{ title }}
</h2>
<p class="c-post-preview__content">
{{ teaser }}
</p>
<p class="c-post-preview__meta">
Published
<time :datetime="publishedAt">
{{ formattedPublishedAt }}
</time>
<template v-if="author">
by {{ author }}
</template>
</p>
</g-link>
</article>
</template>
<script>
import moment from 'moment'
export default {
props: {
title: {
default: null,
type: String,
},
teaser: {
default: null,
type: String,
},
link: {
default: null,
type: String,
},
publishedAt: {
default: null,
type: String,
},
author: {
default: null,
type: String,
},
},
computed: {
formattedPublishedAt() {
return moment(this.publishedAt).format('MMM Do, YYYY')
},
},
}
</script>
<style lang="scss" src="./style.scss"></style>

View File

@@ -0,0 +1,33 @@
.c-post-preview {
margin: 3rem 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
&__link {
text-decoration: none;
display: block;
}
&__title {
margin: 0;
}
&__content {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin: 0.6rem 0;
}
&__meta {
margin: 0;
color: rgba(var(--text), 0.4);
}
}