init blog (wip)
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user