feat: update SEO metadata, add sitemap and robots.txt#51
feat: update SEO metadata, add sitemap and robots.txt#51pantharshit007 merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds SEO and metadata assets: robots.txt, a Next.js sitemap generator, metadata export with JSON‑LD on the marketing page, site config updates for root metadata URL behavior, navigation items annotated with lastModified, a semantic H1 in the Hero, and a package version bump to 0.1.9. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Browser
participant NextServer as Next.js Server
participant MarketingPage as / (Marketing Page)
participant HeadOutput as HTML Head
Note over MarketingPage: Render marketing page with metadata + JSON-LD
Browser->>NextServer: GET /
NextServer->>MarketingPage: render()
MarketingPage->>HeadOutput: export metadata + inject <script type="application/ld+json">
HeadOutput->>Browser: HTML (includes JSON-LD)
Browser->>Browser: Search engines parse JSON-LD
sequenceDiagram
autonumber
participant Build as Build Process
participant NavData as src/data/navigation.ts
participant SitemapFn as src/app/sitemap.ts
participant Output as sitemap.xml entries
Note over SitemapFn: Generate sitemap combining static and dynamic routes
Build->>NavData: read NavigationLinks (items with href + lastModified)
Build->>SitemapFn: call sitemap()
SitemapFn->>Output: emit staticRoutes + componentRoutes (use lastModified or now)
Output->>Hosting: served as /sitemap.xml
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
public/robots.txt (1)
1-3: LGTM! Consider adding a trailing newline.The robots.txt configuration is correct and properly references the sitemap. The directives allow all search engines to crawl the entire site.
Add a trailing newline at the end of the file to follow Unix text file conventions:
User-agent: * Allow: / Sitemap: https://aetherui.in/sitemap.xml +
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Todo.mdis excluded by!**/*.md
📒 Files selected for processing (6)
package.json(1 hunks)public/robots.txt(1 hunks)src/app/(marketing)/page.tsx(1 hunks)src/app/sitemap.ts(1 hunks)src/components/landing/Hero.tsx(2 hunks)src/config/site.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,mdx,css}
📄 CodeRabbit inference engine (GEMINI.md)
Format code with Prettier using the project’s prettier.config.js (100 print width, double quotes, trailing commas)
Files:
src/app/sitemap.tssrc/app/(marketing)/page.tsxsrc/components/landing/Hero.tsxsrc/config/site.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
**/*.{ts,tsx}: Avoid using console.log; adhere to ESLint warnings for console usage
Remove or properly handle unused variables to satisfy ESLint rules
Files:
src/app/sitemap.tssrc/app/(marketing)/page.tsxsrc/components/landing/Hero.tsxsrc/config/site.ts
🧬 Code graph analysis (2)
src/app/sitemap.ts (1)
src/data/navigation.ts (1)
NavigationLinks(13-93)
src/app/(marketing)/page.tsx (2)
src/app/layout.tsx (1)
metadata(41-41)src/config/site.ts (2)
metaConfig(37-81)siteConfig(4-15)
🪛 ast-grep (0.39.6)
src/app/(marketing)/page.tsx
[warning] 30-30: Usage of dangerouslySetInnerHTML detected. This bypasses React's built-in XSS protection. Always sanitize HTML content using libraries like DOMPurify before injecting it into the DOM to prevent XSS attacks.
Context: dangerouslySetInnerHTML
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation [REFERENCES]
- https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml
- https://cwe.mitre.org/data/definitions/79.html
(react-unsafe-html-injection)
🪛 Biome (2.1.2)
src/app/(marketing)/page.tsx
[error] 31-31: Avoid passing content using the dangerouslySetInnerHTML prop.
Setting content using code can expose users to cross-site scripting (XSS) attacks
(lint/security/noDangerouslySetInnerHtml)
🔇 Additional comments (9)
package.json (1)
3-3: LGTM!Version bump to 0.1.9 appropriately reflects the new SEO features being added.
src/components/landing/Hero.tsx (2)
40-40: LGTM!Replacing the generic ID with a descriptive alt text significantly improves accessibility for screen reader users.
53-61: LGTM!Converting the heading to a semantic
h1with nested spans improves both SEO and accessibility while preserving the visual styling. This properly establishes the page's heading hierarchy.src/config/site.ts (3)
28-28: LGTM!Adding the optional
isRootflag enables proper URL differentiation between root and documentation pages.
31-31: LGTM!Updating the fallback URL to the production domain aligns with the site's primary URL configuration.
37-41: LGTM!The
isRootparameter correctly controls the OpenGraph URL logic: root pages use the base site URL, while documentation pages append the formatted title path.Also applies to: 70-70
src/app/(marketing)/page.tsx (3)
4-11: LGTM!The metadata export properly leverages the updated
metaConfigwithisRoot: true, ensuring the root page has appropriate SEO metadata and OpenGraph URLs.
13-24: LGTM!The JSON-LD structured data correctly follows the schema.org WebSite format and pulls values from
siteConfigfor consistency.
29-32: The current implementation aligns with Next.js best practices—no changes needed.Next.js (including v15) does not provide a dedicated native API for injecting JSON-LD without using a script tag with inner HTML. The official docs recommend rendering a
<script type="application/ld+json">withJSON.stringifyplus basic sanitization. Your code already follows this recommended pattern, so no alternative approach is available or necessary.
| const staticRoutes = [ | ||
| { | ||
| url: `${URL}/`, | ||
| lastModified: new Date(), | ||
| }, | ||
| { | ||
| url: `${URL}/community`, | ||
| lastModified: new Date(), | ||
| }, | ||
| { | ||
| url: `${URL}/showcase`, | ||
| lastModified: new Date(), | ||
| }, | ||
| ]; | ||
|
|
||
| const componentRoutes = NavigationLinks.flatMap((group) => | ||
| group.children.map((item) => ({ | ||
| url: `${URL}${item.href}`, | ||
| lastModified: new Date(), | ||
| })) | ||
| ); |
There was a problem hiding this comment.
Reconsider using new Date() for all lastModified values.
Setting lastModified: new Date() for every route on every build signals to search engines that all pages changed, even when content is unchanged. This can negatively impact crawl efficiency and indexing.
Consider one of these approaches:
- Use static dates for routes that don't change frequently
- Retrieve actual file modification times for dynamic routes
- Omit
lastModifiedif you don't track content changes (Next.js will handle it appropriately)
Example with static dates:
const staticRoutes = [
{
url: `${URL}/`,
- lastModified: new Date(),
+ lastModified: new Date("2025-10-31"),
},
// ... similar for other static routes
];Committable suggestion skipped: line range outside the PR's diff.
…hance sitemap generation
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/data/navigation.ts (1)
21-104: Consider using UTC timestamps for sitemap consistency.The
lastModifiedtimestamps use the "+05:30" timezone offset (IST). While valid, sitemap best practices recommend using UTC (with "Z" suffix) for consistency and to avoid timezone-related issues in international contexts.Example conversion for line 21:
{ name: "Introduction", href: "/docs", - lastModified: "2025-04-19T02:27:15+05:30", + lastModified: "2025-04-18T20:57:15Z", },This aligns with W3C sitemap protocol standards and Next.js sitemap conventions that typically use UTC timestamps.
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Checklist.mdis excluded by!**/*.md
📒 Files selected for processing (3)
.coderabbit.yml(2 hunks)src/app/sitemap.ts(1 hunks)src/data/navigation.ts(5 hunks)
✅ Files skipped from review due to trivial changes (1)
- .coderabbit.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- src/app/sitemap.ts
🧰 Additional context used
📓 Path-based instructions (3)
src/data/navigation.ts
📄 CodeRabbit inference engine (GEMINI.md)
When adding a new component, update the navigation in src/data/navigation.ts
Files:
src/data/navigation.ts
**/*.{ts,tsx,mdx,css}
📄 CodeRabbit inference engine (GEMINI.md)
Format code with Prettier using the project’s prettier.config.js (100 print width, double quotes, trailing commas)
Files:
src/data/navigation.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
**/*.{ts,tsx}: Avoid using console.log; adhere to ESLint warnings for console usage
Remove or properly handle unused variables to satisfy ESLint rules
Files:
src/data/navigation.ts
🧠 Learnings (1)
📚 Learning: 2025-10-14T19:52:13.641Z
Learnt from: CR
Repo: pantharshit007/aether-ui PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-10-14T19:52:13.641Z
Learning: Applies to src/data/navigation.ts : When adding a new component, update the navigation in src/data/navigation.ts
Applied to files:
src/data/navigation.ts
🧬 Code graph analysis (1)
src/data/navigation.ts (1)
src/components/web/nav/sidebar.tsx (2)
NavSubItems(107-163)NavigationMobile(55-105)
🔇 Additional comments (1)
src/data/navigation.ts (1)
6-6: LGTM! Type definition supports sitemap generation.The addition of the optional
lastModifiedfield toNavigationItemis appropriate for SEO and sitemap generation purposes. The optional modifier ensures backward compatibility with existing code.
Description
Summary by CodeRabbit
Chores
New Features
Style
What type of PR is this? (check all applicable)
Mobile & Desktop Screenshots/Recordings