mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-04-28 17:56:51 +02:00
Add pretty indicator to createPages
This commit is contained in:
parent
9c39458524
commit
5117247bd6
1 changed files with 12 additions and 0 deletions
|
@ -5,6 +5,11 @@ const { paginate } = require("gatsby-awesome-pagination");
|
|||
exports.createPages = async ({ actions, graphql, reporter }) => {
|
||||
const { createPage, createRedirect } = actions;
|
||||
|
||||
const activity = reporter.activityTimer(`Generate pages`);
|
||||
|
||||
activity.start();
|
||||
activity.setStatus("Sourcing data for pages...");
|
||||
|
||||
const projectTemplate = path.resolve(`src/templates/project.js`);
|
||||
|
||||
const result = await graphql(`
|
||||
|
@ -43,6 +48,8 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
return;
|
||||
}
|
||||
|
||||
activity.setStatus("Generating project pages...");
|
||||
|
||||
result.data.allProjectsJson.nodes.forEach((node) => {
|
||||
if (node.lang === "ignoreme") return;
|
||||
|
||||
|
@ -60,6 +67,8 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
});
|
||||
});
|
||||
|
||||
activity.setStatus("Generating blog pages...");
|
||||
|
||||
const blogListingTemplate = path.resolve(`src/templates/blogListing.js`);
|
||||
const blogTemplate = path.resolve(`src/templates/blogPost.js`);
|
||||
|
||||
|
@ -175,4 +184,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
activity.setStatus("Pages generated.");
|
||||
activity.end();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue