-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gatsby] Render just one page #5496
Comments
I guess you can implement this behavior using exports.onCreatePage = ({ page, boundActionCreators }) => {
const { createPage, deletePage } = boundActionCreators; // renamed to `actions` in Gatsby v2
const singlePageMode = process.env.SINGLE_PAGE !== undefined;
if (singlePageMode && !/404/.test(page.path) && page.path !== process.env.SINGLE_PAGE) {
deletePage(page);
}
}; and then, when you only want to build a single page: |
Hi @mquandalle , |
The |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
I have a SSR issue, I would like to debug the problem without having to rebuild the whole app between each iteration. It's frustrating. |
Similar need here, my use case is previewing individual WordPress pages when using: The content is managed in WP, the page generation in Gatsby, but would like to visualize individual WP pages as I create/update them without having to rebuild everything. |
What about allowing to pass a series of node ids to the |
I like that approach, it would make it easier to create hooks in CMS to automatically re-generate content on change when using 3rd party services. |
@spik3s : Yes, keeping a REST-based approach instead of environment variables would make Gatsby a lot more interoperable. With Wordpress the integration becomes trivial: To be placed in functions.php:
|
Closed by the bot due to inactivity in 2018. Reopening due to activity since then, and no official solution for this very common use case. |
This has been superseded by #5002 and is solved with Incremental Builds. Locally this always worked withing |
Thanks for pointing to #5002, @LekoArts. If I understand correctly,
I believe @jquintozamora was asking in the OP was asking about generating just one page in production. @LekoArts, can you please clarify how to re-render just one page in production without Gatsby Cloud? |
I am also interested in this 👀 Any updates? |
I've scenario with 5 different templates and more than 50 pages on my site.
I'd like to know if there is a cli option for gatsby which allow me to render only one given page. So If I only change the content for one page ( one url on my app ) then only that static file is generated and it doesn't update everything on my app.
Something like:
gatsby generate /mysite/mypage.html
And that specific page is updated and generated quickly, so the gatsby process does not have to process everything on my site.
Is that something I can achieve ?
Thanks!
The text was updated successfully, but these errors were encountered: