Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/api-reference/auth/sendVerificationEmail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ _openapi:
Send a verification email to the user email address.

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

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

Send a verification email to the user email address.
The email is only sent if have configured [SMTP mail server](https://docs.logchimp.codecarrot.net/self-hosting/environment-variables#mail) are configured at the time of deploying LogChimp.
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.


<APIPage document={"./content/api-reference/openapi.yaml"} operations={[{"path":"/auth/email/verify","method":"post"}]} webhooks={[]} hasHead={false} />
27 changes: 27 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { MetadataRoute } from "next";
import {
mainSource,
selfHostingSource,
platformSource,
guideSource,
openApiSource,
developingSource,
} from "../lib/source";

export default function sitemap(): MetadataRoute.Sitemap {
const sources = [
mainSource,
selfHostingSource,
platformSource,
guideSource,
openApiSource,
developingSource,
];

return sources.flatMap((s) =>
s.getPages().map((page) => ({
url: `https://docs.logchimp.codecarrot.net${page.url}`,
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

Move hardcoded domain to environment variable.

The hardcoded domain https://docs.logchimp.codecarrot.net creates maintenance issues and will break in development or staging environments.

Apply this diff to use an environment variable:

-      url: `https://docs.logchimp.codecarrot.net${page.url}`,
+      url: `${process.env.NEXT_PUBLIC_SITE_URL || 'https://docs.logchimp.codecarrot.net'}${page.url}`,

Then add NEXT_PUBLIC_SITE_URL to your .env files for different environments.

📝 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
url: `https://docs.logchimp.codecarrot.net${page.url}`,
url: `${process.env.NEXT_PUBLIC_SITE_URL || 'https://docs.logchimp.codecarrot.net'}${page.url}`,
🤖 Prompt for AI Agents
In src/app/sitemap.ts around line 23, replace the hardcoded URL prefix
`https://docs.logchimp.codecarrot.net` with a value read from the environment
(e.g. process.env.NEXT_PUBLIC_SITE_URL) and fall back to a sensible default for
local dev if needed; update the code to build each url as
`${siteUrl}${page.url}` where siteUrl is read once from
process.env.NEXT_PUBLIC_SITE_URL (validate it or throw/console.warn if missing)
and add NEXT_PUBLIC_SITE_URL to your .env files for dev/staging/production.

lastModified: new Date().toISOString(),
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

Use actual modification dates instead of current timestamp.

Setting lastModified to the current time for all pages defeats its purpose and causes search engines to unnecessarily re-crawl all content on every sitemap generation.

Consider these alternatives:

  1. Use the build timestamp (constant across all pages in a build):
+const buildTime = new Date().toISOString();
+
 export default function sitemap(): MetadataRoute.Sitemap {
   const sources = [
     // ...
   ];

   return sources.flatMap((s) =>
     s.getPages().map((page) => ({
       url: `https://docs.logchimp.codecarrot.net${page.url}`,
-      lastModified: new Date().toISOString(),
+      lastModified: buildTime,
     })),
   );
 }
  1. Better: If pages expose modification metadata, use it:
lastModified: page.lastModified || buildTime,
  1. Best: Use git commit dates for each content file (requires integration with your content source).
🤖 Prompt for AI Agents
In src/app/sitemap.ts around line 24, the sitemap currently sets lastModified to
new Date().toISOString() which stamps every page with the current time; change
this to use a stable build-level timestamp or real content modification dates
instead: create a buildTime constant at build/startup and use lastModified:
page.lastModified || buildTime when page metadata provides a modification date,
and if available integrate file/git commit dates per page for the most accurate
value; ensure lastModified is an ISO string and fall back to buildTime only when
no page-specific date exists.

})),
);
}