From f7bb574a9bcead71642e3ce131f4dffcf5c23083 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 28 Jan 2022 13:52:51 +0100 Subject: [PATCH] feat: add auto new docs tree --- archetypes/blog.md | 2 -- archetypes/docs.md | 4 +-- archetypes/docs/_index.md | 10 ++++++ archetypes/docs/lorem/_index.md | 10 ++++++ archetypes/docs/lorem/ipsum/index.md | 15 +++++++++ config/_default/menus/menus.en.toml | 33 +++++++++++++++++-- config/_default/params.toml | 1 - content/en/guide/_index.md | 10 ++++++ content/en/guide/lorem/_index.md | 10 ++++++ content/en/guide/lorem/ipsum/index.md | 19 +++++++++++ content/en/hints/_index.md | 10 ++++++ content/en/hints/lorem/_index.md | 10 ++++++ content/en/hints/lorem/ipsum/index.md | 15 +++++++++ content/en/tutorial/_index.md | 4 ++- content/en/tutorial/lorem/_index.md | 2 ++ content/en/tutorial/lorem/ipsum/index.md | 11 +++++++ layouts/partials/header/header.html | 5 +-- .../sidebar/auto-collapsible-menu.html | 3 +- .../partials/sidebar/auto-default-menu.html | 3 +- .../sidebar/manual-collapsible-menu.html | 11 ++++--- .../partials/sidebar/manual-default-menu.html | 9 ++--- 21 files changed, 174 insertions(+), 23 deletions(-) create mode 100644 archetypes/docs/_index.md create mode 100644 archetypes/docs/lorem/_index.md create mode 100644 archetypes/docs/lorem/ipsum/index.md create mode 100644 content/en/guide/_index.md create mode 100644 content/en/guide/lorem/_index.md create mode 100644 content/en/guide/lorem/ipsum/index.md create mode 100644 content/en/hints/_index.md create mode 100644 content/en/hints/lorem/_index.md create mode 100644 content/en/hints/lorem/ipsum/index.md diff --git a/archetypes/blog.md b/archetypes/blog.md index 7873351..b4ad21a 100644 --- a/archetypes/blog.md +++ b/archetypes/blog.md @@ -9,5 +9,3 @@ weight: 50 images: ["{{ .Name | urlize }}.jpg"] contributors: [] --- - -{{< img src="{{ .Name | urlize }}.jpg" alt="{{ replace .Name "-" " " | title }}" caption="{{ replace .Name "-" " " | title }}" class="wide" >}} diff --git a/archetypes/docs.md b/archetypes/docs.md index bb609d2..436bd08 100644 --- a/archetypes/docs.md +++ b/archetypes/docs.md @@ -6,11 +6,9 @@ date: {{ .Date }} lastmod: {{ .Date }} draft: true images: [] -menu: +menu: docs: parent: "" weight: 999 toc: true --- - -{{< img src="{{ .Name | urlize }}.jpg" alt="{{ replace .Name "-" " " | title }}" caption="{{ replace .Name "-" " " | title }}" >}} diff --git a/archetypes/docs/_index.md b/archetypes/docs/_index.md new file mode 100644 index 0000000..3ed0540 --- /dev/null +++ b/archetypes/docs/_index.md @@ -0,0 +1,10 @@ +--- +title: "Docs" +description: "" +lead: "" +date: 2022-01-25T14:40:56+01:00 +lastmod: 2022-01-25T14:40:56+01:00 +draft: false +images: [] +type: docs +--- diff --git a/archetypes/docs/lorem/_index.md b/archetypes/docs/lorem/_index.md new file mode 100644 index 0000000..c1b50ae --- /dev/null +++ b/archetypes/docs/lorem/_index.md @@ -0,0 +1,10 @@ +--- +title: "Lorem" +description: "" +lead: "" +date: 2022-01-25T14:41:21+01:00 +lastmod: 2022-01-25T14:41:21+01:00 +draft: false +images: [] +type: docs +--- diff --git a/archetypes/docs/lorem/ipsum/index.md b/archetypes/docs/lorem/ipsum/index.md new file mode 100644 index 0000000..2cc6395 --- /dev/null +++ b/archetypes/docs/lorem/ipsum/index.md @@ -0,0 +1,15 @@ +--- +title: "Ipsum" +description: "" +lead: "" +date: 2022-01-25T14:41:39+01:00 +lastmod: 2022-01-25T14:41:39+01:00 +draft: false +images: [] +type: docs +menu: + {{ .Section }}: + parent: "lorem" +weight: 100 +toc: true +--- diff --git a/config/_default/menus/menus.en.toml b/config/_default/menus/menus.en.toml index 260f33a..4561255 100644 --- a/config/_default/menus/menus.en.toml +++ b/config/_default/menus/menus.en.toml @@ -10,11 +10,23 @@ identifier = "help" url = "/docs/help/" -[[docs]] +# [[docs]] +# name = "Lorem" +# weight = 70 +# identifier = "lorem" +# url = "/docs/lorem/" + +[[guide]] name = "Lorem" - weight = 70 + weight = 10 identifier = "lorem" - url = "/docs/lorem/" + url = "/guide/lorem/" + +[[tutorial]] + name = "Lorem" + weight = 10 + identifier = "lorem" + url = "/tutorial/lorem/" [[main]] name = "Docs" @@ -22,6 +34,21 @@ # url = "/docs/1.0/prologue/introduction/" weight = 10 +[[main]] + name = "Guide" + url = "/guide/lorem/ipsum/" + weight = 11 + +[[main]] + name = "Tutorial" + url = "/tutorial/lorem/ipsum/" + weight = 12 + +[[main]] + name = "Hints" + url = "/hints/lorem/ipsum/" + weight = 13 + [[main]] name = "Blog" url = "/blog/" diff --git a/config/_default/params.toml b/config/_default/params.toml index 09fa32a..b7451a0 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -92,4 +92,3 @@ lastMod = false [menu.section] auto = true collapsibleSidebar = true - mainSections = ["docs"] diff --git a/content/en/guide/_index.md b/content/en/guide/_index.md new file mode 100644 index 0000000..3ed0540 --- /dev/null +++ b/content/en/guide/_index.md @@ -0,0 +1,10 @@ +--- +title: "Docs" +description: "" +lead: "" +date: 2022-01-25T14:40:56+01:00 +lastmod: 2022-01-25T14:40:56+01:00 +draft: false +images: [] +type: docs +--- diff --git a/content/en/guide/lorem/_index.md b/content/en/guide/lorem/_index.md new file mode 100644 index 0000000..c1b50ae --- /dev/null +++ b/content/en/guide/lorem/_index.md @@ -0,0 +1,10 @@ +--- +title: "Lorem" +description: "" +lead: "" +date: 2022-01-25T14:41:21+01:00 +lastmod: 2022-01-25T14:41:21+01:00 +draft: false +images: [] +type: docs +--- diff --git a/content/en/guide/lorem/ipsum/index.md b/content/en/guide/lorem/ipsum/index.md new file mode 100644 index 0000000..def87a0 --- /dev/null +++ b/content/en/guide/lorem/ipsum/index.md @@ -0,0 +1,19 @@ +--- +title: "Ipsum" +description: "" +lead: "" +date: 2022-01-25T14:41:39+01:00 +lastmod: 2022-01-25T14:41:39+01:00 +draft: false +images: [] +type: docs +menu: + guide: + parent: "lorem" +weight: 100 +toc: true +--- + +## Intro + +Welcome to the Guide! diff --git a/content/en/hints/_index.md b/content/en/hints/_index.md new file mode 100644 index 0000000..3ed0540 --- /dev/null +++ b/content/en/hints/_index.md @@ -0,0 +1,10 @@ +--- +title: "Docs" +description: "" +lead: "" +date: 2022-01-25T14:40:56+01:00 +lastmod: 2022-01-25T14:40:56+01:00 +draft: false +images: [] +type: docs +--- diff --git a/content/en/hints/lorem/_index.md b/content/en/hints/lorem/_index.md new file mode 100644 index 0000000..c1b50ae --- /dev/null +++ b/content/en/hints/lorem/_index.md @@ -0,0 +1,10 @@ +--- +title: "Lorem" +description: "" +lead: "" +date: 2022-01-25T14:41:21+01:00 +lastmod: 2022-01-25T14:41:21+01:00 +draft: false +images: [] +type: docs +--- diff --git a/content/en/hints/lorem/ipsum/index.md b/content/en/hints/lorem/ipsum/index.md new file mode 100644 index 0000000..1b7e16d --- /dev/null +++ b/content/en/hints/lorem/ipsum/index.md @@ -0,0 +1,15 @@ +--- +title: "Ipsum" +description: "" +lead: "" +date: 2022-01-25T14:41:39+01:00 +lastmod: 2022-01-25T14:41:39+01:00 +draft: false +images: [] +type: docs +menu: + hints: + parent: "lorem" +weight: 100 +toc: true +--- diff --git a/content/en/tutorial/_index.md b/content/en/tutorial/_index.md index cbc581f..3ed0540 100644 --- a/content/en/tutorial/_index.md +++ b/content/en/tutorial/_index.md @@ -1,8 +1,10 @@ --- -title: "Tutorial" +title: "Docs" description: "" +lead: "" date: 2022-01-25T14:40:56+01:00 lastmod: 2022-01-25T14:40:56+01:00 draft: false images: [] +type: docs --- diff --git a/content/en/tutorial/lorem/_index.md b/content/en/tutorial/lorem/_index.md index a837257..c1b50ae 100644 --- a/content/en/tutorial/lorem/_index.md +++ b/content/en/tutorial/lorem/_index.md @@ -1,8 +1,10 @@ --- title: "Lorem" description: "" +lead: "" date: 2022-01-25T14:41:21+01:00 lastmod: 2022-01-25T14:41:21+01:00 draft: false images: [] +type: docs --- diff --git a/content/en/tutorial/lorem/ipsum/index.md b/content/en/tutorial/lorem/ipsum/index.md index 58860ff..1ae3228 100644 --- a/content/en/tutorial/lorem/ipsum/index.md +++ b/content/en/tutorial/lorem/ipsum/index.md @@ -1,8 +1,19 @@ --- title: "Ipsum" description: "" +lead: "" date: 2022-01-25T14:41:39+01:00 lastmod: 2022-01-25T14:41:39+01:00 draft: false images: [] +type: docs +menu: + tutorial: + parent: "lorem" +weight: 100 +toc: true --- + +## Intro + +Welcome to the Tutorial! diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index 433c7cb..ae39a67 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -28,11 +28,12 @@

Main