Skip to content

Commit

Permalink
feat: consolidate page prefixing under docs, integrate YAML page cont…
Browse files Browse the repository at this point in the history
…ent into nav data structure
  • Loading branch information
jamiehenson committed Jan 15, 2025
1 parent cc5283c commit ed97940
Show file tree
Hide file tree
Showing 46 changed files with 724 additions and 828 deletions.
9 changes: 8 additions & 1 deletion data/createPages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const createPages = async ({ graphql, actions: { createPage, createRedirect } })

const script = safeFileExists(`static/scripts/${edge.node.slug}.js`);

const pagePath = `/${edge.node.slug}`;
const pagePath = `${pathPrefix}/${edge.node.slug}`;

const redirectFromList = edge.node.meta?.redirect_from;

Expand Down Expand Up @@ -160,6 +160,13 @@ const createPages = async ({ graphql, actions: { createPage, createRedirect } })
return slug;
};

createRedirect({
fromPath: '/',
toPath: pathPrefix,
isPermanent: true,
redirectInBrowser: true,
});

await Promise.all([
...documentResult.data.allFileHtml.edges.map(documentCreator(documentTemplate)),
...apiReferenceResult.data.allFileHtml.edges.map(documentCreator(apiReferenceTemplate)),
Expand Down
22 changes: 0 additions & 22 deletions data/onCreateNode/create-graphql-schema-customization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,6 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization']
`;
createTypes(typeDefs);

// Schema update for page-content YAML files
const pageContentTypes = `
type PageContentYamlSectionsCallToAction implements Node {
text: String!
href: String!
external: Boolean
type: String!
}
type PageContentYamlSectionsCardsLinks implements Node {
text: String!
href: String!
external: Boolean
}
type PageContentYamlSectionsCardsCallToAction implements Node {
text: String!
href: String!
external: Boolean
type: String!
}
`;
createTypes(pageContentTypes);

// Schema update for site
const siteTypes = `
# We always want an assetPrefix
Expand Down
36 changes: 0 additions & 36 deletions data/yaml/page-content/asset-tracking.yaml

This file was deleted.

140 changes: 0 additions & 140 deletions data/yaml/page-content/channels.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions data/yaml/page-content/chat.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions data/yaml/page-content/homepage.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions data/yaml/page-content/livesync.yaml

This file was deleted.

Loading

0 comments on commit ed97940

Please sign in to comment.