diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx
index cc27f17..e746054 100644
--- a/app/blog/[slug]/page.tsx
+++ b/app/blog/[slug]/page.tsx
@@ -151,6 +151,36 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
) : null}
+
diff --git a/app/page.tsx b/app/page.tsx
index 54f42aa..d9dd725 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -15,7 +15,6 @@ export const metadata: Metadata = {
alternates: { canonical: "/" },
title: "RustFS | High-Performance S3 Object Storage for AI & Cloud-Native",
description: 'RustFS is an open-source, Apache 2.0-licensed distributed object storage system built in Rust. A high-performance, drop-in replacement for MinIO and Amazon S3 engineered for AI workloads.',
- keywords: 'RustFS, object storage, distributed storage, open source, Rust, Amazon S3, MinIO alternative, MinIO migration, Apache 2.0, cloud native storage, AI infrastructure',
authors: [{ name: 'RustFS Team' }],
openGraph: {
title: "RustFS | High-Performance S3 Object Storage for AI & Cloud-Native",
@@ -50,6 +49,30 @@ export default async function HomePage() {
+
);
}
diff --git a/components/business/home-blog.tsx b/components/business/home-blog.tsx
index 64cf4fc..9d320cd 100644
--- a/components/business/home-blog.tsx
+++ b/components/business/home-blog.tsx
@@ -40,7 +40,7 @@ export default async function HomeBlog({ className }: HomeBlogProps) {

diff --git a/scripts/generate-sitemap.js b/scripts/generate-sitemap.js
index 9742dd4..2a73877 100755
--- a/scripts/generate-sitemap.js
+++ b/scripts/generate-sitemap.js
@@ -2,6 +2,7 @@
import fs from 'node:fs';
import path from 'node:path';
+import { execSync } from 'node:child_process';
import { pathToFileURL } from 'node:url';
// Configuration
@@ -22,6 +23,61 @@ const PAGE_CHANGE_FREQ = {
'/download/': 'monthly',
}
+
+/**
+ * Get the last git commit date for a given directory/file path.
+ * Falls back to current time if git is unavailable or path is untracked.
+ */
+function getGitLastMod(filePath) {
+ try {
+ const result = execSync(
+ `git log -1 --format=%cI -- "${filePath}"`,
+ { encoding: 'utf8', timeout: 3000 }
+ ).trim();
+ if (result) return result;
+ } catch {
+ // git not available or path not in repo; fall through
+ }
+ return new Date().toISOString();
+}
+
+const URL_SOURCE_MAP = {
+ '/': ['app/page.tsx', 'app/layout.tsx'],
+ '/download/': ['app/download/page.tsx'],
+ '/download/server/': ['app/download/server/page.tsx'],
+ '/download/cli/': ['app/download/cli/page.tsx'],
+ '/pricing/': ['app/pricing/page.tsx'],
+ '/about/': ['app/about/page.tsx'],
+}
+
+function urlToSourcePath(url) {
+ if (URL_SOURCE_MAP[url]) return URL_SOURCE_MAP[url];
+ if (url.startsWith('/blog/') && url !== '/blog/' && !url.startsWith('/blog/tag/')) {
+ const slug = url.replace('/blog/', '').replace(/\/$/, '');
+ // Blog dirs are content/blog/
-/index.mdx
+ const matchingDirs = fs.readdirSync('content/blog').filter(d => d.endsWith(slug));
+ if (matchingDirs.length > 0) {
+ return [`content/blog/${matchingDirs[0]}/index.mdx`];
+ }
+ return [`content/blog/${slug}/index.mdx`];
+ }
+ if (url.startsWith('/product/')) {
+ return [`app${url}page.tsx`];
+ }
+ return [`app${url}page.tsx`];
+}
+
+function getLastMod(url) {
+ const sourcePaths = urlToSourcePath(url);
+ let latestDate = null;
+ for (const src of sourcePaths) {
+ if (!fs.existsSync(src)) continue;
+ const date = getGitLastMod(src);
+ if (!latestDate || date > latestDate) latestDate = date;
+ }
+ return latestDate || new Date().toISOString();
+}
+
// Scan directory and generate URL list
function scanDirectory(dirPath, basePath = '') {
const urls = []
@@ -62,18 +118,16 @@ function getPageChangeFreq(url) {
// Generate sitemap XML
function generateSitemap(urls) {
- const now = new Date().toISOString()
-
let xml = '\n'
xml += '\n'
for (const url of urls) {
+ const lastmod = getLastMod(url)
xml += ' \n'
xml += ` ${BASE_URL}${url}\n`
- xml += ` ${now}\n`
+ xml += ` ${lastmod}\n`
xml += ` ${getPageChangeFreq(url)}\n`
xml += ` ${getPagePriority(url)}\n`
-
xml += ' \n'
}
@@ -129,6 +183,8 @@ function main() {
console.log(`📝 Found ${urls.length} URLs:`)
urls.forEach(url => console.log(` ${url}`))
+ console.log('🕐 Fetching git commit dates for realistic lastmod values...');
+
// Generate sitemap
const sitemap = generateSitemap(urls)