diff --git a/web/package.json b/web/package.json index 32faa59b..e6189d53 100644 --- a/web/package.json +++ b/web/package.json @@ -6,7 +6,7 @@ "scripts": { "install:ci": "pnpm install --frozen-lockfile", "dev": "vite", - "build": "tsc -b && vite build && node scripts/inject-docs.mjs", + "build": "tsc -b && vite build", "preview": "vite preview", "test": "vitest run", "typecheck": "tsc --noEmit", @@ -48,7 +48,6 @@ "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", - "marked": "^15.0.12", "openapi-typescript": "^7.6.1", "postcss": "^8.4.0", "tailwindcss": "^3.4.0", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 09873f84..d86a7f30 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -105,9 +105,6 @@ importers: eslint-plugin-react-refresh: specifier: ^0.4.5 version: 0.4.26(eslint@8.57.1) - marked: - specifier: ^15.0.12 - version: 15.0.12 openapi-typescript: specifier: ^7.6.1 version: 7.13.0(typescript@5.9.3) @@ -1667,11 +1664,6 @@ packages: markdown-table@3.0.4: resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} - marked@15.0.12: - resolution: {integrity: sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==} - engines: {node: '>= 18'} - hasBin: true - mdast-util-find-and-replace@3.0.2: resolution: {integrity: sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==} @@ -3985,8 +3977,6 @@ snapshots: markdown-table@3.0.4: {} - marked@15.0.12: {} - mdast-util-find-and-replace@3.0.2: dependencies: '@types/mdast': 4.0.4 diff --git a/web/public/robots.txt b/web/public/robots.txt new file mode 100644 index 00000000..b30cf757 --- /dev/null +++ b/web/public/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Sitemap: https://skill.xfyun.cn/sitemap.xml \ No newline at end of file diff --git a/web/public/sitemap.xml b/web/public/sitemap.xml new file mode 100644 index 00000000..064bdae7 --- /dev/null +++ b/web/public/sitemap.xml @@ -0,0 +1,9 @@ + + + + https://skill.xfyun.cn/ + + + https://skill.xfyun.cn/registry/skill.md + + diff --git a/web/scripts/inject-docs.mjs b/web/scripts/inject-docs.mjs deleted file mode 100644 index fc0d7a6d..00000000 --- a/web/scripts/inject-docs.mjs +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node - -import { readFileSync, writeFileSync } from 'fs'; -import { join, dirname } from 'path'; -import { fileURLToPath } from 'url'; -import { marked } from 'marked'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -// Paths -const projectRoot = join(__dirname, '../..'); -const docPath = join(projectRoot, 'docs/openclaw-integration-en.md'); -const distIndexPath = join(__dirname, '../dist/index.html'); - -console.log('📄 Reading markdown document...'); -const markdownContent = readFileSync(docPath, 'utf-8'); - -console.log('🔄 Converting markdown to HTML...'); -const htmlContent = marked.parse(markdownContent); - -console.log('📝 Reading dist/index.html...'); -const indexHtml = readFileSync(distIndexPath, 'utf-8'); - -// Create the hidden SEO container -const seoContainer = ` - - -`; - -// Inject before
-const injectedHtml = indexHtml.replace( - /
/, - `${seoContainer}\n
` -); - -console.log('💾 Writing updated index.html...'); -writeFileSync(distIndexPath, injectedHtml, 'utf-8'); - -console.log('✅ Documentation injected successfully!'); -console.log(` - Source: ${docPath}`); -console.log(` - Target: ${distIndexPath}`); -console.log(` - Content size: ~${Math.round(htmlContent.length / 1024)}KB`);