From e63dee174c5ef482fac16a6344422e5ed85a5d48 Mon Sep 17 00:00:00 2001 From: liuboaibc Date: Tue, 20 Apr 2021 11:14:46 +0800 Subject: [PATCH 1/2] add robots.txt Signed-off-by: liuboaibc --- config/_default/config.toml | 2 ++ content/en/api/crd.md | 2 +- content/en/api/kubesphere.md | 2 +- content/en/contribution/request.md | 2 +- content/en/partner/request.md | 2 +- content/zh/contribution/request.md | 2 +- content/zh/partner/request.md | 2 +- layouts/robots.txt | 6 ++++++ 8 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 layouts/robots.txt diff --git a/config/_default/config.toml b/config/_default/config.toml index 6dbce8664..a9cb522ee 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -1,5 +1,7 @@ baseURL = "https://kubesphere-v3.netlify.app" +enableRobotsTXT = true + [markup] [markup.tableOfContents] endLevel = 3 diff --git a/content/en/api/crd.md b/content/en/api/crd.md index 4cbf33361..696b33ddc 100644 --- a/content/en/api/crd.md +++ b/content/en/api/crd.md @@ -2,7 +2,7 @@ title: KubeSphere Api Documents description: KubeSphere Api Documents keywords: KubeSphere, KubeSphere Documents, Kubernetes - +disallow: true swaggerUrl: json/crd.json --- diff --git a/content/en/api/kubesphere.md b/content/en/api/kubesphere.md index d5ef99133..9893dd05a 100644 --- a/content/en/api/kubesphere.md +++ b/content/en/api/kubesphere.md @@ -2,6 +2,6 @@ title: KubeSphere Api Documents description: KubeSphere Api Documents keywords: KubeSphere, KubeSphere Documents, Kubernetes - +disallow: true swaggerUrl: json/kubesphere.json --- \ No newline at end of file diff --git a/content/en/contribution/request.md b/content/en/contribution/request.md index 1c0638364..09e80a978 100644 --- a/content/en/contribution/request.md +++ b/content/en/contribution/request.md @@ -1,7 +1,7 @@ --- title: "contribution request" layout: "request" - +disallow: true css: "scss/contribution.scss" section1: diff --git a/content/en/partner/request.md b/content/en/partner/request.md index c498dc62f..190c23f72 100644 --- a/content/en/partner/request.md +++ b/content/en/partner/request.md @@ -2,7 +2,7 @@ title: "partner request" layout: "request" - +disallow: true css: "scss/partner.scss" section1: diff --git a/content/zh/contribution/request.md b/content/zh/contribution/request.md index 1c0638364..09e80a978 100644 --- a/content/zh/contribution/request.md +++ b/content/zh/contribution/request.md @@ -1,7 +1,7 @@ --- title: "contribution request" layout: "request" - +disallow: true css: "scss/contribution.scss" section1: diff --git a/content/zh/partner/request.md b/content/zh/partner/request.md index c498dc62f..190c23f72 100644 --- a/content/zh/partner/request.md +++ b/content/zh/partner/request.md @@ -2,7 +2,7 @@ title: "partner request" layout: "request" - +disallow: true css: "scss/partner.scss" section1: diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 000000000..6a6256f37 --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,6 @@ +User-agent: * +{{ range .Pages }} +{{ if .Params.disallow }} +Disallow: {{ .RelPermalink }} +{{ end }} +{{ end }} \ No newline at end of file From d518a1084705686b418618e2beb79a6da08221b3 Mon Sep 17 00:00:00 2001 From: liuboaibc Date: Tue, 20 Apr 2021 11:09:27 +0800 Subject: [PATCH 2/2] add canonical tag Signed-off-by: liuboaibc --- layouts/partials/head.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4dd98c784..59f817276 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -14,6 +14,8 @@ + + {{- partial "css.html" . -}}