-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSG for Editorial Articles #107
Conversation
This pull request is being automatically deployed with Vercel (learn more). structured-content-2022-web – ./web🔍 Inspect: https://vercel.com/sanity-io/structured-content-2022-web/BvQE1hd72AhtuZztvzHrNfXbjp6x structured-content-2022-studio – ./studio🔍 Inspect: https://vercel.com/sanity-io/structured-content-2022-studio/9rUN1fZ421huFm4igzxb8PkUWgEZ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an incorrect link in the PR description's "Testing" section? I don't see anything on the "Realtime logs" page.
The page is updated, though, so that part works.
@oyvind-stenhaug What does "not see anything" mean in this case? Are you getting a 404, or are no entries showing? |
@j0nas Sorry for the ambiguity… It meant no entries showing. It just kept saying "Awaiting new requests…" I think I figured out the issue. The "Realtime Logs" link points to the URL but when I instead tried https://vercel.com/sanity-io/structured-content-2022-web/BvQE1hd72AhtuZztvzHrNfXbjp6x/functions just now, the log entry showed up. |
Will the article route rewrites be handled in a third PR? |
@oyvind-stenhaug 🤦 I fixed the link in the README description now, sorry. Thank you.
Yeah, if at all. I'm still not sure what the redirects are used for, and I don't actually think they can be added on-the-fly; I'm assuming Next's routing is built on top of Express, which doesn't support updating routes after initialization. So triggering a redeploy via CI is the way to solve that. Not sure whether articles are added so often that this is worth automating. I can ask @kmelve about this on Slack. |
SSG for Editorial Articles
Intent
A continuation of #105, using the same approach for Editorial Articles on /article/:slug.
Description
Not much is different here from #105. I've added an extra
.filter(({ params: { slug } }) => Boolean(slug));
togetStaticPaths
because accessing /article/ without a slug is not supposed to be a valid route. Otherwise I've kept the code much the same as for [[...slug]].tsx.Testing this PR
I've set up a new webhook for testing purposes. It should be configured exactly the same as the webhook for production, except that it points to this branch's Preview Deployment instead.