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/i18n/en.yaml b/i18n/en.yaml index 6868a89c4..c4dc39a71 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -60,6 +60,8 @@ translation: Last updated - id: What’s on this Page translation: What’s on this Page +- id: Content + translation: Content - id: Previous translation: Previous - id: Next diff --git a/i18n/zh.yaml b/i18n/zh.yaml index 273531b45..cbbeda6b9 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -60,6 +60,8 @@ translation: 最新更新 - id: What’s on this Page translation: 页面内容 +- id: Content + translation: 目录 - id: Previous translation: 上一篇 - id: Next @@ -129,4 +131,4 @@ - id: Install on Kubernetes translation: 在 Kubernetes 安装 - id: Install on Linux - translation: 在 Linux 安装 \ No newline at end of file + translation: 在 Linux 安装 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..90026ac97 --- /dev/null +++ b/layouts/all-docs/list.html @@ -0,0 +1,637 @@ + + + + + + + Kubesphere Doc + + + + + + + +

{{ i18n "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 diff --git a/layouts/docs/second.html b/layouts/docs/second.html index add15eaca..b92810b3c 100644 --- a/layouts/docs/second.html +++ b/layouts/docs/second.html @@ -117,29 +117,14 @@ height="0" width="0" style="display:none;visibility:hidden"> - - {{ define "content" }} - {{ if .context.IsSection }} - {{ .context.LinkTitle }} - {{ else }} - {{ .context.LinkTitle }} - {{ end }} -

    {{ .context.Description }}

    - {{ $count := add .count 1 }} - {{ if .context.IsSection }} - {{ range (union (where .context.Pages ".context.Params._build.render" "!=" false) .context.Sections).ByWeight }} - {{ template "content" (dict "context" . "count" $count) }} - {{ end }} - {{ else}} - {{ end }} - {{ end }}

    {{ .Title }}

    {{ .Content }} {{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }} - {{ template "content" (dict "context" . "count" 2) }} +

    {{ .LinkTitle }}

    +

    {{ .Description }}

    {{ end }}
    diff --git a/static/images/docs/22-hover.svg b/static/images/docs/22-hover.svg index 558a4ee37..149fc496f 100644 --- a/static/images/docs/22-hover.svg +++ b/static/images/docs/22-hover.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/static/images/docs/22.svg b/static/images/docs/22.svg index f99c2bf72..d4ab4a04c 100644 --- a/static/images/docs/22.svg +++ b/static/images/docs/22.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/static/images/docs/26.svg b/static/images/docs/26.svg index 314dcefe5..b8c46427d 100644 --- a/static/images/docs/26.svg +++ b/static/images/docs/26.svg @@ -1 +1 @@ - \ No newline at end of file +