From 012ccee53d9154e4143f86ba40e492075db861ce Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Tue, 26 Jan 2021 09:45:08 -0800 Subject: [PATCH] Add before and after partials for toc (#296) Closes #257 --- README.md | 30 ++++++++++--------- assets/_main.scss | 4 +-- ...s_50fc8c04e12a2f59027287995557ceff.content | 2 +- ...scss_50fc8c04e12a2f59027287995557ceff.json | 2 +- layouts/_default/baseof.html | 6 +++- layouts/partials/docs/inject/toc-after.html | 0 layouts/partials/docs/inject/toc-before.html | 0 7 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 layouts/partials/docs/inject/toc-after.html create mode 100644 layouts/partials/docs/inject/toc-before.html diff --git a/README.md b/README.md index 0e8bb98..ce6f88a 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,12 @@ hugo server --minify --theme book ### File tree menu (default) -By default, the theme will render pages from the `content/docs` section as a menu in a tree structure. +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. ### Leaf bundle menu -You can also use leaf bundle and the content of its `index.md` file as menu. +You can also use leaf bundle and the content of its `index.md` file as menu. Given you have the following file structure: ``` @@ -108,14 +108,14 @@ And Enable it by setting `BookMenuBundle: /menu` in Site configuration. ## Blog -A simple blog is supported in the section `posts`. +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 `config.toml` file. +There are a few configuration options that you can add to your `config.toml` file. You can also see the `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml). ```toml @@ -234,15 +234,17 @@ bookSearchExclude = true There are few empty partials you can override in `layouts/partials/` -| 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 `