Skip to content

Conversation

@gabalafou
Copy link
Contributor

@gabalafou gabalafou commented Jun 21, 2022

Add npm package next-sitemap along with configuration needed to generate site maps for Consulting and Labs sites.

This is a first step to running pa11y against all of the pages on the websites. As such, it is a step toward closing the following issues: #152, #153, #154, and #156.

This code was largely patterned after code in the repo that generates the nx.dev website: https://github.com/nrwl/nx/blob/master/nx-dev/nx-dev/project.json#L19

How to test locally

Consulting:

npx nx build consulting
npx nx sitemap consulting

Labs:

npx nx build labs
npx nx sitemap labs

To do

  • Make sitemap generation part of the build command so that when we run nx build consulting, sitemap.xml is output into the public folder
  • Remove <changefreq> and <priority> from sitemap.xml if they have unintended consequences and are not needed
  • Cherry on top: integrate the sitemap generation with the local dev server: npm run start

@vercel
Copy link

vercel bot commented Jun 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
consulting ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 6:58PM (UTC)
labs ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 6:58PM (UTC)
quansight-consulting ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 6:58PM (UTC)
quansight-labs ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 6:58PM (UTC)

@gabalafou gabalafou changed the title Sitemap feat: Generate sitemaps using next-sitemap Jun 21, 2022
@gabalafou
Copy link
Contributor Author

gabalafou commented Jun 21, 2022

I may need help figuring out how to tie the build and sitemap tasks together. Right now, with this PR, they have to be run one after the other.

@gabalafou
Copy link
Contributor Author

Note to self: if this solution proves too inflexible or difficult to properly configure, it may be easier to create a sitemap component that works a bit like generateRSS.ts.

@vercel vercel bot temporarily deployed to Preview – quansight-labs June 22, 2022 18:25 Inactive
@vercel vercel bot temporarily deployed to Preview – quansight-consulting June 22, 2022 18:26 Inactive
@trallard trallard added the type: enhancement 💅🏼 New feature or request label Jun 23, 2022
"executor": "@nrwl/workspace:run-commands",
"outputs": [],
"options": {
"command": "next-sitemap --config apps/consulting/next-sitemap.config.js"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcin-antczak-naturaily can we make this a part of the build step so that /sitemap.xml gets deployed with each Vercel deploy?

@gabalafou gabalafou mentioned this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

labs 🔭 Items related to the Labs website type: enhancement 💅🏼 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants