Skip to content

feat: update SEO metadata, add sitemap and robots.txt#51

Merged
pantharshit007 merged 2 commits intomainfrom
feat/seo-optimization
Oct 31, 2025
Merged

feat: update SEO metadata, add sitemap and robots.txt#51
pantharshit007 merged 2 commits intomainfrom
feat/seo-optimization

Conversation

@pantharshit007
Copy link
Owner

@pantharshit007 pantharshit007 commented Oct 31, 2025

Description

Summary by CodeRabbit

  • Chores

    • Bumped package version to 0.1.9
    • Updated primary site URL to aetherui.in
  • New Features

    • Added robots.txt for crawler control
    • Added sitemap for search indexing
    • Added JSON-LD structured data for improved search visibility
    • Added lastModified metadata to navigation items and metadata handling for root pages
  • Style

    • Improved semantic HTML in the hero section

What type of PR is this? (check all applicable)

  • 🍕 New Component
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements

Mobile & Desktop Screenshots/Recordings

@vercel
Copy link

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
aether-ui Ready Ready Preview Comment Oct 31, 2025 8:46am

@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
Versioning
package.json
Version bumped from 0.1.8 to 0.1.9.
Robots & Sitemap
public/robots.txt, src/app/sitemap.ts
Added robots.txt allowing all with sitemap URL; added Next.js sitemap generator that emits static routes and flattens navigation items into sitemap entries with lastModified timestamps.
Metadata & Structured Data
src/config/site.ts, src/app/(marketing)/page.tsx
Added optional isRoot flag to meta config and changed fallback URL to https://aetherui.in; exported metadata on marketing page and inlined JSON‑LD Website structured data into the page.
Navigation Data
src/data/navigation.ts
NavigationItem type extended with optional lastModified?: string and many items populated with lastModified values.
UI Semantics
src/components/landing/Hero.tsx
Replaced paragraph heading markup with semantic h1 and block spans; expanded background image alt text.
CI / Review Config
.coderabbit.yml
Added documentation-review rules (require lastModified updates in navigation and package.json version bump guidance).

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
Loading
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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas to focus:
    • src/config/site.ts — verify isRoot logic alters openGraph.url correctly in all intended cases.
    • src/app/sitemap.ts — confirm flattening of NavigationLinks and timestamp selection (lastModified vs now).
    • src/app/(marketing)/page.tsx — validate JSON‑LD correctness and safe use of dangerouslySetInnerHTML.
    • src/data/navigation.ts — check consistency and formatting of newly added lastModified values.

Possibly related PRs

Poem

🐰 A hop, a bump, a sitemap trace,
Robots welcome every place,
JSON‑LD tucked in the head,
Nav dates marching, neatly spread,
H1 stands proud — a tiny race. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "feat: update SEO metadata, add sitemap and robots.txt" clearly and accurately summarizes the main changes in the changeset. The three specific items mentioned in the title—SEO metadata updates, sitemap addition, and robots.txt addition—are all present and represent the primary focus of the pull request. The metadata updates are reflected across multiple files (config/site.ts, src/app/(marketing)/page.tsx, src/data/navigation.ts), the sitemap.ts file is newly created with a functional implementation, and public/robots.txt is added with appropriate directives. The title is concise, specific, and avoids vague terminology, making it clear to teammates scanning the history what the PR accomplishes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/seo-optimization

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between feae1c1 and 9bc5ced.

⛔ Files ignored due to path filters (1)
  • Todo.md is 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.ts
  • src/app/(marketing)/page.tsx
  • src/components/landing/Hero.tsx
  • src/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.ts
  • src/app/(marketing)/page.tsx
  • src/components/landing/Hero.tsx
  • src/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 h1 with 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 isRoot flag 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 isRoot parameter 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 metaConfig with isRoot: 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 siteConfig for 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"> with JSON.stringify plus basic sanitization. Your code already follows this recommended pattern, so no alternative approach is available or necessary.

Comment on lines +7 to +27
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(),
}))
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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 lastModified if 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.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
src/data/navigation.ts (1)

21-104: Consider using UTC timestamps for sitemap consistency.

The lastModified timestamps 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc5ced and 112aee2.

⛔ Files ignored due to path filters (1)
  • Checklist.md is 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 lastModified field to NavigationItem is appropriate for SEO and sitemap generation purposes. The optional modifier ensures backward compatibility with existing code.

@pantharshit007 pantharshit007 merged commit 7f7fec4 into main Oct 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant