Skip to content

Commit

Permalink
Merge branch 'master' into invite-flow-blog
Browse files Browse the repository at this point in the history
  • Loading branch information
jscyo authored Sep 25, 2023
2 parents 7fd556c + 08dc204 commit e415224
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 8 deletions.
50 changes: 50 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const webflowPosts = require("./src/blog-details")

const ignorePaths = ['/','/404']


module.exports = {
siteMetadata: {
title: `SuperTokens Blog`,
Expand Down Expand Up @@ -72,6 +77,51 @@ module.exports = {
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: "gatsby-plugin-sitemap",
options: {
query:`
{
allSitePage {
nodes {
path
}
}
}
`,
output:'/sitemaps',
resolveSiteUrl: () => 'https://supertokens.com/',
resolvePages: ({
allSitePage: { nodes:allPages }
}) => {
const webflowBlogsWithTrailingSlashes = webflowPosts.reduce((acc,currentPage)=>{

if(currentPage.fields.slug === undefined){
return acc
}

return [...acc , {path: `blog${currentPage.fields.slug}`}, {path:`blog${currentPage.fields.slug}/`}];
},[])

const allPagesWithTralingSlashes = allPages.reduce((acc,currentPage)=>{

if(ignorePaths.includes(currentPage.path)){
return acc;
}

const pathWithTrailingSlash = { path: currentPage.path + '/' }
return [...acc, currentPage, pathWithTrailingSlash]
},[])

return [...allPagesWithTralingSlashes, ...webflowBlogsWithTrailingSlashes];
},
serialize: ({ path }) => {
return {
url: path,
}
},
},
},
// {
// resolve: `gatsby-plugin-google-analytics`,
// options: {
Expand Down
116 changes: 108 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"gatsby-plugin-gatsby-cloud": "^4.7.0",
"gatsby-plugin-image": "^2.7.0",
"gatsby-plugin-sharp": "^4.7.0",
"gatsby-plugin-sitemap": "^6.12.0",
"gatsby-remark-autolink-headers": "^5.22.0",
"gatsby-remark-copy-linked-files": "^5.7.0",
"gatsby-remark-external-links": "^0.0.4",
Expand Down

0 comments on commit e415224

Please sign in to comment.