mat.services/pages/blog/index.vue

50 lines
996 B
Vue
Raw Normal View History

2018-10-14 06:45:44 +00:00
<template lang="pug">
2018-10-18 05:13:18 +00:00
ul.blog-items
li.blog-item(v-for='(post, index) in listing' v-if='!post.draft')
nuxt-link(:to='post.path')
span.post-title {{ post.title }}
span.post-date {{ post.date | prettifyDate }}
.post-tagline {{ post.tagline }}
2018-10-18 06:19:46 +00:00
hr(v-if='last(index)')
2018-10-14 06:45:44 +00:00
</template>
<script>
export default {
2018-10-18 05:13:18 +00:00
async asyncData({ app }) {
2018-10-14 06:45:44 +00:00
return {
2018-10-18 06:19:46 +00:00
listing:
(await app
.$content('/')
.query({ exclude: ['body', 'meta', 'permalink', 'anchors'] })
.getAll()) || payload,
2018-10-14 06:45:44 +00:00
}
},
2018-10-18 06:19:46 +00:00
methods: {
last(index) {
return index < this.listing.length - 1
},
},
layout: 'compact',
2018-10-14 06:45:44 +00:00
}
</script>
2018-10-18 05:13:18 +00:00
<style lang="sass" scoped>
@import '~assets/sass/utilities'
.blog-items
+desktop
width: 75%
margin: 0 auto
.blog-item
margin-bottom: 3rem
.post-title
font-size: $size-medium
.post-date
float: right
.post-tagline
font-size: $size-normal
color: $grey-light
margin-bottom: 1rem
width: fit-content
</style>