diff --git a/README.md b/README.md index 177562d..72ad59c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Hugo Geekdoc Theme +[![Build Status](https://cloud.drone.io/api/badges/xoxys/hugo-geekdoc/status.svg)](https://cloud.drone.io/xoxys/hugo-geekdoc) [![Hugo](https://img.shields.io/badge/hugo-0.55-blue.svg)](https://gohugo.io) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) +![GitHub All Releases](https://img.shields.io/github/downloads/xoxys/hugo-geekdoc/total) Geekdoc is a simple Hugo theme for documentations. This work is inspired and partially based on the [hugo-book](https://github.com/alex-shpak/hugo-book) theme. diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index fd95bbc..a16703f 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -19,37 +19,10 @@ markup: startLevel: 1 params: - # (Optional, default 6) Set how many table of contents levels to be showed on page. - # Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/) - # You can also specify this parameter per page in front matter - GeekdocToC: 3 + geekdocToC: 3 - # (Optional, default none) Set the path to a logo for the Geekdoc. If the logo is - # /static/logo.png then the path would be logo.png - # GeekdocLogo: /logo.png + geekdocRepo: https://github.com/xoxys/hugo-geekdoc + geekdocEditPath: edit/master/exampleSite/content - # (Optional, default none) Set leaf bundle to render as side menu - # When not specified file structure and weights will be used - # GeekdocMenuBundle: /menu - - # (Optional, default docs) Specify section of content to render as menu - # You can also set value to '*' to render all sections to menu - GeekdocSection: docs - - # Set source repository location. - # Used for 'Last Modified' and 'Edit this page' links. - GeekdocRepo: https://github.com/xoxys/hugo-geekdoc - - # Enable "Edit this page" links for 'doc' page type. - # Disabled by default. Uncomment to enable. Requires 'GeekdocRepo' param. - # Path must point to 'content' directory of repo. - GeekdocEditPath: edit/master/exampleSite/content - - # Configure the date format used on the pages - # - In git information - # - In blog posts - GeekdocDateFormat: "Jan 2, 2006" - - # (Optional, default true) Enables search function with flexsearch, - # Index is built on fly, therefore it might slowdown your website. - GeekdocSearch: true + geekdocDateFormat: "Jan 2, 2006" + geekdocSearch: true diff --git a/exampleSite/content/posts/_index.md b/exampleSite/content/posts/_index.md index 97c1b63..9704856 100644 --- a/exampleSite/content/posts/_index.md +++ b/exampleSite/content/posts/_index.md @@ -2,6 +2,5 @@ title: News type: posts weight: 10 -listonly: true +geekdocHidden: true --- - diff --git a/exampleSite/content/usage/configuration.md b/exampleSite/content/usage/configuration.md new file mode 100644 index 0000000..9a49579 --- /dev/null +++ b/exampleSite/content/usage/configuration.md @@ -0,0 +1,164 @@ +## Site configuration + +{{< tabs "site-config" >}} +{{< tab "TOML" >}} + +```Toml +[params] + # (Optional, default 6) Set how many table of contents levels to be showed on page. + # Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/) + # You can also specify this parameter per page in front matter. + geekdocToC = 3 + + # (Optional, default static/brand.svg) Set the path to a logo for the Geekdoc + # relative to your 'static/' folder. + geekdocLogo = logo.png + + # (Optional, default false) Render menu from data file im 'data/menu/main.yaml'. + geekdocMenuBundle = true + + # (Optional, default true) Show page navigation links at the bottom of each + # docs page (bundle menu only). + geekdocNextPrev = false + + # (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page. + # You can also specify this parameter per page in front matter. + geekdocBreadcrumb = false + + # (Optional, default none) Set source repository location + # Used for 'Edit this page' links + # You can also specify this parameter per page in front matter. + geekdocRepo = 'https://github.com/xoxys/hugo' + + # (Optional, default none) Enable "Edit this page" links. Requires 'GeekdocRepo' param + # and path must point to 'content' directory of repo. + # You can also specify this parameter per page in front matter. + geekdocEditPath = 'edit/master/exampleSite/content' + + # (Optional, default 'Jan 2, 2006') Configure the date format used on the pages in blog posts. + geekdocDateFormat = "Jan 2, 2006" + + # (Optional, default true) Enables search function with flexsearch. + # Index is built on the fly and might slowdown your website. + geekdocSearch = false +``` + +{{< /tab >}} +{{< tab "YAML" >}} + +```Yaml +params: + # (Optional, default 6) Set how many table of contents levels to be showed on page. + # Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/) + # You can also specify this parameter per page in front matter. + geekdocToC: 3 + + # (Optional, default static/brand.svg) Set the path to a logo for the Geekdoc + # relative to your 'static/' folder. + geekdocLogo: logo.png + + # (Optional, default false) Render menu from data file im 'data/menu/main.yaml'. + # See also https://docs.geeklabor.de/usage/menus/#bundle-menu + geekdocMenuBundle: true + + # (Optional, default true) Show page navigation links at the bottom of each + # docs page (bundle menu only). + geekdocNextPrev: false + + # (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page. + # You can also specify this parameter per page in front matter. + geekdocBreadcrumb: false + + # (Optional, default none) Set source repository location + # Used for 'Edit this page' links + # You can also specify this parameter per page in front matter. + geekdocRepo: https://github.com/xoxys/hugo-geekdoc + + # (Optional, default none) Enable "Edit this page" links. Requires 'GeekdocRepo' param + # and path must point to 'content' directory of repo. + # You can also specify this parameter per page in front matter. + geekdocEditPath: edit/master/exampleSite/content + + # (Optional, default 'Jan 2, 2006') Configure the date format used on the pages in blog posts. + geekdocDateFormat: "Jan 2, 2006" + + # (Optional, default true) Enables search function with flexsearch. + # Index is built on the fly and might slowdown your website. + geekdocSearch: false +``` + +{{< /tab >}} +{{< /tabs >}} + +## Page configuration + +{{< tabs "page-config" >}} +{{< tab "TOML" >}} + +```Toml +# Set type to 'posts' if you want to render page as blogpost +type = 'posts' + +# Set page weight to re-arrange items in file-tree menu +weight = 10 + +# Set how many table of contents levels to be showed on page. +geekdocToC = 3 + +# Show a breadcrumb navigation bar at the top of each docs page. +geekdocBreadcrumb = false + +# Set source repository location +geekdocRepo = 'https://github.com/xoxys/hugo-geekdoc' + +# Enable "Edit this page" links. Requires 'GeekdocRepo' param and path must point +# to 'content' directory of repo. +geekdocEditPath = 'edit/master/exampleSite/content' + +# Used for 'Edit this page' link, set to '.File.Path' by default. +# Can be overwritten by a path relative to 'geekdocEditPath' +geekdocFilePath = + +# Set to mark page as flat section (file-tree menu only) +geekdocFlatSection = true + +# Set true to hide page or section from side menu (file-tree menu only) +geekdocHidden = true +``` + +{{< /tab >}} +{{< tab "YAML" >}} + +```Yaml +# Set type to 'posts' if you want to render page as blogpost +type: 'posts' + +# Set page weight to re-arrange items in file-tree menu +weight: 10 + +# Set how many table of contents levels to be showed on page. +geekdocToC: 3 + +# Show a breadcrumb navigation bar at the top of each docs page. +geekdocBreadcrumb: false + +# Set source repository location +geekdocRepo: https://github.com/xoxys/hugo-geekdoc + +# Enable "Edit this page" links. Requires 'GeekdocRepo' param and path must point +# to 'content' directory of repo. +geekdocEditPath: edit/master/exampleSite/content + +# Used for 'Edit this page' link, set to '.File.Path' by default. +# Can be overwritten by a path relative to 'geekdocEditPath' +geekdocFilePath = + +# Set to mark page as flat section (file-tree menu only) +geekdocFlatSection: true + +# Set true to hide page or section from side menu (file-tree menu only) +geekdocHidden: true +``` + +{{< /tab >}} +{{< /tabs >}} diff --git a/exampleSite/content/usage/menus.md b/exampleSite/content/usage/menus.md index eb1ae45..c5de4a5 100644 --- a/exampleSite/content/usage/menus.md +++ b/exampleSite/content/usage/menus.md @@ -1 +1,3 @@ -... +## File-tree menu + +## Bundle menu diff --git a/exampleSite/data/menu/more.yaml b/exampleSite/data/menu/more.yaml new file mode 100644 index 0000000..b036325 --- /dev/null +++ b/exampleSite/data/menu/more.yaml @@ -0,0 +1,13 @@ +--- +more: + - name: News + ref: "/posts" + icon: "notification" + - name: Releases + ref: "https://github.com/xoxys/hugo-geekdoc/releases" + external: true + icon: "download" + - name: "View Source" + ref: "https://github.com/xoxys/hugo-geekdoc" + external: true + icon: "github" diff --git a/exampleSite/static/logo.png b/exampleSite/static/logo.png new file mode 100644 index 0000000..3207b98 Binary files /dev/null and b/exampleSite/static/logo.png differ diff --git a/layouts/partials/menu-filetree.html b/layouts/partials/menu-filetree.html index b4a5239..ea388ad 100644 --- a/layouts/partials/menu-filetree.html +++ b/layouts/partials/menu-filetree.html @@ -8,9 +8,9 @@ diff --git a/layouts/partials/page-footer.html b/layouts/partials/page-footer.html index deee3b5..0de3d81 100644 --- a/layouts/partials/page-footer.html +++ b/layouts/partials/page-footer.html @@ -44,7 +44,7 @@