-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Migrate docs site to Vercel #795
Conversation
(Headers we were setting are already the default in Astro projects on Vercel.)
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
Haven’t figured out the multilingual 404 support just yet. On Netlify this was pretty straightforward in
|
Could this work like rewrites with regex path matching in a Next config where to match a regex path you have wrap the regex in parenthesis after a parameter? E.g. Altho I guess this would end up being the same as |
Yeah that’s what I tried (thanks to @tony-sull’s guidance): "redirects": [
{
"source": "/:lang/(.*)/",
"destination": "/:lang/404/",
"statusCode": 404
}
], The above doesn’t seem to do anything but when I tried |
Just tried testing the deprecated {
"routes": [
{ "handle": "filesystem" },
{ "src": "/de/(.*)", "status": 404, "dest": "/de/404.html" }
]
} But this does not work as desired, a 404 under |
Closing until we can figure out the 404 routing. |
This reverts commit 354b3ee.
"continue": true | ||
}, | ||
|
||
{ "src": "/(ph$|ph/)(.*)", "dest": "https://astro-houston-ph.pages.dev/ph/$2" }, |
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.
The regular expression here allows us to match /ph/.*
, but also /ph
with no trailing slash (without also accidentally matching /philosophy
or something).
Tests
{ "src": "(.*)/([^./]+)$", "dest": "$1/$2/", "status": 301 }, | ||
{ "src": "(.*)/index.html$", "dest": "$1/", "status": 301 }, |
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.
These two rules set up similar URL normalisation to Netlify:
-
Add a trailing slash to URLs without an extension and without a trailing slash. (Could break non-HTML files without extensions, but we don’t have any of those.)
-
Strip
index.html
from the end of URLs.
These precede "handle": "filesystem"
otherwise the filesystem would match and they’d never kick in.
Tests
|
||
{ "src": "/zh/(.*)", "dest": "/zh-cn/$1", "status": 301 }, | ||
|
||
{ "src": "/(?<lang>[^/]*)/(.*)", "dest": "/$lang/404/", "status": 404 } |
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.
Support multilingual 404s.
Tests
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.
This looks great!
Before merging, make sure to disconnect the Netlify builds from the github repo just in case. That will freeze Netlify on the last non-Vercel build and keep it alive until after the domain/DNS settings in Vercel take over
What kind of changes does this PR include?
Description
lastUpdated
feature, which doesn’t currently support Vercel due to them blocking deep clonesvercel.json
with redirect config previously provided by_redirects
for Netlify_headers
file was setting cache headers that are the default for Astro projects on Vercel.)