Created
November 17, 2019 20:13
-
-
Save zackproser/2790caff7de86b8307492c8e40284fe4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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