Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ public/sitemap.xml
# Scraped documentation for LLM training
scraped-docs/
/public/_scraped-docs
public/_seo-audit.json
111 changes: 110 additions & 1 deletion app/[[...mdxPath]]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,36 @@ export const generateStaticParams = generateStaticParamsFor('mdxPath');
export async function generateMetadata(props) {
const params = await props.params;
const { metadata } = await importPage(params.mdxPath);
return metadata;

const siteUrl = 'https://docs.sei.io';
const path = Array.isArray(params?.mdxPath) && params.mdxPath.length > 0 ? `/${params.mdxPath.join('/')}` : '/';
const frontmatterCanonical = metadata?.canonical;
const canonicalUrl = frontmatterCanonical
? frontmatterCanonical.startsWith('http')
? frontmatterCanonical
: `${siteUrl}${frontmatterCanonical}`
: `${siteUrl}${path}`;

const noindex = Boolean(metadata?.noindex);

return {
...metadata,
alternates: {
...(metadata?.alternates ?? {}),
canonical: canonicalUrl
},
openGraph: {
...(metadata?.openGraph ?? {}),
url: canonicalUrl
},
robots: noindex
? {
index: false,
follow: false,
googleBot: { index: false, follow: false }
}
: metadata?.robots
};
}

const Wrapper = getMDXComponents().wrapper;
Expand All @@ -15,8 +44,88 @@ export default async function Page(props) {
const params = await props.params;
const result = await importPage(params.mdxPath);
const { default: MDXContent, toc, metadata } = result;

const siteUrl = 'https://docs.sei.io';
const path = Array.isArray(params?.mdxPath) && params.mdxPath.length > 0 ? `/${params.mdxPath.join('/')}` : '/';
const canonicalUrl = metadata?.canonical ? (metadata.canonical.startsWith('http') ? metadata.canonical : `${siteUrl}${metadata.canonical}`) : `${siteUrl}${path}`;

const toTitleCase = (segment) =>
segment
.split('-')
.map((s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : s))
.join(' ');

const segments = Array.isArray(params?.mdxPath) ? params.mdxPath : [];

const breadcrumbItems = [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: siteUrl + '/'
},
...segments.map((seg, idx) => {
const href = `${siteUrl}/${segments.slice(0, idx + 1).join('/')}`;
const isLast = idx === segments.length - 1;
return {
'@type': 'ListItem',
position: idx + 2,
name: isLast && metadata?.title ? metadata.title : toTitleCase(seg),
item: href
};
})
];

const toISO8601WithTZ = (value) => {
if (!value) return undefined;
const date = new Date(value);
if (Number.isNaN(date.getTime())) {
if (typeof value === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(value)) {
return `${value}T00:00:00Z`;
}
return undefined;
}
return date.toISOString();
};

const authorJson = metadata?.author
? typeof metadata.author === 'string'
? { '@type': 'Person', name: metadata.author }
: metadata.author
: { '@type': 'Organization', name: 'Sei Network', url: 'https://sei.io' };

const techArticleJsonLd = {
'@context': 'https://schema.org',
'@type': 'TechArticle',
headline: metadata?.title ?? 'Sei Documentation',
description: metadata?.description ?? 'Documentation for Sei Network',
url: canonicalUrl,
inLanguage: 'en',
mainEntityOfPage: { '@type': 'WebPage', '@id': canonicalUrl },
author: authorJson,
datePublished: toISO8601WithTZ(metadata?.date),
dateModified: toISO8601WithTZ(metadata?.updated ?? metadata?.date),
image: metadata?.image ? (metadata.image.startsWith('http') ? metadata.image : `${siteUrl}${metadata.image}`) : `${siteUrl}/assets/docs-banner.png`,
publisher: {
'@type': 'Organization',
name: 'Sei Network',
logo: {
'@type': 'ImageObject',
url: `${siteUrl}/icon.png`
}
}
};

const breadcrumbJsonLd = {
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: breadcrumbItems
};

return (
<Wrapper toc={toc} metadata={metadata}>
<script type='application/ld+json' dangerouslySetInnerHTML={{ __html: JSON.stringify(techArticleJsonLd) }} />
<script type='application/ld+json' dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbJsonLd) }} />
<MDXContent {...props} params={params} />
</Wrapper>
);
Expand Down
34 changes: 31 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const metadata: Metadata = {
locale: 'en_US',
images: [
{
url: 'https://www.docs.sei.io/assets/docs-banner.png',
url: 'https://docs.sei.io/assets/docs-banner.png',
alt: 'Sei Docs'
}
],
Expand All @@ -37,7 +37,7 @@ export const metadata: Metadata = {
// Make sure not to specify `title` or description` as they are automatically generated from the main description and title template
card: 'summary_large_image',
creator: '@SeiNetwork',
images: ['https://www.docs.sei.io/assets/docs-banner.png']
images: ['https://docs.sei.io/assets/docs-banner.png']
},
referrer: 'origin-when-cross-origin',
keywords: ['Sei', 'Sei Network', 'Sei Blockchain', 'Sei Docs', 'Sei Documentation', 'EVM', 'ERC20', 'ERC721'],
Expand Down Expand Up @@ -72,8 +72,36 @@ export default async function RootLayout({ children }) {
<html lang='en' dir='ltr' suppressHydrationWarning style={{ width: '100%', height: '100%' }}>
<head>
<meta name='color-scheme' content='dark light' />
<link rel='canonical' href='https://docs.sei.io' />
{/* Performance: avoid early preconnects to heavy third-parties */}
<script
type='application/ld+json'
dangerouslySetInnerHTML={{
__html: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'Sei Network',
url: 'https://sei.io',
logo: 'https://docs.sei.io/icon.png',
sameAs: ['https://x.com/SeiNetwork', 'https://github.com/sei-protocol', 'https://www.linkedin.com/company/sei-network/']
})
}}
/>
<script
type='application/ld+json'
dangerouslySetInnerHTML={{
__html: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'Sei Docs',
url: 'https://docs.sei.io',
potentialAction: {
'@type': 'SearchAction',
target: 'https://docs.sei.io/?q={search_term_string}',
'query-input': 'required name=search_term_string'
}
})
}}
/>
</head>
<body style={{ width: '100%', height: '100%' }}>
<Toaster position='bottom-left' />
Expand Down
10 changes: 10 additions & 0 deletions content/cosmos-sdk/index.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
---
title: 'Cosmos SDK (Deprecated)'
description: 'Cosmos SDK and CosmWasm functionality on Sei is deprecated in favor of EVM-only per SIP-3.'
noindex: true
canonical: /evm
date: 2024-01-01
updated: 2025-10-06
image: /assets/docs-banner.png
---

import { IconArrowsExchange, IconBrain, IconCoins, IconCode, IconLayoutDashboard, IconTools } from '@tabler/icons-react';
import { LinkCard } from '../../src/components/LinkCard';
import { Callout } from 'nextra/components';
Expand Down
3 changes: 3 additions & 0 deletions content/evm/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ keywords:
- web3 development
- blockchain development
- fast evm
image: /assets/docs-banner.png
date: 2024-01-01
updated: 2025-10-06
---

import { IconArrowsExchange, IconBrain, IconWand, IconCode, IconLayoutDashboard, IconTools, IconSettingsAutomation, IconPackage, IconDashboard, IconRocket, IconServer, IconChevronRight, IconBolt, IconArrowRight, IconTerminal2, IconNetwork, IconExternalLink, IconChartBar, IconBrandGithub, IconGitBranch, IconDeviceDesktop, IconClock, IconBuildingBridge, IconCloud, IconInfoCircle } from '@tabler/icons-react';
Expand Down
4 changes: 4 additions & 0 deletions content/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: 'Home'
description: 'Sei documentation: guides, references, and tutorials for building on the Sei EVM and ecosystem.'
image: /assets/docs-banner.png
date: 2024-01-01
updated: 2025-10-06
---

import { IconBolt, IconCode, IconClipboardText, IconLock, IconWallet, IconBook, IconTerminal2, IconServer, IconDeviceDesktop, IconExternalLink, IconChevronRight, IconRocket, IconCoins, IconRobot, IconCreditCard, IconCpu, IconDatabase, IconClock } from '@tabler/icons-react';
Expand Down
3 changes: 3 additions & 0 deletions content/learn/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: 'Learn About Sei'
description: "Discover Sei Network's architecture, performance features, and ecosystem, with detailed resources on consensus, tokenomics, governance, and development frameworks."
keywords: ['sei blockchain', 'performance blockchain', 'evm compatibility', 'blockchain architecture', 'consensus mechanism', 'developer resources']
image: /assets/docs-banner.png
date: 2024-01-01
updated: 2025-10-06
---

import { IconHexagons, IconArrowsShuffle, IconBolt, IconWallet, IconRocket, IconArrowRight, IconCoins, IconGasStation, IconUsersGroup, IconKey, IconGavel, IconClock, IconNetwork, IconWorldWww, IconServer, IconCpu, IconDatabase, IconChartLine, IconDeviceMobile, IconUsers } from '@tabler/icons-react';
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"check-links": "node scripts/check-links.mjs",
"scrape-docs": "node scripts/scrape-docs-html.js",
"upload-to-trieve": "node scripts/upload-to-trieve.js",
"seo:audit": "node scripts/audit-content-seo.mjs",
"test": "jest",
"test:watch": "jest --watch",
"prepare": "husky"
Expand Down
Loading
Loading