Skip to content

Commit

Permalink
chore(sitemap): update sitemap config and sitemap.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
ruru-m07 committed Sep 24, 2024
1 parent a99f540 commit 40ffc6e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 49 deletions.
16 changes: 0 additions & 16 deletions apps/www/next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
const { execSync } = require("child_process");

/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || "https://ruru-ui.vercel.app",
generateRobotsTxt: true,
exclude: ["/api/*"],
transform: async (config, path) => {
const lastmod = await getLastModifiedDate(path);
return {
loc: path,
changefreq: config.changefreq,
priority: config.priority,
lastmod,
alternateRefs: config.alternateRefs ?? [],
};
},
};

async function getLastModifiedDate(path) {
try {
const timestamp = execSync(`git log -1 --format=%ct ${path}`)
.toString()
.trim();
return new Date(parseInt(timestamp, 10) * 1000).toISOString();
} catch (error) {
console.error(`Error getting last modified date for ${path}:`, error);
return new Date().toISOString(); // Fallback to current date
}
}
3 changes: 3 additions & 0 deletions apps/www/public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
User-agent: *
Allow: /

# Host
Host: https://ruru-ui.vercel.app

# Sitemaps
Sitemap: https://ruru-ui.vercel.app/sitemap.xml
67 changes: 34 additions & 33 deletions apps/www/public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://ruru-ui.vercel.app/color</loc><lastmod>2024-09-19T13:01:48.136Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/playground</loc><lastmod>2024-09-19T13:01:48.366Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks/login-1</loc><lastmod>2024-09-19T13:01:48.627Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks/register-1</loc><lastmod>2024-09-19T13:01:49.034Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks/forgot-1</loc><lastmod>2024-09-19T13:01:49.467Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/theme__</loc><lastmod>2024-09-19T13:01:49.716Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/sponsors</loc><lastmod>2024-09-19T13:01:50.000Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app</loc><lastmod>2024-09-19T13:01:50.303Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/animation</loc><lastmod>2024-09-19T13:01:50.579Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/block</loc><lastmod>2024-09-19T13:01:50.826Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/cli</loc><lastmod>2024-09-19T13:01:51.081Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/dark-mode</loc><lastmod>2024-09-19T13:01:51.334Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/hooks</loc><lastmod>2024-09-19T13:01:51.578Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs</loc><lastmod>2024-09-19T13:01:51.780Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/installation</loc><lastmod>2024-09-19T13:01:52.025Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/provider</loc><lastmod>2024-09-19T13:01:52.231Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/ruru-json</loc><lastmod>2024-09-19T13:01:52.420Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/avatar</loc><lastmod>2024-09-19T13:01:52.683Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/badge</loc><lastmod>2024-09-19T13:01:52.876Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/button</loc><lastmod>2024-09-19T13:01:53.131Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/checkbox</loc><lastmod>2024-09-19T13:01:53.356Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/form</loc><lastmod>2024-09-19T13:01:53.544Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/input</loc><lastmod>2024-09-19T13:01:53.758Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/label</loc><lastmod>2024-09-19T13:01:53.997Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/modal</loc><lastmod>2024-09-19T13:01:54.221Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/select</loc><lastmod>2024-09-19T13:01:54.408Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/spinner</loc><lastmod>2024-09-19T13:01:54.635Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/switch</loc><lastmod>2024-09-19T13:01:54.854Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/tabs</loc><lastmod>2024-09-19T13:01:55.093Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/textarea</loc><lastmod>2024-09-19T13:01:55.282Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/tooltip</loc><lastmod>2024-09-19T13:01:55.480Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks</loc><lastmod>2024-09-19T13:01:55.645Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/theme</loc><lastmod>2024-09-19T13:01:55.883Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/theme__</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/color</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks/login-1</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks/register-1</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks/forgot-1</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/playground</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/animation</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/block</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/cli</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/dark-mode</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/hooks</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/installation</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/provider</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/ruru-json</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/avatar</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/badge</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/button</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/checkbox</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/dropzone</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/form</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/input</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/label</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/modal</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/select</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/spinner</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/switch</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/tabs</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/textarea</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/docs/components/tooltip</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/sponsors</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/theme</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://ruru-ui.vercel.app/blocks</loc><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>

0 comments on commit 40ffc6e

Please sign in to comment.