Skip to content

Instantly share code, notes, and snippets.

@egoist
Last active October 15, 2019 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egoist/93542976d72464caf7be5fc70216017b to your computer and use it in GitHub Desktop.
Save egoist/93542976d72464caf7be5fc70216017b to your computer and use it in GitHub Desktop.
<template>
<div>{{ page.profile.name }}</div>
</template>
<script>
export default {
props: ['page']
}
</script>
exports.onCreatePages = async function() {
const profile = await fetchProfileFromApi()
// e.g. { name: 'egoist' }
await this.pages.createPage({
profile,
permalink: '/profile',
slug: 'profile',
layout: 'profile', // use `layouts/profile.vue`
internal: {
id: 'unique id'
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment