提交 0186888c 编写于 作者: 茶陵後's avatar 茶陵後 👍

#1 SEO:add sitemap config

上级 8e6a5dc5
......@@ -3,6 +3,7 @@ docs/.vuepress/dist
.vscode
package-lock.json
.idea/
bs-config.json
# macos
.DS_Store
......
// .vuepress/config.js
const path = require('path');
const path = require("path");
const host_url = "https://dev-cloud.gitcode.host/spring-docs/";
const autometa_options = {
site: {
name: 'Spring 中文文档社区'
name: "Spring 中文文档社区"
},
canonical_base: 'https://dev-cloud.gitcode.host/spring/',
canonical_base: host_url
};
module.exports = {
title: "Spring 中文文档社区",
base: "/spring/",
base: "/spring-docs/",
head: [
[
'link',
"link",
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: `/images/icons/favicon.ico`,
},
rel: "icon",
type: "image/png",
sizes: "16x16",
href: `/images/icons/favicon.ico`
}
],
[
'link',
"link",
{
rel: 'icon',
type: 'image/png',
sizes: '48x48',
href: `/images/icons/icon-48x48.png`,
},
rel: "icon",
type: "image/png",
sizes: "48x48",
href: `/images/icons/icon-48x48.png`
}
],
[
'link',
"link",
{
rel: 'icon',
type: 'image/png',
sizes: '72x72',
href: `/images/icons/icon-72x72.png`,
},
rel: "icon",
type: "image/png",
sizes: "72x72",
href: `/images/icons/icon-72x72.png`
}
],
['link', { rel: 'manifest', href: '/manifest.webmanifest' }],
['meta', { name: 'application-name', content: 'Spring 中文文档社区' }],
['meta', { name: 'apple-mobile-web-app-title', content: 'Spring 中文社区' }],
["link", { rel: "manifest", href: "/manifest.webmanifest" }],
["meta", { name: "application-name", content: "Spring 中文文档社区" }],
[
'meta',
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
"meta",
{ name: "apple-mobile-web-app-title", content: "Spring 中文社区" }
],
[
'link',
{ rel: 'apple-touch-icon', href: `/images/icons/icon_48x48.png` },
"meta",
{ name: "apple-mobile-web-app-status-bar-style", content: "black" }
],
["link", { rel: "apple-touch-icon", href: `/images/icons/icon_48x48.png` }],
[
'link',
"link",
{
rel: 'mask-icon',
href: '/images/icons/favicon.ico',
color: '#5dac38',
},
rel: "mask-icon",
href: "/images/icons/favicon.ico",
color: "#5dac38"
}
],
["meta", { name: "msapplication-TileColor", content: "#5dac38" }],
["meta", { name: "theme-color", content: "#5dac38" }],
[
"meta",
{ name: "viewport", content: "width=device-width, initial-scale=1" }
],
['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' }]
["meta", { "http-equiv": "X-UA-Compatible", content: "IE=edge" }]
],
locales: {
// '/en/': {
......@@ -68,26 +73,32 @@ module.exports = {
// title: 'Spring Docs',
// description: ''
// },
'/': {
lang: 'zh-CN',
title: '中文文档',
description: ''
"/": {
lang: "zh-CN",
title: "中文文档",
description: ""
}
},
plugins: [
['autometa', autometa_options]
["autometa", autometa_options],
['sitemap', {
hostname: host_url,
// 排除无实际内容的页面
exclude: ["/404.html"]
}
]
],
theme: path.resolve(__dirname, './themes/theme-gitcode/index.js'),
theme: path.resolve(__dirname, "./themes/theme-gitcode/index.js"),
themeConfig: {
repo: "https://gitcode.net/dev-cloud/spring",
repo: "https://gitcode.net/dev-cloud/spring-docs",
repoLabel: "GitCode",
docsRepo: "https://gitcode.net/dev-cloud/spring/",
docsDir: 'docs',
docsBranch: 'master',
docsRepo: "https://gitcode.net/dev-cloud/spring-docs/",
docsDir: "docs",
docsBranch: "master",
editLinks: true,
editLinkText: "帮助我们改善此页面!",
lastUpdated: "Last Updated",
logo: '/images/icons/spring-logo.svg',
logo: "/images/icons/spring-logo.svg",
sidebarDepth: 3,
activeHeaderLinks: true,
locales: {
......@@ -324,64 +335,70 @@ module.exports = {
// ]
// }
// },
'/': {
selectText: '选择语言',
label: '简体中文',
ariaLabel: '语言',
lang: 'zh-CN',
editLinkText: '在 GitCode 上编辑此页',
lastUpdated: '上次更新',
"/": {
selectText: "选择语言",
label: "简体中文",
ariaLabel: "语言",
lang: "zh-CN",
editLinkText: "在 GitCode 上编辑此页",
lastUpdated: "上次更新",
algolia: {},
nav: [
{
text: 'Spring',
link: '/'
text: "Spring",
link: "/"
},
{
text: 'Spring Boot',
link: '/spring-boot/'
text: "Spring Boot",
link: "/spring-boot/"
},
{
text: 'Spring Framework',
link: '/spring-framework/'
text: "Spring Framework",
link: "/spring-framework/"
},
{
text: 'Spring Data',
link: '/spring-data/'
text: "Spring Data",
link: "/spring-data/"
},
{
text: 'Spring Cloud',
link: '/spring-cloud/'
text: "Spring Cloud",
link: "/spring-cloud/"
},
{
text: '更多文档',
ariaLabel: 'Others',
text: "更多文档",
ariaLabel: "Others",
items: [
{ text: 'Spring Cloud Data Flow', link: '/spring-cloud-data-flow/' },
{ text: 'Spring Security', link: '/spring-security/' },
{ text: 'Spring for GraphQL', link: '/spring-for-graphql/' },
{ text: 'Spring Session', link: '/spring-session/' },
{ text: 'Spring Integration', link: '/spring-integration/' },
{ text: 'Spring HATEOAS', link: '/spring-hateoas/' },
{ text: 'Spring REST Docs', link: '/spring-rest-docs/' },
{ text: 'Spring Batch', link: '/spring-batch/' },
{ text: 'Spring AMQP', link: '/spring-amqp/' },
{ text: 'Spring CredHub', link: '/spring-credhub/' },
{ text: 'Spring Flo', link: '/spring-flo/' },
{ text: 'Spring for Apache Kafka', link: '/spring-for-apache-kafka/' },
{ text: 'Spring LDAP', link: '/spring-ldap/' },
{ text: 'Spring Shell', link: '/spring-shell/' },
{ text: 'Spring Statemachine', link: '/spring-statemachine/' },
{ text: 'Spring Vault', link: '/spring-vault/' },
{ text: 'Spring Web Flow', link: '/spring-web-flow/' },
{ text: 'Spring Web Services', link: '/spring-web-services/' }
{
text: "Spring Cloud Data Flow",
link: "/spring-cloud-data-flow/"
},
{ text: "Spring Security", link: "/spring-security/" },
{ text: "Spring for GraphQL", link: "/spring-for-graphql/" },
{ text: "Spring Session", link: "/spring-session/" },
{ text: "Spring Integration", link: "/spring-integration/" },
{ text: "Spring HATEOAS", link: "/spring-hateoas/" },
{ text: "Spring REST Docs", link: "/spring-rest-docs/" },
{ text: "Spring Batch", link: "/spring-batch/" },
{ text: "Spring AMQP", link: "/spring-amqp/" },
{ text: "Spring CredHub", link: "/spring-credhub/" },
{ text: "Spring Flo", link: "/spring-flo/" },
{
text: "Spring for Apache Kafka",
link: "/spring-for-apache-kafka/"
},
{ text: "Spring LDAP", link: "/spring-ldap/" },
{ text: "Spring Shell", link: "/spring-shell/" },
{ text: "Spring Statemachine", link: "/spring-statemachine/" },
{ text: "Spring Vault", link: "/spring-vault/" },
{ text: "Spring Web Flow", link: "/spring-web-flow/" },
{ text: "Spring Web Services", link: "/spring-web-services/" }
]
}
],
sidebar: {
'/spring-boot/': [
"/spring-boot/": [
{
title: 'Spring Boot 文档',
title: "Spring Boot 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -406,9 +423,9 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-framework/': [
"/spring-framework/": [
{
title: 'Spring Framework 文档',
title: "Spring Framework 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -424,20 +441,19 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-data/': [
"/spring-data/": [
{
title: 'Spring Data 文档',
title: "Spring Data 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-data/spring-data.md"
],
// path: "spring-data",
children: ["spring-data"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-cloud/': [
"/spring-cloud/": [
{
title: 'Spring Cloud 文档',
title: "Spring Cloud 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -466,20 +482,18 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-cloud-data-flow/': [
"/spring-cloud-data-flow/": [
{
title: 'Spring Cloud Data Flow 文档',
title: "Spring Cloud Data Flow 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-cloud-data-flow/spring-cloud-dataflow.md",
],
children: ["/spring-cloud-data-flow/spring-cloud-dataflow.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-security/': [
"/spring-security/": [
{
title: 'Spring 安全',
title: "Spring 安全",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -641,20 +655,18 @@ module.exports = {
}
],
'/spring-for-graphql/': [
"/spring-for-graphql/": [
{
title: 'Spring For Graphql 文档',
title: "Spring For Graphql 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-for-graphql/spring-graphql.md",
],
children: ["/spring-for-graphql/spring-graphql.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-session/': [
"/spring-session/": [
{
title: 'Spring Session 文档',
title: "Spring Session 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -678,20 +690,18 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-session/sample/': [
"/spring-session/sample/": [
{
title: 'Spring Session 文档3',
title: "Spring Session 文档3",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-session/sample/samples.md"
],
children: ["/spring-session/sample/samples.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-integration/': [
"/spring-integration/": [
{
title: 'Spring Integration 文档',
title: "Spring Integration 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -754,31 +764,27 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-hateoas/': [
"/spring-hateoas/": [
{
title: 'Spring HATEOAS 文档',
title: "Spring HATEOAS 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-hateoas/spring-hateoas.md",
],
children: ["/spring-hateoas/spring-hateoas.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-rest-docs/': [
"/spring-rest-docs/": [
{
title: 'Spring HATEOAS 文档',
title: "Spring HATEOAS 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-rest-docs/spring-restdocs.md",
],
children: ["/spring-rest-docs/spring-restdocs.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-batch/': [
"/spring-batch/": [
{
title: 'Spring Batch 文档',
title: "Spring Batch 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -805,97 +811,81 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-amqp/': [
"/spring-amqp/": [
{
title: 'Spring AMQP 文档',
title: "Spring AMQP 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-amqp/spring-amqp.md",
],
children: ["/spring-amqp/spring-amqp.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-credhub/': [
"/spring-credhub/": [
{
title: 'Spring CredHub 文档',
title: "Spring CredHub 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-credhub/spring-credhub.md",
],
children: ["/spring-credhub/spring-credhub.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-flo/': [
"/spring-flo/": [
{
title: 'Spring Flo 文档',
title: "Spring Flo 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-flo/spring-flo.md",
],
children: ["/spring-flo/spring-flo.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-for-apache-kafka/': [
"/spring-for-apache-kafka/": [
{
title: 'Spring for Apache Kafka 文档',
title: "Spring for Apache Kafka 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-for-apache-kafka/spring-kafka.md",
],
children: ["/spring-for-apache-kafka/spring-kafka.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-ldap/': [
"/spring-ldap/": [
{
title: 'Spring for Apache Kafka 文档',
title: "Spring for Apache Kafka 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-ldap/spring-ldap.md",
],
children: ["/spring-ldap/spring-ldap.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-shell/': [
"/spring-shell/": [
{
title: 'Spring Shell 文档',
title: "Spring Shell 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-shell/spring-shell.md",
],
children: ["/spring-shell/spring-shell.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-statemachine/': [
"/spring-statemachine/": [
{
title: 'Spring Statemachine 文档',
title: "Spring Statemachine 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-statemachine/spring-statemachine.md",
],
children: ["/spring-statemachine/spring-statemachine.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-vault/': [
"/spring-vault/": [
{
title: 'Spring Vault 文档',
title: "Spring Vault 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-vault/spring-vault.md",
],
children: ["/spring-vault/spring-vault.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-web-flow/': [
"/spring-web-flow/": [
{
title: 'Spring Web Flow 文档',
title: "Spring Web Flow 文档",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -919,30 +909,26 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
'/spring-web-services/': [
"/spring-web-services/": [
{
title: 'Spring Web Services 文档',
title: "Spring Web Services 文档",
sidebarDepth: 2,
collapsable: false,
children: [
"/spring-web-services/spring-web-service.md",
],
children: ["/spring-web-services/spring-web-service.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
}
],
// fallback
'/':
[{
title: 'Spring 文档', // 必要的
"/": [
{
title: "Spring 文档", // 必要的
// path: '/', // 可选的, 标题的跳转链接,应为绝对路径且必须存在
collapsable: false, // 可选的, 默认值是 true,
sidebarDepth: 1, // 可选的, 默认值是 1
children: [
''
]
children: [""]
},
{
title: '介绍',
title: "介绍",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -953,7 +939,7 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
},
{
title: '教程',
title: "教程",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -964,17 +950,14 @@ module.exports = {
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
},
{
title: '编辑器',
title: "编辑器",
sidebarDepth: 2,
collapsable: false,
children: [
"vscode_java.md",
"intellij_idea.md"
],
children: ["vscode_java.md", "intellij_idea.md"],
initialOpenGroupIndex: 0 // 可选的, 默认值是 0
},
{
title: '代码案例',
title: "代码案例",
sidebarDepth: 2,
collapsable: false,
children: [
......@@ -989,4 +972,4 @@ module.exports = {
}
}
}
}
\ No newline at end of file
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册