-
Notifications
You must be signed in to change notification settings - Fork 354
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
feat: add sitemap.xml #132
Conversation
WalkthroughThe changes introduce a sitemap feature to the project, enhancing its documentation and functionality. A new dependency, Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (3)
- README.md (1 hunks)
- package.json (1 hunks)
- src/routes/(marketing)/sitemap.xml/+server.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- README.md
Additional comments not posted (3)
src/routes/(marketing)/sitemap.xml/+server.ts (2)
1-3
: LGTM!The import statements are correct and necessary for the functionality of the file.
5-12
: Improve error handling and remove redundantawait
keyword.The GET request handler is correctly implemented, but there are a few improvements to consider:
- Add error handling to manage potential errors during sitemap generation.
- Remove the redundant
await
keyword in the return statement.Apply this diff to improve the code:
-export const GET: RequestHandler = async () => { - return await sitemap.response({ - origin: WebsiteBaseUrl, - excludeRoutePatterns: [ - '.*\\(admin\\).*', // i.e. exclude routes within admin group - ], - }); +export const GET: RequestHandler = async () => { + try { + return sitemap.response({ + origin: WebsiteBaseUrl, + excludeRoutePatterns: [ + '.*\\(admin\\).*', // i.e. exclude routes within admin group + ], + }); + } catch (error) { + console.error('Error generating sitemap:', error); + return new Response('Internal Server Error', { status: 500 }); + } };package.json (1)
38-38
: LGTM!The added dependency
super-sitemap
is necessary for the functionality of the sitemap generation.
@jasongitmail Missing files? I fixed formatting errors but I'm getting build errors. You can run the following locally to perform all the checks
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/routes/(marketing)/sitemap.xml/+server.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- src/routes/(marketing)/sitemap.xml/+server.ts
I pushed a commit for formatting. All checks passing on this PR. Nope, not missing files. If there's a build error, it's most likely not super-sitemap related. But lmk what error you're seeing if any. |
I just forgot to |
@jasongitmail thanks! |
haha that happens! You're welcome 🙂 |
Closes #130
Summary by CodeRabbit
New Features
Dependencies
super-sitemap
library to improve sitemap management.