-
-
Notifications
You must be signed in to change notification settings - Fork 882
feat(ssg): add redirect plugin #4599
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4599 +/- ##
==========================================
- Coverage 91.56% 91.56% -0.01%
==========================================
Files 173 174 +1
Lines 11256 11284 +28
Branches 3265 3272 +7
==========================================
+ Hits 10307 10332 +25
- Misses 948 951 +3
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| expect(content).toContain('<a href="/new">Redirecting from') | ||
| }) | ||
|
|
||
| it('should skip generating a redirect HTML when 301/302 has no Location header', async () => { |
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 specification mandates that redirect responses must include a Location header 1. Current implementations simply bypass generating the file if no Location header is present, though options include displaying a warning or throwing an error could be considered.
Footnotes
| disableSSG, | ||
| onlySSG, | ||
| } from './middleware' | ||
| export { redirectPlugin } from './plugins' |
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.
Since built-in plugins should only handle lightweight ones, I decided to manage multiple plugins in a single plugins.ts file. This should make updating exports slightly more convenient.
close #4389
The author should do the following, if applicable
bun run format:fix && bun run lint:fixto format the code