gridsome / gridsome/gridsome

Question about the Pages API

Open
#592 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
8.5k
Forks
466
PR merge metrics
No merged PRs in 30d

Description

Thank you for creating such a fantastic framework for building static sites with Vue!

I have a question about the Pages API. If this is the wrong forum to ask general questions then do let me know.

I am using WordPress to manage content, and the WordPress source plugin to generate static pages. This works very well, but there are some pages that need unique markup. For example – there is a 'map' page that needs to include a map component.

I have achieved this with the following use of `createManagedPages`:

api.createManagedPages(({ createPage, removePageByPath }) => {
removePageByPath('/map') // Remove the auto-generated WordPressPage

createPage({
path: '/map',
component: './src/pages/map/Map.vue'
})
})

However, I was concerned when reading the docs about `createPages` being re-run occasionally. Is there a chance that the original auto-generated page would be re-created, and prevent the custom markup being used?

More generally, I am curious about when `createPages` is re-run, and when pages are garbage collected. In the docs, it says that this happens when nodes are changed in the store, but it was my understanding that the GraphQL store is static, and generated at build time.

Thanks again!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.