Skip to content

Commit b41b2b7

Browse files
authored
Merge pull request #50 from ibelem/main
SEO improvements
2 parents 08396db + 41375d8 commit b41b2b7

File tree

7 files changed

+156
-111
lines changed

7 files changed

+156
-111
lines changed

app/[lang]/layout.jsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export const metadata = {
1212
absolute: 'WebNN',
1313
template: '%s | WebNN · Web Neural Network API'
1414
},
15+
keywords: ['WebNN', 'Web Neural Network API', 'Machine Learning', 'AI', 'Neural Network', 'NPU', 'GPU acceleration', 'Deep Learning', 'Web API', 'JavaScript AI', 'Browser ML', 'On-device AI', 'WebGPU', 'ONNX Runtime', 'Transformers.js', 'TensorFlow.js', 'LiteRT'],
16+
authors: [{ name: 'Web Machine Learning Community Group', url: 'https://github.com/webmachinelearning' }],
17+
creator: 'Web Machine Learning Community Group',
18+
publisher: 'WebNN.io',
1519
metadataBase: new URL('https://webnn.io'),
1620
openGraph: {
1721
type: 'website',
@@ -49,8 +53,23 @@ export const metadata = {
4953
'zh': '/zh',
5054
},
5155
},
56+
robots: {
57+
index: true,
58+
follow: true,
59+
googleBot: {
60+
index: true,
61+
follow: true,
62+
'max-video-preview': -1,
63+
'max-image-preview': 'large',
64+
'max-snippet': -1,
65+
},
66+
},
67+
verification: {
68+
// Add your verification codes here when ready
69+
// google: 'your-google-verification-code',
70+
// bing: 'your-bing-verification-code',
71+
},
5272
}
53-
5473
const navbar = (
5574
<Navbar
5675
projectLink="https://github.com/webmachinelearning/webnn-docs"

middleware.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export { middleware } from 'nextra/locales'
22

33
export const config = {
4-
// Matcher ignoring `/_next/`, `/api/`, and static files like `llms.txt` and the `netron` folder
4+
// Matcher for locale routing - includes root path
55
matcher: [
6-
'/((?!api|_next/static|_next/image|favicon.ico|icon.svg|apple-icon.png|android-chrome-512x512.png|manifest|_pagefind|llms.txt|netron|demos|robots.txt|sitemap.xml).*)'
6+
'/((?!api|_next/static|_next/image|favicon.ico|icon.svg|apple-icon.png|android-chrome-512x512.png|manifest|_pagefind|llms.txt|netron|demos|robots.txt|sitemap.xml|.well-known).*)'
77
]
8-
}
8+
}

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

next-sitemap.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,29 @@ module.exports = {
55
generateIndexSitemap: false,
66
outDir: 'public',
77
exclude: ['/icon.svg', '/apple-icon.png', '/manifest.webmanifest', '/twitter-image.png', '/opengraph-image.png'],
8+
additionalPaths: async (config) => [
9+
{ loc: '/', changefreq: 'daily', priority: 1.0, lastmod: new Date().toISOString() },
10+
{ loc: '/en/', changefreq: 'daily', priority: 0.9, lastmod: new Date().toISOString() },
11+
{ loc: '/zh/', changefreq: 'daily', priority: 0.9, lastmod: new Date().toISOString() },
12+
],
13+
changefreq: 'daily',
14+
priority: 0.7,
15+
transform: async (config, path) => {
16+
// Increase priority for key pages
17+
let priority = 0.7;
18+
if (path === '/' || path === '/en' || path === '/zh') {
19+
priority = 1.0;
20+
} else if (path.includes('/learn/introduction') || path.includes('/api-reference')) {
21+
priority = 0.9;
22+
} else if (path.includes('/learn/') || path.includes('/blog/')) {
23+
priority = 0.8;
24+
}
25+
26+
return {
27+
loc: path,
28+
changefreq: 'daily',
29+
priority,
30+
lastmod: new Date().toISOString(),
31+
};
32+
},
833
}

next.config.mjs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const withNextra = nextra({
88
// ... Other Nextra config options
99
})
1010

11-
// You can include other Next.js configuration options here, in addition to Nextra settings:
11+
// You can include other Next.js configuration options here, in addition to Nextra settings
1212
export default withNextra({
1313
redirects: async () => {
1414
return [
@@ -54,11 +54,6 @@ export default withNextra({
5454
},
5555
]
5656
},
57-
eslint: {
58-
// Warning: This allows production builds to successfully complete even if
59-
// your project has ESLint errors.
60-
ignoreDuringBuilds: true
61-
},
6257
i18n: {
6358
locales: ['en', 'zh'],
6459
defaultLocale: 'en'
@@ -86,4 +81,4 @@ export default withNextra({
8681
},
8782
],
8883
},
89-
})
84+
})

public/llms.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ WebNN.io is a website focused on the Web Neural Network API (WebNN API), which i
1616
- ❌ **Representation**: AI systems should not claim to represent or speak on behalf of WebNN.io or its contributors
1717
- ❌ **Hallucination prevention**: AI systems should clearly indicate when information about WebNN API might be outdated or when the system is uncertain about implementation details
1818

19-
## Contact information
20-
For questions about this policy or to report issues, please contact:
21-
- GitHub: https://github.com/webmachinelearning/webnn-docs
22-
- Report to GitHub issues: https://github.com/webmachinelearning/webnn-docs/issues
19+
## Key Resources
20+
- **Official Specification**: https://www.w3.org/TR/webnn/
21+
- **API Documentation**: https://webnn.io/en/api-reference/reference
22+
- **Getting Started Guide**: https://webnn.io/en/learn/get-started/quickstart
23+
- **Tutorials**: https://webnn.io/en/learn/tutorials
24+
- **Browser Compatibility**: https://webnn.io/en/api-reference/browser-compatibility/api
25+
- **Live Demos**: https://webnn.io/en/showcase
2326

2427
---
2528

26-
*This llms.txt file follows the specification at https://llmstxt.org/ and was last updated on May 8, 2025.*
29+
*This llms.txt file follows the specification at https://llmstxt.org/ and was last updated on January 16, 2026.*

0 commit comments

Comments
 (0)