diff --git a/.codechina-ci.yml b/.codechina-ci.yml index 5a6173b33df50f1f70881d9291ecf7cd731f263e..59413122ac5212c150015bb8363c55e90f976a84 100644 --- a/.codechina-ci.yml +++ b/.codechina-ci.yml @@ -9,6 +9,7 @@ pages: - yarn install # npm install - yarn add -D vuepress # npm install -D vuepress - yarn docs:build # npm run docs:build + - cp robots.txt public/ - mv docs/.vuepress/dist public artifacts: paths: diff --git a/.gitignore b/.gitignore index 099a341bdb2651bcb963dd93c7e65260b09e642a..efb7c0f578d5d6c5cef68ea48159ef3019b2c199 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules -docs/.vuepress/dist \ No newline at end of file +docs/.vuepress/dist +.vscode +package-lock.json \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 95da7ec2beef3269e75624038e739993a22c8a3a..f7bdba1ad250baa53f31a5fedc1df8f5a0d4d044 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,4 +1,11 @@ // .vuepress/config.js +const autometa_options = { + site: { + name: 'Spring 中文文档社区' + }, + canonical_base: 'https://dev-cloud.gitcode.host/spring/', +}; + module.exports = { title: "Spring 中文文档社区", base: "/spring/", @@ -46,11 +53,13 @@ module.exports = { { rel: 'mask-icon', href: '/images/icons/favicon.ico', - color: '#3eaf7c', + color: '#5dac38', }, ], - ['meta', { name: 'msapplication-TileColor', content: '#3eaf7c' }], - ['meta', { name: 'theme-color', content: '#3eaf7c' }], + ['meta', { name: 'msapplication-TileColor', content: '#5dac38' }], + ['meta', { name: 'theme-color', content: '#5dac38' }], + ['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1' }], + ['meta', { 'http-equiv': 'X-UA-Compatible', 'content': 'IE=edge' }] ], locales: { '/en/': { @@ -64,6 +73,14 @@ module.exports = { description: '' } }, + plugins: [ + ['autometa', autometa_options], + ['sitemap', { + hostname: "https://dev-cloud.gitcode.host/spring/", + // 排除无实际内容的页面 + exclude: ["/404.html"] + }] + ], themeConfig: { repo: "https://gitcode.net/dev-cloud/spring", repoLabel: "GitCode", diff --git a/docs/.vuepress/configs/index.ts b/docs/.vuepress/configs/index.ts deleted file mode 100644 index a65b516065bf9edaa9a77b00f404739046fcb654..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * as navbar from './navbar' -export * as sidebar from './sidebar' diff --git a/docs/.vuepress/configs/meta.ts b/docs/.vuepress/configs/meta.ts deleted file mode 100644 index 9ad6a43977cb31055f43c90e2d9f23921c440781..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/meta.ts +++ /dev/null @@ -1 +0,0 @@ -export { version } from '../../../lerna.json' diff --git a/docs/.vuepress/configs/navbar/en.ts b/docs/.vuepress/configs/navbar/en.ts deleted file mode 100644 index 29b1020b74a25f66341a0dc067b9f15fffdc949d..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/navbar/en.ts +++ /dev/null @@ -1,140 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default' -import { version } from '../meta' - -export const en: NavbarConfig = [ - { - text: 'Guide', - link: '/guide/', - }, - { - text: 'Reference', - children: [ - { - text: 'VuePress', - children: [ - { - text: 'CLI', - link: '/reference/cli.html', - }, - '/reference/config.md', - '/reference/frontmatter.md', - '/reference/components.md', - '/reference/plugin-api.md', - '/reference/theme-api.md', - '/reference/client-api.md', - '/reference/node-api.md', - ], - }, - { - text: 'Bundlers', - children: [ - '/reference/bundler/vite.md', - '/reference/bundler/webpack.md', - ], - }, - { - text: 'Default Theme', - children: [ - '/reference/default-theme/config.md', - '/reference/default-theme/frontmatter.md', - '/reference/default-theme/components.md', - '/reference/default-theme/markdown.md', - '/reference/default-theme/styles.md', - '/reference/default-theme/extending.md', - ], - }, - ], - }, - { - text: 'Plugins', - children: [ - { - text: 'Common Features', - children: [ - '/reference/plugin/back-to-top.md', - '/reference/plugin/container.md', - '/reference/plugin/external-link-icon.md', - '/reference/plugin/google-analytics.md', - '/reference/plugin/medium-zoom.md', - '/reference/plugin/nprogress.md', - '/reference/plugin/register-components.md', - ], - }, - { - text: 'Content Search', - children: [ - '/reference/plugin/docsearch.md', - '/reference/plugin/search.md', - ], - }, - { - text: 'PWA', - children: [ - '/reference/plugin/pwa.md', - '/reference/plugin/pwa-popup.md', - ], - }, - { - text: 'Syntax Highlighting', - children: [ - '/reference/plugin/prismjs.md', - '/reference/plugin/shiki.md', - ], - }, - { - text: 'Theme Development', - children: [ - '/reference/plugin/active-header-links.md', - '/reference/plugin/git.md', - '/reference/plugin/palette.md', - '/reference/plugin/theme-data.md', - '/reference/plugin/toc.md', - ], - }, - ], - }, - { - text: 'Learn More', - children: [ - { - text: 'Advanced', - children: [ - '/advanced/architecture.md', - '/advanced/plugin.md', - '/advanced/theme.md', - { - text: 'Cookbook', - link: '/advanced/cookbook/', - }, - ], - }, - { - text: 'Resources', - children: [ - '/contributing.md', - { - text: 'Awesome VuePress', - link: 'https://github.com/vuepress/awesome-vuepress', - }, - ], - }, - ], - }, - { - text: `v${version}`, - children: [ - { - text: 'Changelog', - link: 'https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md', - }, - { - text: 'v1.x', - link: 'https://v1.vuepress.vuejs.org', - }, - { - text: 'v0.x', - link: 'https://v0.vuepress.vuejs.org', - }, - ], - }, -] diff --git a/docs/.vuepress/configs/navbar/index.ts b/docs/.vuepress/configs/navbar/index.ts deleted file mode 100644 index c09551765946295eca22afe649ac22274633f472..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/navbar/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './en' -export * from './zh' diff --git a/docs/.vuepress/configs/navbar/zh.ts b/docs/.vuepress/configs/navbar/zh.ts deleted file mode 100644 index 367496f1a713dba3308eb2341c4a40bc9e417b8d..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/navbar/zh.ts +++ /dev/null @@ -1,137 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default' -import { version } from '../meta' - -export const zh: NavbarConfig = [ - { - text: '指南', - link: '/zh/guide/', - }, - { - text: '参考', - children: [ - { - text: 'VuePress', - children: [ - '/zh/reference/cli.md', - '/zh/reference/config.md', - '/zh/reference/frontmatter.md', - '/zh/reference/components.md', - '/zh/reference/plugin-api.md', - '/zh/reference/theme-api.md', - '/zh/reference/client-api.md', - '/zh/reference/node-api.md', - ], - }, - { - text: '打包工具', - children: [ - '/zh/reference/bundler/vite.md', - '/zh/reference/bundler/webpack.md', - ], - }, - { - text: '默认主题', - children: [ - '/zh/reference/default-theme/config.md', - '/zh/reference/default-theme/frontmatter.md', - '/zh/reference/default-theme/components.md', - '/zh/reference/default-theme/markdown.md', - '/zh/reference/default-theme/styles.md', - '/zh/reference/default-theme/extending.md', - ], - }, - ], - }, - { - text: '插件', - children: [ - { - text: '常用功能', - children: [ - '/zh/reference/plugin/back-to-top.md', - '/zh/reference/plugin/container.md', - '/zh/reference/plugin/external-link-icon.md', - '/zh/reference/plugin/google-analytics.md', - '/zh/reference/plugin/medium-zoom.md', - '/zh/reference/plugin/nprogress.md', - '/zh/reference/plugin/register-components.md', - ], - }, - { - text: '内容搜索', - children: [ - '/zh/reference/plugin/docsearch.md', - '/zh/reference/plugin/search.md', - ], - }, - { - text: 'PWA', - children: [ - '/zh/reference/plugin/pwa.md', - '/zh/reference/plugin/pwa-popup.md', - ], - }, - { - text: '语法高亮', - children: [ - '/zh/reference/plugin/prismjs.md', - '/zh/reference/plugin/shiki.md', - ], - }, - { - text: '主题开发', - children: [ - '/zh/reference/plugin/active-header-links.md', - '/zh/reference/plugin/git.md', - '/zh/reference/plugin/palette.md', - '/zh/reference/plugin/theme-data.md', - '/zh/reference/plugin/toc.md', - ], - }, - ], - }, - { - text: '了解更多', - children: [ - { - text: '深入', - children: [ - '/zh/advanced/architecture.md', - '/zh/advanced/plugin.md', - '/zh/advanced/theme.md', - { - text: 'Cookbook', - link: '/zh/advanced/cookbook/', - }, - ], - }, - { - text: '其他资源', - children: [ - '/zh/contributing.md', - { - text: 'Awesome VuePress', - link: 'https://github.com/vuepress/awesome-vuepress', - }, - ], - }, - ], - }, - { - text: `v${version}`, - children: [ - { - text: '更新日志', - link: 'https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md', - }, - { - text: 'v1.x', - link: 'https://v1.vuepress.vuejs.org/zh/', - }, - { - text: 'v0.x', - link: 'https://v0.vuepress.vuejs.org/zh/', - }, - ], - }, -] diff --git a/docs/.vuepress/configs/sidebar/en.ts b/docs/.vuepress/configs/sidebar/en.ts deleted file mode 100644 index e83c2bf759d75b0cf4a99220d6c03ffba68e2d04..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/sidebar/en.ts +++ /dev/null @@ -1,126 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default' - -export const en: SidebarConfig = { - '/guide/': [ - { - text: 'Guide', - children: [ - '/guide/README.md', - '/guide/getting-started.md', - '/guide/configuration.md', - '/guide/page.md', - '/guide/markdown.md', - '/guide/assets.md', - '/guide/i18n.md', - '/guide/deployment.md', - '/guide/theme.md', - '/guide/plugin.md', - '/guide/bundler.md', - '/guide/migration.md', - ], - }, - ], - '/advanced/': [ - { - text: 'Advanced', - children: [ - '/advanced/architecture.md', - '/advanced/plugin.md', - '/advanced/theme.md', - ], - }, - { - text: 'Cookbook', - children: [ - '/advanced/cookbook/README.md', - '/advanced/cookbook/usage-of-client-app-enhance.md', - '/advanced/cookbook/adding-extra-pages.md', - '/advanced/cookbook/making-a-theme-extendable.md', - '/advanced/cookbook/passing-data-to-client-code.md', - '/advanced/cookbook/markdown-and-vue-sfc.md', - ], - }, - ], - '/reference/': [ - { - text: 'VuePress Reference', - collapsible: true, - children: [ - '/reference/cli.md', - '/reference/config.md', - '/reference/frontmatter.md', - '/reference/components.md', - '/reference/plugin-api.md', - '/reference/theme-api.md', - '/reference/client-api.md', - '/reference/node-api.md', - ], - }, - { - text: 'Bundlers Reference', - collapsible: true, - children: ['/reference/bundler/vite.md', '/reference/bundler/webpack.md'], - }, - { - text: 'Default Theme Reference', - collapsible: true, - children: [ - '/reference/default-theme/config.md', - '/reference/default-theme/frontmatter.md', - '/reference/default-theme/components.md', - '/reference/default-theme/markdown.md', - '/reference/default-theme/styles.md', - '/reference/default-theme/extending.md', - ], - }, - { - text: 'Official Plugins Reference', - collapsible: true, - children: [ - { - text: 'Common Features', - children: [ - '/reference/plugin/back-to-top.md', - '/reference/plugin/container.md', - '/reference/plugin/external-link-icon.md', - '/reference/plugin/google-analytics.md', - '/reference/plugin/medium-zoom.md', - '/reference/plugin/nprogress.md', - '/reference/plugin/register-components.md', - ], - }, - { - text: 'Content Search', - children: [ - '/reference/plugin/docsearch.md', - '/reference/plugin/search.md', - ], - }, - { - text: 'PWA', - children: [ - '/reference/plugin/pwa.md', - '/reference/plugin/pwa-popup.md', - ], - }, - { - text: 'Syntax Highlighting', - children: [ - '/reference/plugin/prismjs.md', - '/reference/plugin/shiki.md', - ], - }, - { - text: 'Theme Development', - children: [ - '/reference/plugin/active-header-links.md', - '/reference/plugin/git.md', - '/reference/plugin/palette.md', - '/reference/plugin/theme-data.md', - '/reference/plugin/toc.md', - ], - }, - ], - }, - ], -} diff --git a/docs/.vuepress/configs/sidebar/index.ts b/docs/.vuepress/configs/sidebar/index.ts deleted file mode 100644 index c09551765946295eca22afe649ac22274633f472..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/sidebar/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './en' -export * from './zh' diff --git a/docs/.vuepress/configs/sidebar/zh.ts b/docs/.vuepress/configs/sidebar/zh.ts deleted file mode 100644 index 805dcead270a4fdd898d257aee1e7336278dfe3e..0000000000000000000000000000000000000000 --- a/docs/.vuepress/configs/sidebar/zh.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default' - -export const zh: SidebarConfig = { - '/zh/guide/': [ - { - text: '指南', - children: [ - '/zh/guide/README.md', - '/zh/guide/getting-started.md', - '/zh/guide/configuration.md', - '/zh/guide/page.md', - '/zh/guide/markdown.md', - '/zh/guide/assets.md', - '/zh/guide/i18n.md', - '/zh/guide/deployment.md', - '/zh/guide/theme.md', - '/zh/guide/plugin.md', - '/zh/guide/bundler.md', - '/zh/guide/migration.md', - ], - }, - ], - '/zh/advanced/': [ - { - text: '深入', - children: [ - '/zh/advanced/architecture.md', - '/zh/advanced/plugin.md', - '/zh/advanced/theme.md', - ], - }, - { - text: 'Cookbook', - children: [ - '/zh/advanced/cookbook/README.md', - '/zh/advanced/cookbook/usage-of-client-app-enhance.md', - '/zh/advanced/cookbook/adding-extra-pages.md', - '/zh/advanced/cookbook/making-a-theme-extendable.md', - '/zh/advanced/cookbook/passing-data-to-client-code.md', - '/zh/advanced/cookbook/markdown-and-vue-sfc.md', - ], - }, - ], - '/zh/reference/': [ - { - text: 'VuePress 参考', - collapsible: true, - children: [ - '/zh/reference/cli.md', - '/zh/reference/config.md', - '/zh/reference/frontmatter.md', - '/zh/reference/components.md', - '/zh/reference/plugin-api.md', - '/zh/reference/theme-api.md', - '/zh/reference/client-api.md', - '/zh/reference/node-api.md', - ], - }, - { - text: '打包工具参考', - collapsible: true, - children: [ - '/zh/reference/bundler/vite.md', - '/zh/reference/bundler/webpack.md', - ], - }, - { - text: '默认主题参考', - collapsible: true, - children: [ - '/zh/reference/default-theme/config.md', - '/zh/reference/default-theme/frontmatter.md', - '/zh/reference/default-theme/components.md', - '/zh/reference/default-theme/markdown.md', - '/zh/reference/default-theme/styles.md', - '/zh/reference/default-theme/extending.md', - ], - }, - { - text: '官方插件参考', - collapsible: true, - children: [ - { - text: '常用功能', - children: [ - '/zh/reference/plugin/back-to-top.md', - '/zh/reference/plugin/container.md', - '/zh/reference/plugin/external-link-icon.md', - '/zh/reference/plugin/google-analytics.md', - '/zh/reference/plugin/medium-zoom.md', - '/zh/reference/plugin/nprogress.md', - '/zh/reference/plugin/register-components.md', - ], - }, - { - text: '内容搜索', - children: [ - '/zh/reference/plugin/docsearch.md', - '/zh/reference/plugin/search.md', - ], - }, - { - text: 'PWA', - children: [ - '/zh/reference/plugin/pwa.md', - '/zh/reference/plugin/pwa-popup.md', - ], - }, - { - text: '语法高亮', - children: [ - '/zh/reference/plugin/prismjs.md', - '/zh/reference/plugin/shiki.md', - ], - }, - { - text: '主题开发', - children: [ - '/zh/reference/plugin/active-header-links.md', - '/zh/reference/plugin/git.md', - '/zh/reference/plugin/palette.md', - '/zh/reference/plugin/theme-data.md', - '/zh/reference/plugin/toc.md', - ], - }, - ], - }, - ], -} diff --git a/docs/.vuepress/styles/dist/palette.css b/docs/.vuepress/styles/dist/palette.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/docs/.vuepress/styles/palette.styl b/docs/.vuepress/styles/palette.styl new file mode 100644 index 0000000000000000000000000000000000000000..bd72f4a277a439d7686db5737973e693cf11689b --- /dev/null +++ b/docs/.vuepress/styles/palette.styl @@ -0,0 +1 @@ +$accentColor = #5dac38 \ No newline at end of file diff --git a/package.json b/package.json index 6c17537455b4c376ab29e6c19f4d951b456d37d5..365678bcecfbdcba5520d3535e94f3215f6b7071 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,12 @@ { - "scripts": { - "docs:dev": "vuepress dev docs --open --host 127.0.0.1", - "docs:build": "vuepress build docs" - } + "scripts": { + "docs:dev": "vuepress dev docs --open --host 127.0.0.1", + "docs:build": "vuepress build docs" + }, + "devDependencies": { + "vuepress-plugin-autometa": "^0.1.13" + }, + "dependencies": { + "vuepress-plugin-sitemap": "^2.3.1" } - \ No newline at end of file +} diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000000000000000000000000000000000000..27e6f95f7c7fd817c8d2640d909bc688c0d5bb34 --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +Sitemap: https://dev-cloud.gitcode.host/spring/sitemap.xml + +User-agent: * \ No newline at end of file