From 9b5f3fad7068298265dbbc8a65077f7917a090a5 Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sun, 21 Sep 2025 00:27:35 +0200 Subject: updated hugo-book theme --- themes/hugo-book/.github/workflows/main.yml | 34 - themes/hugo-book/README.md | 317 ++++++++++ themes/hugo-book/archetypes/docs.md | 1 + themes/hugo-book/assets/_defaults.scss | 23 +- themes/hugo-book/assets/_fonts.scss | 34 - themes/hugo-book/assets/_main.scss | 113 +++- themes/hugo-book/assets/_markdown.scss | 46 +- themes/hugo-book/assets/_shortcodes.scss | 198 +++++- themes/hugo-book/assets/_utils.scss | 4 + themes/hugo-book/assets/book.scss | 1 - themes/hugo-book/assets/katex.json | 7 + themes/hugo-book/assets/normalize.css | 376 ++++------- themes/hugo-book/assets/plugins/_numbered.scss | 4 +- .../hugo-book/exampleSite/assets/placeholder.svg | 2 + themes/hugo-book/exampleSite/assets/thumbnail.svg | 2 + themes/hugo-book/exampleSite/content.en/_index.md | 78 ++- .../content.en/docs/shortcodes/badges.md | 29 + .../content.en/docs/shortcodes/buttons.md | 2 +- .../content.en/docs/shortcodes/cards.md | 63 ++ .../content.en/docs/shortcodes/columns.md | 103 ++-- .../content.en/docs/shortcodes/hints.md | 49 +- .../content.en/docs/shortcodes/images.md | 30 + .../content.en/docs/shortcodes/katex.md | 67 +- .../content.en/docs/shortcodes/mermaid.md | 156 ++++- .../content.en/docs/shortcodes/steps.md | 36 ++ themes/hugo-book/exampleSite/hugo.toml | 65 +- themes/hugo-book/exampleSite/hugo.yaml | 52 +- themes/hugo-book/go.mod | 3 + themes/hugo-book/i18n/bg.yaml | 14 + themes/hugo-book/i18n/pt-BR.yaml | 14 + themes/hugo-book/i18n/pt.yaml | 2 +- themes/hugo-book/i18n/sw.yaml | 14 + .../layouts/_default/_markup/render-heading.html | 4 - .../layouts/_default/_markup/render-image.html | 19 - .../layouts/_default/_markup/render-link.html | 29 - themes/hugo-book/layouts/_default/baseof.html | 83 --- themes/hugo-book/layouts/_default/list.html | 1 - themes/hugo-book/layouts/_default/single.html | 1 - .../layouts/_markup/render-blockquote.html | 9 + .../layouts/_markup/render-codeblock-katex.html | 13 + .../layouts/_markup/render-codeblock-mermaid.html | 12 + .../layouts/_markup/render-codeblock.html | 10 + .../hugo-book/layouts/_markup/render-heading.html | 6 + themes/hugo-book/layouts/_markup/render-image.html | 6 + themes/hugo-book/layouts/_markup/render-link.html | 6 + themes/hugo-book/layouts/_partials/docs/brand.html | 8 + .../hugo-book/layouts/_partials/docs/comments.html | 2 + themes/hugo-book/layouts/_partials/docs/date.html | 6 + .../hugo-book/layouts/_partials/docs/footer.html | 29 + .../hugo-book/layouts/_partials/docs/header.html | 13 + .../layouts/_partials/docs/html-head-favicon.html | 1 + .../layouts/_partials/docs/html-head-title.html | 1 + .../layouts/_partials/docs/html-head.html | 56 ++ .../layouts/_partials/docs/inject/body.html | 0 .../_partials/docs/inject/content-after.html | 0 .../_partials/docs/inject/content-before.html | 0 .../layouts/_partials/docs/inject/footer.html | 0 .../layouts/_partials/docs/inject/head.html | 0 .../layouts/_partials/docs/inject/menu-after.html | 0 .../layouts/_partials/docs/inject/menu-before.html | 0 .../layouts/_partials/docs/inject/toc-after.html | 0 .../layouts/_partials/docs/inject/toc-before.html | 0 .../layouts/_partials/docs/languages.html | 33 + .../layouts/_partials/docs/links/commit.html | 5 + .../layouts/_partials/docs/links/edit.html | 5 + .../_partials/docs/links/portable-image.html | 26 + .../_partials/docs/links/portable-link.html | 29 + .../layouts/_partials/docs/menu-filetree.html | 49 ++ .../layouts/_partials/docs/menu-hugo.html | 29 + themes/hugo-book/layouts/_partials/docs/menu.html | 21 + .../layouts/_partials/docs/pagination.html | 28 + .../layouts/_partials/docs/post-meta.html | 16 + .../layouts/_partials/docs/post-prev-next.html | 18 + .../layouts/_partials/docs/prev-next-cache.html | 14 + .../layouts/_partials/docs/prev-next.html | 31 + .../hugo-book/layouts/_partials/docs/search.html | 8 + .../hugo-book/layouts/_partials/docs/taxonomy.html | 19 + .../layouts/_partials/docs/text/template.html | 9 + themes/hugo-book/layouts/_partials/docs/title.html | 17 + .../hugo-book/layouts/_partials/docs/toc-show.html | 4 + themes/hugo-book/layouts/_partials/docs/toc.html | 3 + themes/hugo-book/layouts/_shortcodes/badge.html | 5 + themes/hugo-book/layouts/_shortcodes/button.html | 5 + themes/hugo-book/layouts/_shortcodes/card.html | 22 + themes/hugo-book/layouts/_shortcodes/columns.html | 21 + themes/hugo-book/layouts/_shortcodes/details.html | 7 + themes/hugo-book/layouts/_shortcodes/hint.html | 3 + themes/hugo-book/layouts/_shortcodes/html.html | 1 + themes/hugo-book/layouts/_shortcodes/i18n.html | 2 + themes/hugo-book/layouts/_shortcodes/image.html | 12 + themes/hugo-book/layouts/_shortcodes/katex.html | 19 + themes/hugo-book/layouts/_shortcodes/mermaid.html | 12 + themes/hugo-book/layouts/_shortcodes/section.html | 13 + themes/hugo-book/layouts/_shortcodes/steps.html | 3 + themes/hugo-book/layouts/_shortcodes/tab.html | 9 + themes/hugo-book/layouts/_shortcodes/tabs.html | 3 + themes/hugo-book/layouts/baseof.html | 90 +++ themes/hugo-book/layouts/landing.html | 15 + themes/hugo-book/layouts/list.html | 1 + themes/hugo-book/layouts/partials/docs/brand.html | 8 - .../hugo-book/layouts/partials/docs/comments.html | 2 - themes/hugo-book/layouts/partials/docs/date.html | 6 - themes/hugo-book/layouts/partials/docs/footer.html | 27 - themes/hugo-book/layouts/partials/docs/header.html | 13 - .../layouts/partials/docs/html-head-favicon.html | 1 - .../layouts/partials/docs/html-head-title.html | 1 - .../hugo-book/layouts/partials/docs/html-head.html | 56 -- .../layouts/partials/docs/inject/body.html | 0 .../partials/docs/inject/content-after.html | 0 .../partials/docs/inject/content-before.html | 0 .../layouts/partials/docs/inject/footer.html | 0 .../layouts/partials/docs/inject/head.html | 0 .../layouts/partials/docs/inject/menu-after.html | 0 .../layouts/partials/docs/inject/menu-before.html | 0 .../layouts/partials/docs/inject/toc-after.html | 0 .../layouts/partials/docs/inject/toc-before.html | 0 .../hugo-book/layouts/partials/docs/languages.html | 33 - .../layouts/partials/docs/links/commit.html | 2 - .../layouts/partials/docs/links/edit.html | 2 - .../layouts/partials/docs/menu-filetree.html | 49 -- .../hugo-book/layouts/partials/docs/menu-hugo.html | 28 - themes/hugo-book/layouts/partials/docs/menu.html | 21 - .../hugo-book/layouts/partials/docs/post-meta.html | 16 - themes/hugo-book/layouts/partials/docs/search.html | 8 - .../hugo-book/layouts/partials/docs/taxonomy.html | 19 - themes/hugo-book/layouts/partials/docs/title.html | 17 - themes/hugo-book/layouts/partials/docs/toc.html | 3 - themes/hugo-book/layouts/posts/list.html | 35 +- themes/hugo-book/layouts/posts/single.html | 8 +- themes/hugo-book/layouts/shortcodes/button.html | 12 - themes/hugo-book/layouts/shortcodes/columns.html | 9 - themes/hugo-book/layouts/shortcodes/details.html | 7 - themes/hugo-book/layouts/shortcodes/hint.html | 3 - themes/hugo-book/layouts/shortcodes/html.html | 1 - themes/hugo-book/layouts/shortcodes/i18n.html | 2 - themes/hugo-book/layouts/shortcodes/katex.html | 13 - themes/hugo-book/layouts/shortcodes/mermaid.html | 12 - themes/hugo-book/layouts/shortcodes/section.html | 13 - themes/hugo-book/layouts/shortcodes/tab.html | 9 - themes/hugo-book/layouts/shortcodes/tabs.html | 3 - themes/hugo-book/layouts/single.html | 1 + themes/hugo-book/layouts/taxonomy/list.html | 13 - themes/hugo-book/layouts/taxonomy/taxonomy.html | 22 - themes/hugo-book/layouts/term.html | 27 + themes/hugo-book/static/favicon.png | Bin 2529 -> 298 bytes themes/hugo-book/static/favicon.svg | 2 +- .../fonts/roboto-mono-v13-latin-regular.woff | Bin 15160 -> 0 bytes .../fonts/roboto-mono-v13-latin-regular.woff2 | Bin 12312 -> 0 bytes .../static/fonts/roboto-v27-latin-700.woff | Bin 20396 -> 0 bytes .../static/fonts/roboto-v27-latin-700.woff2 | Bin 15828 -> 0 bytes .../static/fonts/roboto-v27-latin-regular.woff | Bin 20332 -> 0 bytes .../static/fonts/roboto-v27-latin-regular.woff2 | Bin 15688 -> 0 bytes themes/hugo-book/static/fuse.min.js | 6 +- themes/hugo-book/static/katex/auto-render.min.js | 2 +- themes/hugo-book/static/katex/katex.min.css | 2 +- themes/hugo-book/static/katex/katex.min.js | 2 +- themes/hugo-book/static/mermaid.min.js | 686 +++++++++++---------- themes/hugo-book/static/svg/backward.svg | 1 + themes/hugo-book/static/svg/calendar.svg | 2 +- themes/hugo-book/static/svg/edit.svg | 2 +- themes/hugo-book/static/svg/forward.svg | 1 + themes/hugo-book/static/svg/menu.svg | 2 +- themes/hugo-book/static/svg/toc.svg | 2 +- themes/hugo-book/static/svg/translate.svg | 2 +- themes/hugo-book/theme.toml | 2 +- 165 files changed, 2627 insertions(+), 1450 deletions(-) delete mode 100644 themes/hugo-book/.github/workflows/main.yml create mode 100644 themes/hugo-book/README.md delete mode 100644 themes/hugo-book/assets/_fonts.scss create mode 100644 themes/hugo-book/assets/katex.json create mode 100644 themes/hugo-book/exampleSite/assets/placeholder.svg create mode 100644 themes/hugo-book/exampleSite/assets/thumbnail.svg create mode 100644 themes/hugo-book/exampleSite/content.en/docs/shortcodes/badges.md create mode 100644 themes/hugo-book/exampleSite/content.en/docs/shortcodes/cards.md create mode 100644 themes/hugo-book/exampleSite/content.en/docs/shortcodes/images.md create mode 100644 themes/hugo-book/exampleSite/content.en/docs/shortcodes/steps.md create mode 100644 themes/hugo-book/go.mod create mode 100644 themes/hugo-book/i18n/bg.yaml create mode 100644 themes/hugo-book/i18n/pt-BR.yaml create mode 100644 themes/hugo-book/i18n/sw.yaml delete mode 100644 themes/hugo-book/layouts/_default/_markup/render-heading.html delete mode 100644 themes/hugo-book/layouts/_default/_markup/render-image.html delete mode 100644 themes/hugo-book/layouts/_default/_markup/render-link.html delete mode 100644 themes/hugo-book/layouts/_default/baseof.html delete mode 100644 themes/hugo-book/layouts/_default/list.html delete mode 100644 themes/hugo-book/layouts/_default/single.html create mode 100644 themes/hugo-book/layouts/_markup/render-blockquote.html create mode 100644 themes/hugo-book/layouts/_markup/render-codeblock-katex.html create mode 100644 themes/hugo-book/layouts/_markup/render-codeblock-mermaid.html create mode 100644 themes/hugo-book/layouts/_markup/render-codeblock.html create mode 100644 themes/hugo-book/layouts/_markup/render-heading.html create mode 100644 themes/hugo-book/layouts/_markup/render-image.html create mode 100644 themes/hugo-book/layouts/_markup/render-link.html create mode 100644 themes/hugo-book/layouts/_partials/docs/brand.html create mode 100644 themes/hugo-book/layouts/_partials/docs/comments.html create mode 100644 themes/hugo-book/layouts/_partials/docs/date.html create mode 100644 themes/hugo-book/layouts/_partials/docs/footer.html create mode 100644 themes/hugo-book/layouts/_partials/docs/header.html create mode 100644 themes/hugo-book/layouts/_partials/docs/html-head-favicon.html create mode 100644 themes/hugo-book/layouts/_partials/docs/html-head-title.html create mode 100644 themes/hugo-book/layouts/_partials/docs/html-head.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/body.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/content-after.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/content-before.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/footer.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/head.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/menu-after.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/menu-before.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/toc-after.html create mode 100644 themes/hugo-book/layouts/_partials/docs/inject/toc-before.html create mode 100644 themes/hugo-book/layouts/_partials/docs/languages.html create mode 100644 themes/hugo-book/layouts/_partials/docs/links/commit.html create mode 100644 themes/hugo-book/layouts/_partials/docs/links/edit.html create mode 100644 themes/hugo-book/layouts/_partials/docs/links/portable-image.html create mode 100644 themes/hugo-book/layouts/_partials/docs/links/portable-link.html create mode 100644 themes/hugo-book/layouts/_partials/docs/menu-filetree.html create mode 100644 themes/hugo-book/layouts/_partials/docs/menu-hugo.html create mode 100644 themes/hugo-book/layouts/_partials/docs/menu.html create mode 100644 themes/hugo-book/layouts/_partials/docs/pagination.html create mode 100644 themes/hugo-book/layouts/_partials/docs/post-meta.html create mode 100644 themes/hugo-book/layouts/_partials/docs/post-prev-next.html create mode 100644 themes/hugo-book/layouts/_partials/docs/prev-next-cache.html create mode 100644 themes/hugo-book/layouts/_partials/docs/prev-next.html create mode 100644 themes/hugo-book/layouts/_partials/docs/search.html create mode 100644 themes/hugo-book/layouts/_partials/docs/taxonomy.html create mode 100644 themes/hugo-book/layouts/_partials/docs/text/template.html create mode 100644 themes/hugo-book/layouts/_partials/docs/title.html create mode 100644 themes/hugo-book/layouts/_partials/docs/toc-show.html create mode 100644 themes/hugo-book/layouts/_partials/docs/toc.html create mode 100644 themes/hugo-book/layouts/_shortcodes/badge.html create mode 100644 themes/hugo-book/layouts/_shortcodes/button.html create mode 100644 themes/hugo-book/layouts/_shortcodes/card.html create mode 100644 themes/hugo-book/layouts/_shortcodes/columns.html create mode 100644 themes/hugo-book/layouts/_shortcodes/details.html create mode 100644 themes/hugo-book/layouts/_shortcodes/hint.html create mode 100644 themes/hugo-book/layouts/_shortcodes/html.html create mode 100644 themes/hugo-book/layouts/_shortcodes/i18n.html create mode 100644 themes/hugo-book/layouts/_shortcodes/image.html create mode 100644 themes/hugo-book/layouts/_shortcodes/katex.html create mode 100644 themes/hugo-book/layouts/_shortcodes/mermaid.html create mode 100644 themes/hugo-book/layouts/_shortcodes/section.html create mode 100644 themes/hugo-book/layouts/_shortcodes/steps.html create mode 100644 themes/hugo-book/layouts/_shortcodes/tab.html create mode 100644 themes/hugo-book/layouts/_shortcodes/tabs.html create mode 100644 themes/hugo-book/layouts/baseof.html create mode 100644 themes/hugo-book/layouts/landing.html create mode 100644 themes/hugo-book/layouts/list.html delete mode 100644 themes/hugo-book/layouts/partials/docs/brand.html delete mode 100644 themes/hugo-book/layouts/partials/docs/comments.html delete mode 100644 themes/hugo-book/layouts/partials/docs/date.html delete mode 100644 themes/hugo-book/layouts/partials/docs/footer.html delete mode 100644 themes/hugo-book/layouts/partials/docs/header.html delete mode 100644 themes/hugo-book/layouts/partials/docs/html-head-favicon.html delete mode 100644 themes/hugo-book/layouts/partials/docs/html-head-title.html delete mode 100644 themes/hugo-book/layouts/partials/docs/html-head.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/body.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/content-after.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/content-before.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/footer.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/head.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/menu-after.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/menu-before.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/toc-after.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/toc-before.html delete mode 100644 themes/hugo-book/layouts/partials/docs/languages.html delete mode 100644 themes/hugo-book/layouts/partials/docs/links/commit.html delete mode 100644 themes/hugo-book/layouts/partials/docs/links/edit.html delete mode 100644 themes/hugo-book/layouts/partials/docs/menu-filetree.html delete mode 100644 themes/hugo-book/layouts/partials/docs/menu-hugo.html delete mode 100644 themes/hugo-book/layouts/partials/docs/menu.html delete mode 100644 themes/hugo-book/layouts/partials/docs/post-meta.html delete mode 100644 themes/hugo-book/layouts/partials/docs/search.html delete mode 100644 themes/hugo-book/layouts/partials/docs/taxonomy.html delete mode 100644 themes/hugo-book/layouts/partials/docs/title.html delete mode 100644 themes/hugo-book/layouts/partials/docs/toc.html delete mode 100644 themes/hugo-book/layouts/shortcodes/button.html delete mode 100644 themes/hugo-book/layouts/shortcodes/columns.html delete mode 100644 themes/hugo-book/layouts/shortcodes/details.html delete mode 100644 themes/hugo-book/layouts/shortcodes/hint.html delete mode 100644 themes/hugo-book/layouts/shortcodes/html.html delete mode 100644 themes/hugo-book/layouts/shortcodes/i18n.html delete mode 100644 themes/hugo-book/layouts/shortcodes/katex.html delete mode 100644 themes/hugo-book/layouts/shortcodes/mermaid.html delete mode 100644 themes/hugo-book/layouts/shortcodes/section.html delete mode 100644 themes/hugo-book/layouts/shortcodes/tab.html delete mode 100644 themes/hugo-book/layouts/shortcodes/tabs.html create mode 100644 themes/hugo-book/layouts/single.html delete mode 100644 themes/hugo-book/layouts/taxonomy/list.html delete mode 100644 themes/hugo-book/layouts/taxonomy/taxonomy.html create mode 100644 themes/hugo-book/layouts/term.html delete mode 100644 themes/hugo-book/static/fonts/roboto-mono-v13-latin-regular.woff delete mode 100644 themes/hugo-book/static/fonts/roboto-mono-v13-latin-regular.woff2 delete mode 100644 themes/hugo-book/static/fonts/roboto-v27-latin-700.woff delete mode 100644 themes/hugo-book/static/fonts/roboto-v27-latin-700.woff2 delete mode 100644 themes/hugo-book/static/fonts/roboto-v27-latin-regular.woff delete mode 100644 themes/hugo-book/static/fonts/roboto-v27-latin-regular.woff2 create mode 100644 themes/hugo-book/static/svg/backward.svg create mode 100644 themes/hugo-book/static/svg/forward.svg (limited to 'themes') diff --git a/themes/hugo-book/.github/workflows/main.yml b/themes/hugo-book/.github/workflows/main.yml deleted file mode 100644 index 6c2df2c..0000000 --- a/themes/hugo-book/.github/workflows/main.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build with Hugo - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - hugo-version: - - 'latest' - - '0.134.2' - steps: - - uses: actions/checkout@v4 - with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: ${{ matrix.hugo-version }} - extended: true - - - name: Run Hugo - working-directory: exampleSite - run: hugo --themesDir ../.. - - # - name: Deploy - # uses: peaceiris/actions-gh-pages@v3 - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # publish_dir: ./public - diff --git a/themes/hugo-book/README.md b/themes/hugo-book/README.md new file mode 100644 index 0000000..36af809 --- /dev/null +++ b/themes/hugo-book/README.md @@ -0,0 +1,317 @@ +# Hugo Book Theme + +[![Hugo](https://img.shields.io/badge/hugo-0.146-blue.svg)](https://gohugo.io) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) +![Build with Hugo](https://github.com/alex-shpak/hugo-book/workflows/Build%20with%20Hugo/badge.svg) + +### [Hugo](https://gohugo.io) documentation theme as simple as plain book + +![Screenshot](https://raw.githubusercontent.com/alex-shpak/hugo-book/master/images/screenshot.png) + +- [Features](#features) +- [Requirements](#requirements) +- [Installation](#installation) +- [Menu](#menu) +- [Blog](#blog) +- [Configuration](#configuration) +- [Shortcodes](#shortcodes) +- [Versioning](#versioning) +- [Contributing](#contributing) + +## Features + +- Clean simple design +- Light and Mobile-Friendly +- Multi-language support +- Customisable +- Zero initial configuration +- Handy shortcodes +- Comments support +- Simple blog and taxonomy +- Primary features work without JavaScript +- Dark Mode + +## Requirements + +- Hugo 0.146 or higher +- Hugo extended version, [Installation Instructions](https://gohugo.io/installation/) + +## Installation + +### Install as git submodule +Navigate to your hugo project root and run: + +``` +git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book +``` + +Then run hugo (or set `theme = "hugo-book"`/`theme: hugo-book` in configuration file) + +``` +hugo server --minify --theme hugo-book +``` + +### Install as hugo module + +You can also add this theme as a Hugo module instead of a git submodule. + +Start with initializing hugo modules, if not done yet: +``` +hugo mod init github.com/repo/path +``` + +Navigate to your hugo project root and add [module] section to your `hugo.toml`: + +```toml +[module] +[[module.imports]] +path = 'github.com/alex-shpak/hugo-book' +``` + +Then, to load/update the theme module and run hugo: + +```sh +hugo mod get -u +hugo server --minify +``` + +### Creating site from scratch + +Below is an example on how to create a new site from scratch: + +```sh +hugo new site mydocs; cd mydocs +git init +git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book +cp -R themes/hugo-book/exampleSite/content.en/* ./content +``` + +```sh +hugo server --minify --theme hugo-book +``` + +## Menu + +By default, the theme will render pages from the `content/docs` section as a menu in a tree structure. +You can set `title` and `weight` in the front matter of pages to adjust the order and titles in the menu, as well as other parameters to hide or alter urls in the menu. You can choose which folder to use for generating menu with `BookSection` configuration parameter. + +## Blog + +A simple blog is supported in the section `posts`. +A blog is not the primary usecase of this theme, so it has only minimal features. + +## Configuration + +### Site Configuration + +There are a few configuration options that you can add to your `hugo.toml` file. +You can also see the `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/hugo.yaml). + +```toml +# (Optional) Set Google Analytics if you use it to track your website. +# Always put it on the top of the configuration file, otherwise it won't work +googleAnalytics = "UA-XXXXXXXXX-X" + +# (Optional) If you provide a Disqus shortname, comments will be enabled on +# all pages. +disqusShortname = "my-site" + +# (Optional) Set this to true if you use capital letters in file names +disablePathToLower = true + +# (Optional) Set this to true to enable 'Last Modified by' date and git author +# information on 'doc' type pages. +enableGitInfo = true + +# (Optional) Theme is intended for documentation use, therefore it doesn't render taxonomy. +# You can remove related files with config below +disableKinds = ['taxonomy', 'taxonomyTerm'] + +[params] + # (Optional, default light) Sets color theme: light, dark or auto. + # Theme 'auto' switches between dark and light modes based on browser/os preferences + BookTheme = 'light' + + # (Optional, default true) Controls table of contents visibility on right side of pages. + # Start and end levels can be controlled with markup.tableOfContents setting. + # You can also specify this parameter per page in front matter. + BookToC = true + + # (Optional, default none) Set the path to a logo for the book. If the logo is + # /static/logo.png then the path would be 'logo.png' + BookLogo = 'logo.png' + + # (Optional, default 'favicon.png') Set the path to a favicon for the site. + # If the favicon is in /static/custom.svg, then the path would be 'custom.svg'. + BookFavicon = 'favicon.png' + + # (Optional, default docs) Specify section of content to render as menu + # You can also set value to "*" to render all sections to menu + BookSection = 'docs' + + # (Optional, default none) Set template for commit link for the page. Requires enableGitInfo. + # When set enabled 'Last Modified' and a link to the commit in the footer of the page. + # Param is executed as template using .Site, .Page and .GitInfo as context. + BookLastChangeLink = 'https://github.com/alex-shpak/hugo-book/commit/{{ .GitInfo.Hash }}' + + # (Optional, default none) Set template for edit page link. + # When set enabled 'Edit this page' link in the footer of the page. + # Param is executed as template using .Site, .Page and .Path as context. + BookEditLink = 'https://github.com/alex-shpak/hugo-book/edit/main/exampleSite/{{ .Path }}' + + # (Optional, default 'January 2, 2006') Configure the date format used on the pages + # - In git information + # - In blog posts + # https://gohugo.io/functions/time/format/ + BookDateFormat = 'January 2, 2006' + + # (Optional, default true) Enables search function with flexsearch, + # Index is built on fly, therefore it might slowdown your website. + # Configuration for indexing can be adjusted in i18n folder per language. + BookSearch = true + + # (Optional, default true) Enables comments template on pages + # By default partials/docs/comments.html includes Disqus template + # See https://gohugo.io/content-management/comments/#configure-disqus + # Can be overwritten by same param in page frontmatter + BookComments = true + + # /!\ This is an experimental feature, might be removed or changed at any time + # (Optional, experimental, default false) Enables portable links and link checks in markdown pages. + # Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode + # Theme will print warning if page referenced in markdown does not exists. + BookPortableLinks = true + + # /!\ This is an experimental feature, might be removed or changed at any time + # (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use. + BookServiceWorker = true +``` + +### Multi-Language Support + +Theme supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/), just follow configuration guide there. You can also tweak search indexing configuration per language in `i18n` folder. + +### Page Configuration + +You can specify additional params in the front matter of individual pages: + +```toml +# Set type to 'docs' if you want to render page outside of configured section or if you render section other than 'docs' +type = 'docs' + +# Set page weight to re-arrange items in file-tree menu. +weight = 10 + +# (Optional) Set to 'true' to mark page as flat section in file-tree menu. +bookFlatSection = false + +# (Optional) Set to hide nested sections or pages at that level. Works only with file-tree menu mode +bookCollapseSection = true + +# (Optional) Set true to hide page or section from side menu. +bookHidden = false + +# (Optional) Set 'false' to hide ToC from page +bookToC = true + +# (Optional) If you have enabled BookComments for the site, you can disable it for specific pages. +bookComments = true + +# (Optional) Set to 'true' to exclude page from search index. +bookSearchExclude = false + +# (Optional) Set explicit href attribute for this page in a menu. +bookHref = '' +``` + +### Partials + +There are layout partials available for you to easily override components of the theme in `layouts/partials/`. + +In addition to this, there are several empty partials you can override to easily add/inject code. + +| Empty Partial | Placement | +| -------------------------------------------------- | ------------------------------------------- | +| `layouts/partials/docs/inject/head.html` | Before closing `` tag | +| `layouts/partials/docs/inject/body.html` | Before closing `` tag | +| `layouts/partials/docs/inject/footer.html` | After page footer content | +| `layouts/partials/docs/inject/menu-before.html` | At the beginning of `