Skip to content

Instantly share code, notes, and snippets.

@zackproser
Created November 17, 2019 20:13
Show Gist options
  • Save zackproser/2790caff7de86b8307492c8e40284fe4 to your computer and use it in GitHub Desktop.
Save zackproser/2790caff7de86b8307492c8e40284fe4 to your computer and use it in GitHub Desktop.
<template>
<div>
<exhibit prefix="software" :slug="slug" :posts="posts" />
</div>
</template>
<script>
import Exhibit from '~/components/Exhibit.vue'
export default {
layout: 'zack-proser',
name: 'Software',
components: {
Exhibit
},
props: ['slug'],
async asyncData() {
const resolve = require.context('~/posts/', true, /\.md$/)
const imports = resolve
.keys()
.map((key) => {
const [, slug] = key.match(/\/(.+)\.md$/)
return Object.assign(resolve(key), { slug })
})
.filter((post) => post.attributes.category == 'software')
return {
posts: imports
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment