feat: dimension SEO/GEO——robots/sitemap/llms.txt/about 站长验证文件 + 体验优化

This commit is contained in:
Yuzhiran Dev
2026-09-05 12:24:17 +08:00
parent 9870bee3b8
commit ea7816bae4
2 changed files with 132 additions and 6 deletions
+30 -6
View File
@@ -2,14 +2,38 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/static/favicon.svg" />
<title>宇之然AI维度 - AI 知识探索社区</title> <title>宇之然AI维度 - AI知识探索社区 | 五维度系统学AI</title>
<meta name="description" content="宇之然AI维度 — 从5个维度系统理解人工智能:AI起源、发展、当前格局、学习工具、趋势跟踪。" /> <meta name="description" content="宇之然AI维度:从起源、发展、格局、工具、趋势五个维度,系统理解人工智能。每日更新AI行业趋势与热点,支持问答、收藏与学习进度跟踪。" />
<meta name="keywords" content="宇之然AI维度,AI知识,人工智能学习,AI科普,AI趋势,大模型学习" /> <meta name="keywords" content="宇之然AI维度,AI知识,AI学习,人工智能科普,AI趋势,AI大模型,AI问答,AI工具" />
<meta name="author" content="宇之然" />
<meta name="robots" content="index,follow" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="宇之然AI维度" />
<meta property="og:title" content="宇之然AI维度 - AI知识探索社区" />
<meta property="og:description" content="五维度系统学AI:起源、发展、格局、工具、趋势。每日AI行业热点更新。" />
<meta property="og:locale" content="zh_CN" />
<meta name="twitter:card" content="summary" />
<meta name="format-detection" content="telephone=no" />
<meta name="theme-color" content="#6366f1" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "宇之然AI维度",
"description": "从五个维度系统理解人工智能的AI知识探索社区:AI起源、发展、当前格局、学习工具、趋势跟踪。",
"applicationCategory": "EducationalApplication",
"operatingSystem": "Web, 微信小程序",
"inLanguage": "zh-CN",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "CNY" }
}
</script>
<!--preload-links-->
<!--app-context-->
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"><!--app-html--></div>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>
+102
View File
@@ -0,0 +1,102 @@
import express from 'express'
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const router = express.Router()
const SITE = process.env.SITE_URL || ''
const origin = (req) => (SITE ? SITE.replace(/\/$/, '') : `${req.protocol}://${req.get('host')}`)
const DESC =
'宇之然AI维度:从五个维度(AI起源、发展、当前格局、学习工具、趋势跟踪)系统理解人工智能的知识探索社区。每日更新AI行业趋势与热点,支持问答、收藏与学习进度跟踪。'
const FAQ = [
['宇之然AI维度是什么?', '一个AI知识探索社区:从五个维度系统梳理人工智能的起源、发展、当前格局、学习工具与行业趋势,并每日更新AI热点。'],
['适合谁使用?', 'AI 零基础入门者、关注AI行业动态的从业者、需要结构化AI知识体系的学生与内容创作者。'],
['内容如何保持新鲜?', '内置AI趋势定时采集,每天两次更新行业热点;支持问答与知识扩展。'],
['免费使用吗?', '基础浏览与问答免费,注册登录后可使用收藏与学习进度等完整功能。'],
['有微信小程序吗?', '有。微信搜索"AI维度"即可使用,数据与网页端同步。'],
]
router.get('/robots.txt', (req, res) => {
const o = origin(req)
res.type('text/plain').send(
[
'User-agent: *',
'Allow: /',
'Disallow: /api/',
'',
'User-agent: GPTBot',
'Allow: /',
'User-agent: ClaudeBot',
'Allow: /',
'User-agent: PerplexityBot',
'Allow: /',
'',
`Sitemap: ${o}/sitemap.xml`,
'',
].join('\n')
)
})
router.get('/sitemap.xml', (req, res) => {
const o = origin(req)
const today = new Date().toISOString().slice(0, 10)
const urls = ['/', '/pages/trend/trend', '/pages/chat/chat', '/pages/dimension/dimension']
res.type('application/xml').send(
`<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n` +
urls.map((u) => ` <url><loc>${o}${u}</loc><lastmod>${today}</lastmod></url>`).join('\n') +
`\n</urlset>`
)
})
router.get('/llms.txt', (req, res) => {
const o = origin(req)
res.type('text/markdown').send(
`# 宇之然AI维度
> ${DESC}
## 核心内容
- 五维度知识体系:AI起源、发展脉络、当前格局、学习工具、趋势跟踪
- 每日AI趋势:定时采集行业热点(融资、产品发布、论文)
- AI问答:基于知识库的智能问答
## 免费与付费
- 浏览与基础问答免费;注册登录解锁收藏与学习进度
## 链接
- [常见问题与产品说明](${o}/about)
- [在线使用](${o}/)
`
)
})
router.get('/about', (req, res) => {
const o = origin(req)
const faqHtml = FAQ.map(([q, a]) => `<div class="faq"><h3>${q}</h3><p>${a}</p></div>`).join('')
const faqLd = JSON.stringify({
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: FAQ.map(([q, a]) => ({ '@type': 'Question', name: q, acceptedAnswer: { '@type': 'Answer', text: a } })),
})
res.type('html').send(`<!doctype html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>宇之然AI维度 - 产品介绍与常见问题 | AI知识探索社区</title>
<meta name="description" content="${DESC} 产品介绍与常见问题。">
<link rel="canonical" href="${o}/about">
<script type="application/ld+json">${faqLd}</script>
<style>body{font-family:-apple-system,'PingFang SC',sans-serif;color:#1f2333;max-width:720px;margin:0 auto;padding:32px 20px;line-height:1.8}h1{font-size:24px}h2{margin-top:28px}h3{font-size:16px;margin:12px 0 4px}.badge{display:inline-block;background:#6366f1;color:#fff;border-radius:999px;padding:4px 14px;font-size:13px}</style>
</head><body>
<span class="badge">AI 知识探索社区</span>
<h1>宇之然AI维度</h1>
<p>${DESC}</p>
<h2>五个维度</h2><ol><li>AI 起源与历史</li><li>技术发展脉络</li><li>当前行业格局</li><li>学习工具与资源</li><li>趋势跟踪</li></ol>
<h2>常见问题</h2>${faqHtml}
<p style="color:#999;font-size:12px;margin-top:24px">© ${new Date().getFullYear()} 宇之然 · 微信小程序搜索"AI维度"</p>
</body></html>`)
})
export default router