Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ module.exports = {
path: `${__dirname}/blog/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "modules",
path: `${__dirname}/modules/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
Expand Down
98 changes: 0 additions & 98 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,52 +142,6 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
},
});
});

const modulePageTemplate = path.resolve("src/templates/Module.jsx");
const moduleQueryResult = await graphql(
`
{
allMarkdownRemark(
filter: { frontmatter: { posttype: { eq: "module" } } }
) {
edges {
node {
fields {
slug
}
}
}
}
}
`
);

const modules = moduleQueryResult.data.allMarkdownRemark.edges;
modules.forEach((edge) => {
createPage({
path: `/modules${edge.node.fields.slug}`,
component: modulePageTemplate,
context: {
slug: edge.node.fields.slug,
},
});
});

const moduleListTemplate = path.resolve("./src/templates/ModuleList.jsx");
const modulesPerPage = 27;
const numModulePages = Math.ceil(modules.length / modulesPerPage);
Array.from({ length: numModulePages }).forEach((_, i) => {
createPage({
path: i === 0 ? `/modules` : `/modules/${i + 1}`,
component: moduleListTemplate,
context: {
limit: modulesPerPage,
skip: i * modulesPerPage,
moduleNumPages: numModulePages,
moduleCurrentPage: i + 1,
},
});
});
}

async function createGalleryPages() {
Expand Down Expand Up @@ -324,55 +278,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
return index;
}

async function buildModulesSearchIndex() {
const result = await graphql(
`
{
allMarkdownRemark(
filter: { frontmatter: { posttype: { eq: "module" } } }
sort: { frontmatter: { title: ASC } }
) {
edges {
node {
excerpt
fields {
slug
}
frontmatter {
tags
title
cover {
childImageSharp {
gatsbyImageData
}
}
}
}
}
}
}
`
);
const index = result.data.allMarkdownRemark.edges.map((edge) => {
const { excerpt, fields, frontmatter } = edge.node;
const { slug } = fields;
const { tags, title, cover } = frontmatter;

return {
excerpt,
path: `/modules${slug}`,
tags,
title,
cover,
posttype: "module",
};
});

return index;
}

const blogIndex = await buildBlogSearchIndex();
const moduleIndex = await buildModulesSearchIndex();

if (!fs.existsSync("src/generated")) {
fs.mkdirSync("src/generated");
Expand All @@ -382,8 +288,4 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
"./src/generated/blog-result.json",
JSON.stringify(blogIndex, null, 2)
);
fs.writeFileSync(
"./src/generated/module-result.json",
JSON.stringify(moduleIndex, null, 2)
);
};
Binary file removed modules/AdditionalFruits/cover.png
Binary file not shown.
54 changes: 0 additions & 54 deletions modules/AdditionalFruits/index.md

This file was deleted.

Binary file removed modules/AdditionalItemPipes/cover.png
Binary file not shown.
8 changes: 0 additions & 8 deletions modules/AdditionalItemPipes/index.md

This file was deleted.

Binary file removed modules/AdditionalRails/cover.png
Binary file not shown.
52 changes: 0 additions & 52 deletions modules/AdditionalRails/index.md

This file was deleted.

Binary file removed modules/AdditionalVegetables/cover.png
Binary file not shown.
8 changes: 0 additions & 8 deletions modules/AdditionalVegetables/index.md

This file was deleted.

Binary file removed modules/AdvancedRails/cover.png
Binary file not shown.
8 changes: 0 additions & 8 deletions modules/AdvancedRails/index.md

This file was deleted.

Binary file removed modules/AdventureAssets/cover.png
Binary file not shown.
9 changes: 0 additions & 9 deletions modules/AdventureAssets/index.md

This file was deleted.

Binary file removed modules/Alchemy/cover.png
Binary file not shown.
22 changes: 0 additions & 22 deletions modules/Alchemy/index.md

This file was deleted.

Binary file removed modules/AlchemyPlantGenerator/cover.png
Binary file not shown.
12 changes: 0 additions & 12 deletions modules/AlchemyPlantGenerator/index.md

This file was deleted.

Binary file removed modules/AlterationEffects/cover.png
Binary file not shown.
57 changes: 0 additions & 57 deletions modules/AlterationEffects/index.md

This file was deleted.

Binary file removed modules/Anatomy/cover.png
Binary file not shown.
Loading