Skip to content

Feat: Sitemap#422

Merged
mittalyashu merged 3 commits intov0-2from
feat/sitemap
Jan 18, 2026
Merged

Feat: Sitemap#422
mittalyashu merged 3 commits intov0-2from
feat/sitemap

Conversation

@Vedant005
Copy link
Contributor

@Vedant005 Vedant005 commented Nov 15, 2025

Closes #313

Summary by CodeRabbit

  • New Features

    • Added sitemap generation for the documentation site that aggregates pages from guides, platform docs, self-hosting, API references, and more.
    • Sitemap entries include full site URLs and current last-modified timestamps to improve indexing and search engine discovery.
  • Documentation

    • Updated inline documentation links to point to the revised environment-variables docs path.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 15, 2025

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'path_filters'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Adds a new Next.js sitemap generator at src/app/sitemap.ts and updates two documentation links in content/api-reference/auth/sendVerificationEmail.mdx.

Changes

Cohort / File(s) Summary
New Sitemap Generator
src/app/sitemap.ts
Adds default sitemap() exporting MetadataRoute.Sitemap. Aggregates pages from mainSource, selfHostingSource, platformSource, guideSource, openApiSource, developingSource via getPages() and maps each page to { url: "https://docs.logchimp.codecarrot.net" + page.url, lastModified: buildTime ISO string }. No explicit error handling.
Docs link updates
content/api-reference/auth/sendVerificationEmail.mdx
Updates two inline URLs to docs/environment-variables#mail (was self-hosting/environment-variables#mail). No code or control-flow changes.

Sequence Diagram(s)

sequenceDiagram
    participant NextJS as Next.js
    participant SitemapFn as sitemap()
    participant Sources as PageSources
    participant Output as SitemapArray

    NextJS->>SitemapFn: request sitemap
    activate SitemapFn
    SitemapFn->>SitemapFn: initialize buildTime and sources list
    loop per source
        SitemapFn->>Sources: call getPages() on source
        activate Sources
        Sources-->>SitemapFn: return pages[]
        deactivate Sources
        SitemapFn->>SitemapFn: map pages -> { url, lastModified }
    end
    SitemapFn-->>Output: return MetadataRoute.Sitemap
    deactivate SitemapFn
    Output-->>NextJS: sitemap metadata
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR contains one out-of-scope change: URL updates in content/api-reference/auth/sendVerificationEmail.mdx are unrelated to the sitemap feature. Remove the documentation link updates from this PR and address them in a separate pull request focused on updating documentation links.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat: Sitemap' is concise and directly related to the main change—adding a sitemap generator to the application.
Linked Issues check ✅ Passed The pull request implements sitemap generation functionality that directly addresses issue #313 'Generate sitemap' by creating src/app/sitemap.ts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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: 1

🧹 Nitpick comments (1)
src/app/sitemap.ts (1)

24-24: Consider using actual content modification dates.

Using the current timestamp for all pages means every page appears to have been modified at build time, which doesn't help search engines prioritize fresh content. If the page sources expose actual modification dates (e.g., from file metadata or frontmatter), consider using those instead.

Example approach if sources provide modification dates:

-      lastModified: new Date().toISOString(),
+      lastModified: page.data?.lastModified || new Date().toISOString(),

Note: This assumes the page data includes a lastModified field. If not available, the current approach is acceptable as a fallback.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dbdb81 and 85c362f.

📒 Files selected for processing (1)
  • src/app/sitemap.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/app/sitemap.ts (1)
src/lib/source.ts (6)
  • mainSource (14-22)
  • selfHostingSource (24-32)
  • platformSource (34-42)
  • guideSource (44-52)
  • openApiSource (54-60)
  • developingSource (62-70)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: vercel_deployment
🔇 Additional comments (2)
src/app/sitemap.ts (2)

1-9: LGTM!

The imports are well-organized and appropriate for implementing a Next.js sitemap generator.


11-19: LGTM!

The function signature correctly implements the Next.js sitemap convention, and aggregating all sources in an array is clean and maintainable.

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: 1

♻️ Duplicate comments (1)
src/app/sitemap.ts (1)

23-23: Move hardcoded domain to environment variable.

The hardcoded domain creates maintenance issues and will break in non-production environments. This was previously flagged in the last review.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85c362f and e014178.

📒 Files selected for processing (1)
  • src/app/sitemap.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/app/sitemap.ts (1)
src/lib/source.ts (6)
  • mainSource (14-22)
  • selfHostingSource (24-32)
  • platformSource (34-42)
  • guideSource (44-52)
  • openApiSource (54-60)
  • developingSource (62-70)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: vercel_deployment
🔇 Additional comments (2)
src/app/sitemap.ts (2)

1-9: LGTM!

Imports are clean and properly structured for Next.js 15 sitemap generation.


11-19: LGTM!

The function signature correctly implements Next.js sitemap generation, and aggregating sources into an array is a clean approach.

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: 1

🤖 Fix all issues with AI agents
In `@content/api-reference/auth/sendVerificationEmail.mdx`:
- Around line 14-16: Revert the broken link change so the URL points to the
existing page by replacing occurrences of
"https://docs.logchimp.codecarrot.net/docs/environment-variables#mail" with the
original "self-hosting/environment-variables#mail" in sendVerificationEmail
content, and fix the grammar in the sentence that currently reads "The email is
only sent if have configured [SMTP mail server] are configured..." to "The email
is only sent if the [SMTP mail server] is configured" (apply the same
grammatical fix to the other similar sentence where the SMTP link appears).

Comment on lines 14 to 16
The email is only sent if have configured [SMTP mail
server](https://docs.logchimp.codecarrot.net/self-hosting/environment-variables#mail)
server](https://docs.logchimp.codecarrot.net/docs/environment-variables#mail)
are configured at the time of deploying LogChimp.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Explore the documentation structure and locate environment-variables references

# List the content directory structure
echo "=== Content directory structure ==="
find content -type d -name "docs" -o -name "api-reference" | head -20

# Find environment-variables documentation file
echo -e "\n=== Looking for environment-variables file ==="
fd -t f "environment-variables" content/

# Search for references to environment-variables
echo -e "\n=== References to environment-variables in mdx files ==="
rg "environment-variables" content/ --type mdx -l

# Check the file structure
echo -e "\n=== Directory structure of content ==="
ls -la content/ 2>/dev/null | head -20

Repository: logchimp/docs

Length of output: 872


🏁 Script executed:

#!/bin/bash
# View the complete context around lines 14-22 in the file
echo "=== Content of lines 10-25 from sendVerificationEmail.mdx ==="
sed -n '10,25p' content/api-reference/auth/sendVerificationEmail.mdx

Repository: logchimp/docs

Length of output: 966


Revert the URL path change—it points to a non-existent directory.

The URL was changed from self-hosting/environment-variables#mail to docs/environment-variables#mail, but the documentation structure shows the file is located at content/self-hosting/environment-variables.mdx. There is no docs directory in the content folder. The URL will be broken in the deployed documentation. Revert this change on both lines 15 and 22 to restore the correct path.

Additionally, fix the grammar: "if have configured [...] are configured" should be "if the [...] is configured":

✏️ Grammar and URL fix
-          The email is only sent if have configured [SMTP mail
-          server](https://docs.logchimp.codecarrot.net/docs/environment-variables#mail)
-          are configured at the time of deploying LogChimp.
+          The email is only sent if the [SMTP mail
+          server](https://docs.logchimp.codecarrot.net/self-hosting/environment-variables#mail)
+          is configured at the time of deploying LogChimp.

And similarly for line 22:

-The email is only sent if have configured [SMTP mail server](https://docs.logchimp.codecarrot.net/docs/environment-variables#mail) are configured at the time of deploying LogChimp.
+The email is only sent if the [SMTP mail server](https://docs.logchimp.codecarrot.net/self-hosting/environment-variables#mail) is configured at the time of deploying LogChimp.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The email is only sent if have configured [SMTP mail
server](https://docs.logchimp.codecarrot.net/self-hosting/environment-variables#mail)
server](https://docs.logchimp.codecarrot.net/docs/environment-variables#mail)
are configured at the time of deploying LogChimp.
The email is only sent if the [SMTP mail
server](https://docs.logchimp.codecarrot.net/self-hosting/environment-variables#mail)
is configured at the time of deploying LogChimp.
🤖 Prompt for AI Agents
In `@content/api-reference/auth/sendVerificationEmail.mdx` around lines 14 - 16,
Revert the broken link change so the URL points to the existing page by
replacing occurrences of
"https://docs.logchimp.codecarrot.net/docs/environment-variables#mail" with the
original "self-hosting/environment-variables#mail" in sendVerificationEmail
content, and fix the grammar in the sentence that currently reads "The email is
only sent if have configured [SMTP mail server] are configured..." to "The email
is only sent if the [SMTP mail server] is configured" (apply the same
grammatical fix to the other similar sentence where the SMTP link appears).

@mittalyashu
Copy link
Member

LGTM

@mittalyashu mittalyashu merged commit 415809e into v0-2 Jan 18, 2026
4 of 7 checks passed
@mittalyashu mittalyashu deleted the feat/sitemap branch January 18, 2026 09:19
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2026
@mittalyashu
Copy link
Member

The failing Biome workflow has been patch in the v0-2 branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate sitemap

2 participants