init blog (wip)
This commit is contained in:
@@ -67,8 +67,8 @@
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<g-link to="/experiments">
|
||||
Experiments
|
||||
<g-link to="/blog">
|
||||
Blog
|
||||
</g-link>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
50
docs/src/components/PostDetail/index.vue
Normal file
50
docs/src/components/PostDetail/index.vue
Normal 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>
|
||||
25
docs/src/components/PostDetail/style.scss
Normal file
25
docs/src/components/PostDetail/style.scss
Normal 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);
|
||||
}
|
||||
}
|
||||
61
docs/src/components/PostPreview/index.vue
Normal file
61
docs/src/components/PostPreview/index.vue
Normal 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>
|
||||
33
docs/src/components/PostPreview/style.scss
Normal file
33
docs/src/components/PostPreview/style.scss
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user