Skip to content

Commit 9308fa5

Browse files
authored
chore: remove old module pages (#203)
- chore: no longer create old module pages (paginated overview and individual pages) - chore: remove no longer used templates for modules - chore: remove no longer used ModuleSearchForm - chore: remove generation of module search index JSON - chore: remove 'modules/' from filesystem sources - chore: remove local copy of 'modules/'
1 parent 56448b5 commit 9308fa5

305 files changed

Lines changed: 0 additions & 4330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gatsby-config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ module.exports = {
5555
path: `${__dirname}/blog/`,
5656
},
5757
},
58-
{
59-
resolve: "gatsby-source-filesystem",
60-
options: {
61-
name: "modules",
62-
path: `${__dirname}/modules/`,
63-
},
64-
},
6558
{
6659
resolve: "gatsby-source-filesystem",
6760
options: {

gatsby-node.js

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -142,52 +142,6 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
142142
},
143143
});
144144
});
145-
146-
const modulePageTemplate = path.resolve("src/templates/Module.jsx");
147-
const moduleQueryResult = await graphql(
148-
`
149-
{
150-
allMarkdownRemark(
151-
filter: { frontmatter: { posttype: { eq: "module" } } }
152-
) {
153-
edges {
154-
node {
155-
fields {
156-
slug
157-
}
158-
}
159-
}
160-
}
161-
}
162-
`
163-
);
164-
165-
const modules = moduleQueryResult.data.allMarkdownRemark.edges;
166-
modules.forEach((edge) => {
167-
createPage({
168-
path: `/modules${edge.node.fields.slug}`,
169-
component: modulePageTemplate,
170-
context: {
171-
slug: edge.node.fields.slug,
172-
},
173-
});
174-
});
175-
176-
const moduleListTemplate = path.resolve("./src/templates/ModuleList.jsx");
177-
const modulesPerPage = 27;
178-
const numModulePages = Math.ceil(modules.length / modulesPerPage);
179-
Array.from({ length: numModulePages }).forEach((_, i) => {
180-
createPage({
181-
path: i === 0 ? `/modules` : `/modules/${i + 1}`,
182-
component: moduleListTemplate,
183-
context: {
184-
limit: modulesPerPage,
185-
skip: i * modulesPerPage,
186-
moduleNumPages: numModulePages,
187-
moduleCurrentPage: i + 1,
188-
},
189-
});
190-
});
191145
}
192146

193147
async function createGalleryPages() {
@@ -324,55 +278,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
324278
return index;
325279
}
326280

327-
async function buildModulesSearchIndex() {
328-
const result = await graphql(
329-
`
330-
{
331-
allMarkdownRemark(
332-
filter: { frontmatter: { posttype: { eq: "module" } } }
333-
sort: { frontmatter: { title: ASC } }
334-
) {
335-
edges {
336-
node {
337-
excerpt
338-
fields {
339-
slug
340-
}
341-
frontmatter {
342-
tags
343-
title
344-
cover {
345-
childImageSharp {
346-
gatsbyImageData
347-
}
348-
}
349-
}
350-
}
351-
}
352-
}
353-
}
354-
`
355-
);
356-
const index = result.data.allMarkdownRemark.edges.map((edge) => {
357-
const { excerpt, fields, frontmatter } = edge.node;
358-
const { slug } = fields;
359-
const { tags, title, cover } = frontmatter;
360-
361-
return {
362-
excerpt,
363-
path: `/modules${slug}`,
364-
tags,
365-
title,
366-
cover,
367-
posttype: "module",
368-
};
369-
});
370-
371-
return index;
372-
}
373-
374281
const blogIndex = await buildBlogSearchIndex();
375-
const moduleIndex = await buildModulesSearchIndex();
376282

377283
if (!fs.existsSync("src/generated")) {
378284
fs.mkdirSync("src/generated");
@@ -382,8 +288,4 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
382288
"./src/generated/blog-result.json",
383289
JSON.stringify(blogIndex, null, 2)
384290
);
385-
fs.writeFileSync(
386-
"./src/generated/module-result.json",
387-
JSON.stringify(moduleIndex, null, 2)
388-
);
389291
};

modules/AdditionalFruits/cover.png

-2.19 MB
Binary file not shown.

modules/AdditionalFruits/index.md

Lines changed: 0 additions & 54 deletions
This file was deleted.
-2.19 MB
Binary file not shown.

modules/AdditionalItemPipes/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

modules/AdditionalRails/cover.png

-2.19 MB
Binary file not shown.

modules/AdditionalRails/index.md

Lines changed: 0 additions & 52 deletions
This file was deleted.
-2.19 MB
Binary file not shown.

modules/AdditionalVegetables/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)