Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sitemap.xml #368

Merged
merged 2 commits into from
May 28, 2024
Merged
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
43 changes: 43 additions & 0 deletions apps/nextra/next-sitemap.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// next-sitemap.config.mjs

/**
* @type {import('next-sitemap').IConfig}
*/
export default {
siteUrl: process.env.SITE_URL || "https://preview.aptos.dev",
generateRobotsTxt: true,
sitemapSize: 5000,
outDir: "public",
};

// Example Support for different locales in sitemap
// /**
// * @type {import('next-sitemap').IConfig}
// */
// const config = {
// siteUrl: process.env.SITE_URL || 'https://preview.aptos.dev', // Base URL of your site
// generateRobotsTxt: true, // Generate a robots.txt file
// sitemapSize: 5000, // Split sitemap into multiple files if there are more than 5000 URLs
// outDir: 'public', // Output directory for the generated sitemap files
// alternateRefs: [
// {
// href: 'https://es.preview.aptos.dev', // URL for the Spanish version of the site
// hreflang: 'es', // Language code for Spanish
// },
// {
// href: 'https://fr.preview.aptos.dev', // URL for the French version of the site
// hreflang: 'fr', // Language code for French
// },
// ],
// transform: async (config, path) => {
// return {
// loc: path, // The URL of the page
// changefreq: config.changefreq, // How frequently the page changes
// priority: config.priority, // Priority of the page
// lastmod: config.autoLastmod ? new Date().toISOString() : undefined, // Last modification date
// alternateRefs: config.alternateRefs ?? [], // Alternate language URLs
// };
// },
// };

// export default config;
3 changes: 2 additions & 1 deletion apps/nextra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"debug": "NODE_OPTIONS='--inspect' next dev",
"dev": "next -p 3030",
"prebuild": "node nextra-remote-filepaths/fetch.js",
"postbuild": "node postbuild.js",
"postbuild": "node postbuild.js && next-sitemap --config next-sitemap.config.mjs",
"predev": "pnpm prebuild",
"start": "next start -p 3030",
"types:check": "tsc --noEmit",
Expand All @@ -37,6 +37,7 @@
"intersection-observer": "^0.10.0",
"markdown-to-jsx": "^6.11.4",
"next": "^14.2.3",
"next-sitemap": "^4.2.3",
"nextra": "3.0.0-alpha.24",
"nextra-theme-docs": "3.0.0-alpha.24",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/nextra/pages/api/og.png.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default async function (req) {
letterSpacing: -1,
display: "flex",
flexDirection: "row",
alignItems: 'center',
alignItems: "center",
gap: 24,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/nextra/pages/en/build/advanced-guides/_meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
"key-rotation": {
title: "Account Key Rotation",
},
"wallets": {
wallets: {
title: "Aptos Wallet Standard",
},
"keyless-accounts": {
Expand Down
9 changes: 9 additions & 0 deletions apps/nextra/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# *
User-agent: *
Allow: /

# Host
Host: https://preview.aptos.dev

# Sitemaps
Sitemap: https://preview.aptos.dev/sitemap.xml
256 changes: 256 additions & 0 deletions apps/nextra/public/sitemap-0.xml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions apps/nextra/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://preview.aptos.dev/sitemap-0.xml</loc></sitemap>
</sitemapindex>
25 changes: 25 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading