Following the Next.js tutorial to implement a mirror of the dev.to blog.
yarn && yarn run dev
- I'm using the
article_updated
webhook (https://docs.forem.com/api/#operation/createWebhook) to trigger the blog rebuild at Vercel. It had to be created separately. UPD: Webhooks at dev.to were deprecated. - I want to see dev.to post slugs instead of numeric ids in URLs. However, the current Next.js implementation of
getStaticPaths
doesn't support storing extra information (so either ids or slugs), and these ids are required for fetching the individual posts from the API.
So, I have to save the slug-id mapping to a file ingetStaticPaths
, and then retrieve the id ingetStaticProps
. Not the most elegant solution, but it's better than nothing! Credits for this idea: James Wallis.