diff --git a/README.md b/README.md index 282806fcf..f2ea087e6 100644 --- a/README.md +++ b/README.md @@ -145,3 +145,16 @@ Total in 2396 ms #### Get the already built static content You will find the previously generated content in the `public` directory. + + +## Create Docs PDF + +``` +hugo +``` + +``` +cat ./public/all-docs/index.html | wkhtmltopdf --outline-depth 2 --enable-internal-links - ./static/pdf/all-docs.pdf + +cat ./public/zh/all-docs/index.html | wkhtmltopdf --outline-depth 2 --enable-internal-links - ./static/pdf/all-docs-zh.pdf +``` \ No newline at end of file diff --git a/config/_default/config.toml b/config/_default/config.toml index d99090c50..174934129 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://kubesphere-v3.netlify.app" +baseURL = "https://kubesphere.io" enableRobotsTXT = true diff --git a/content/en/all-docs/_index.md b/content/en/all-docs/_index.md new file mode 100644 index 000000000..e69de29bb diff --git a/content/zh/all-docs/_index.md b/content/zh/all-docs/_index.md new file mode 100644 index 000000000..e69de29bb diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 000000000..91d49c375 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,7 @@ +

+ {{ if strings.HasPrefix .Destination "http" }} + {{ .Text }} + {{ else }} + {{ .Text }} + {{ end }} +

\ No newline at end of file diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 943e7c4a7..8c1534ebe 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1 +1,11 @@ -{{ .Text }} \ No newline at end of file +{{ if strings.HasPrefix .Destination "http" }} + {{ .Text }} +{{ else }} + {{ $page := .Page.GetPage .Destination }} + {{ if $page }} + {{ .Text }} + {{ else}} + {{ $page := .Page.GetPage (substr .Destination 3 -1) }} + {{ .Text }} + {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/all-docs/list.html b/layouts/all-docs/list.html new file mode 100644 index 000000000..85adc5c42 --- /dev/null +++ b/layouts/all-docs/list.html @@ -0,0 +1,637 @@ + + + + + + + Kubesphere Doc + + + + + + + +

Content

+ + {{ define "table" }} +
  • {{ .LinkTitle }}
  • + {{ if .IsSection }} + + {{ end }} + {{ end }} + + + +
    +
    + + {{ define "content" }} +

    {{ .LinkTitle }}

    +
    + {{ .Content }} +
    +
    +
    + {{ if .IsSection }} + {{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }} + {{ template "content" . }} + {{ end }} + {{ end }} + {{ end }} + + + {{ with .Site.GetPage "section" "docs" }} + {{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }} + {{ template "content" . }} + {{ end }} + {{ end }} + + \ No newline at end of file