diff --git a/exampleSite/assets/icons/apparel.svg b/exampleSite/assets/icons/apparel.svg new file mode 100644 index 0000000..c647b73 --- /dev/null +++ b/exampleSite/assets/icons/apparel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/exampleSite/assets/icons/rocket.svg b/exampleSite/assets/icons/rocket.svg new file mode 100644 index 0000000..c7bb344 --- /dev/null +++ b/exampleSite/assets/icons/rocket.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/exampleSite/content.en/_index.md b/exampleSite/content.en/_index.md index a226d66..caba096 100644 --- a/exampleSite/content.en/_index.md +++ b/exampleSite/content.en/_index.md @@ -11,7 +11,7 @@ layout: landing Hugo-Book theme is designed to be easy to read, write, navigate and maintain. It is an attempt to create a sustainable web project. - {{}} + {{}} - ```shell # TL;DR @@ -45,13 +45,13 @@ layout: landing - {{< card >}} ### Shortcodes {anchor=false} Pretty good shortcodes are included to enhance content: - [Columns](/docs/shortcodes/columns/), - [Cards](/docs/shortcodes/experimental/cards/), - [Tabs](/docs/shortcodes/tabs/), - [Images](/docs/shortcodes/experimental/images/), - [Asciinema](/docs/shortcodes/asciinema/), - [KaTex](/docs/shortcodes/katex/), - [Mermaid](/docs/shortcodes/mermaid/) and others. + [Columns](/docs/content/shortcodes/columns/), + [Cards](/docs/content/shortcodes/cards/), + [Tabs](/docs/content/shortcodes/tabs/), + [Images](/docs/content/shortcodes/images/), + [Asciinema](/docs/content/shortcodes/asciinema/), + [KaTex](/docs/content/shortcodes/katex/), + [Mermaid](/docs/content/shortcodes/mermaid/) and others. {{< /card >}} - {{< card >}} diff --git a/exampleSite/content.en/docs/content/_index.md b/exampleSite/content.en/docs/content/_index.md index c8f513b..d8a4470 100644 --- a/exampleSite/content.en/docs/content/_index.md +++ b/exampleSite/content.en/docs/content/_index.md @@ -1,55 +1,6 @@ --- -weight: 40 title: Content & Structure -bookCollapseSection: true +weight: 20 +bookFlatSection: true +bookIcon: edit --- - -# Content Organization - -Hugo Book renders pages from a section as a sidebar menu. By default this is the `docs/` directory. - -## Example Directory Structure - -``` -content/ -├── docs/ -│ ├── _index.md -│ ├── getting-started.md -│ ├── guide/ -│ │ ├── _index.md -│ │ ├── install.md -│ │ └── configure.md -│ └── reference/ -│ └── _index.md -├── posts/ -│ ├── _index.md -│ └── my-post.md -└── _index.md -``` - -Pages are ordered by `weight` frontmatter, then alphabetically. Section `_index.md` files define the section entry in the menu. - -## Changing the Menu Section - -By default, pages under `docs/` are rendered as the sidebar menu. Change this with the `BookSection` parameter in [Configuration](/docs/configuration/). Set to `'/'` to render all top-level sections. - -## Page Layouts - -The theme provides several layouts: - -| Layout | Usage | Description | -| --- | --- | --- | -| (default) | Documentation pages | Sidebar menu + content + optional ToC | -| `landing` | `layout: landing` | Full-width, no sidebar. Used for homepages. | -| `book` | `layout: book` | Single-page view with all subsections listed | -| `posts` | Pages under `posts/` | Blog-style with date, tags, pagination | - -Set the layout in frontmatter - -```yaml {filename=_index.md} ---- -layout: landing ---- -``` - -See [Pages](/docs/content/pages/) for frontmatter reference and [Menus](/docs/content/menus/) for navigation controls. diff --git a/exampleSite/content.en/docs/content/blog.md b/exampleSite/content.en/docs/content/blog.md index db54451..1cb26f4 100644 --- a/exampleSite/content.en/docs/content/blog.md +++ b/exampleSite/content.en/docs/content/blog.md @@ -1,5 +1,5 @@ --- -weight: 3 +weight: 40 --- # Blog @@ -51,4 +51,4 @@ bookPostThumbnail: "cover.*" ## Date Format -The date display format is configured site-wide via `BookDateFormat`. See [Configuration](/docs/configuration/) for details. +The date display format is configured site-wide via `BookDateFormat`. See [Configuration](/docs/getting-started/configuration/) for details. diff --git a/exampleSite/content.en/docs/content/menus.md b/exampleSite/content.en/docs/content/menus.md index 53c932e..0db27c7 100644 --- a/exampleSite/content.en/docs/content/menus.md +++ b/exampleSite/content.en/docs/content/menus.md @@ -1,5 +1,5 @@ --- -weight: 2 +weight: 30 --- # Menu System diff --git a/exampleSite/content.en/docs/content/multilingual.md b/exampleSite/content.en/docs/content/multilingual.md index 9cbffe8..8b9762e 100644 --- a/exampleSite/content.en/docs/content/multilingual.md +++ b/exampleSite/content.en/docs/content/multilingual.md @@ -1,6 +1,6 @@ --- title: Multi-Language -weight: 4 +weight: 50 --- # Multi-Language Support diff --git a/exampleSite/content.en/docs/content/organisation.md b/exampleSite/content.en/docs/content/organisation.md new file mode 100644 index 0000000..c0092d1 --- /dev/null +++ b/exampleSite/content.en/docs/content/organisation.md @@ -0,0 +1,54 @@ +--- +title: Organisation +weight: 10 +--- + +# Content Organisation + +Hugo Book renders pages from a section as a sidebar menu. By default this is the `docs/` directory. + +## Example Directory Structure + +``` +content/ +├── docs/ +│ ├── _index.md +│ ├── getting-started.md +│ ├── guide/ +│ │ ├── _index.md +│ │ ├── install.md +│ │ └── configure.md +│ └── reference/ +│ └── _index.md +├── posts/ +│ ├── _index.md +│ └── my-post.md +└── _index.md +``` + +Pages are ordered by `weight` frontmatter, then alphabetically. Section `_index.md` files define the section entry in the menu. + +## Changing the Menu Section + +By default, pages under `docs/` are rendered as the sidebar menu. Change this with the `BookSection` parameter in [Configuration](/docs/getting-started/configuration/). Set to `'/'` to render all top-level sections. + +## Page Layouts + +The theme provides several layouts: + +| Layout | Usage | Description | +| --- | --- | --- | +| (default) | Documentation pages | Sidebar menu + content + optional ToC | +| `landing` | `layout: landing` | Full-width, no sidebar. Used for homepages. | +| `book` | `layout: book` | Single-page view with all subsections listed | +| `posts` | Pages under `posts/` | Blog-style with date, tags, pagination | + +Set the layout in frontmatter + +```yaml {filename=_index.md} +--- +layout: landing +--- +``` + +See [Pages](/docs/content/pages/) for frontmatter reference and [Menus](/docs/content/menus/) for navigation controls. diff --git a/exampleSite/content.en/docs/content/pages.md b/exampleSite/content.en/docs/content/pages.md index 5b9d19f..4327b77 100644 --- a/exampleSite/content.en/docs/content/pages.md +++ b/exampleSite/content.en/docs/content/pages.md @@ -1,5 +1,5 @@ --- -weight: 1 +weight: 20 --- # Page Frontmatter diff --git a/exampleSite/content.en/docs/shortcodes/_index.md b/exampleSite/content.en/docs/content/shortcodes/_index.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/_index.md rename to exampleSite/content.en/docs/content/shortcodes/_index.md diff --git a/exampleSite/content.en/docs/shortcodes/asciinema.md b/exampleSite/content.en/docs/content/shortcodes/asciinema.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/asciinema.md rename to exampleSite/content.en/docs/content/shortcodes/asciinema.md diff --git a/exampleSite/content.en/docs/shortcodes/experimental/badges.md b/exampleSite/content.en/docs/content/shortcodes/badges.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/experimental/badges.md rename to exampleSite/content.en/docs/content/shortcodes/badges.md diff --git a/exampleSite/content.en/docs/shortcodes/buttons.md b/exampleSite/content.en/docs/content/shortcodes/buttons.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/buttons.md rename to exampleSite/content.en/docs/content/shortcodes/buttons.md diff --git a/exampleSite/content.en/docs/shortcodes/experimental/cards.md b/exampleSite/content.en/docs/content/shortcodes/cards.md similarity index 88% rename from exampleSite/content.en/docs/shortcodes/experimental/cards.md rename to exampleSite/content.en/docs/content/shortcodes/cards.md index 3e085b0..a4fc03b 100644 --- a/exampleSite/content.en/docs/shortcodes/experimental/cards.md +++ b/exampleSite/content.en/docs/content/shortcodes/cards.md @@ -1,6 +1,6 @@ # Cards -Content blocks with optional images and links. Often used with [Columns](/docs/shortcodes/columns) for grid layouts. +Content blocks with optional images and links. Often used with [Columns](/docs/content/shortcodes/columns) for grid layouts. ## Syntax @@ -18,7 +18,7 @@ Markdown content Cards can display an image above the content. {{< /card >}} -- {{< card href="/docs/shortcodes/experimental/cards" >}} +- {{< card href="/docs/content/shortcodes/cards" >}} ### With Link {anchor=false} When `href` is set, the entire card becomes clickable. {{< /card >}} diff --git a/exampleSite/content.en/docs/shortcodes/columns.md b/exampleSite/content.en/docs/content/shortcodes/columns.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/columns.md rename to exampleSite/content.en/docs/content/shortcodes/columns.md diff --git a/exampleSite/content.en/docs/shortcodes/details.md b/exampleSite/content.en/docs/content/shortcodes/details.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/details.md rename to exampleSite/content.en/docs/content/shortcodes/details.md diff --git a/exampleSite/content.en/docs/shortcodes/hints.md b/exampleSite/content.en/docs/content/shortcodes/hints.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/hints.md rename to exampleSite/content.en/docs/content/shortcodes/hints.md diff --git a/exampleSite/content.en/docs/shortcodes/experimental/images.md b/exampleSite/content.en/docs/content/shortcodes/images.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/experimental/images.md rename to exampleSite/content.en/docs/content/shortcodes/images.md diff --git a/exampleSite/content.en/docs/shortcodes/katex.md b/exampleSite/content.en/docs/content/shortcodes/katex.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/katex.md rename to exampleSite/content.en/docs/content/shortcodes/katex.md diff --git a/exampleSite/content.en/docs/shortcodes/mermaid.md b/exampleSite/content.en/docs/content/shortcodes/mermaid.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/mermaid.md rename to exampleSite/content.en/docs/content/shortcodes/mermaid.md diff --git a/exampleSite/content.en/docs/shortcodes/experimental/section.md b/exampleSite/content.en/docs/content/shortcodes/section.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/experimental/section.md rename to exampleSite/content.en/docs/content/shortcodes/section.md diff --git a/exampleSite/content.en/docs/shortcodes/steps.md b/exampleSite/content.en/docs/content/shortcodes/steps.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/steps.md rename to exampleSite/content.en/docs/content/shortcodes/steps.md diff --git a/exampleSite/content.en/docs/shortcodes/tabs.md b/exampleSite/content.en/docs/content/shortcodes/tabs.md similarity index 100% rename from exampleSite/content.en/docs/shortcodes/tabs.md rename to exampleSite/content.en/docs/content/shortcodes/tabs.md diff --git a/exampleSite/content.en/docs/customization/_index.md b/exampleSite/content.en/docs/customization/_index.md index 811d1a2..e129a9f 100644 --- a/exampleSite/content.en/docs/customization/_index.md +++ b/exampleSite/content.en/docs/customization/_index.md @@ -1,139 +1,6 @@ --- -weight: 50 +title: Customization +weight: 30 +bookFlatSection: true +bookIcon: apparel --- - -# Customization - -Hugo Book can be customized through theming, custom SCSS, 'inject' partials, and file overrides. - -## Built-in Themes - -Set `BookTheme` in your site config - -```toml {filename=hugo.toml} -[params] - BookTheme = 'light' # or 'dark', 'auto' -``` - -| Theme | Description | -| --- | --- | -| `light` | Default. Light background with dark text. | -| `dark` | Dark background (Nord palette) with light text. | -| `auto` | Switches between light and dark based on OS/browser preference (`prefers-color-scheme`). | - -## Plugin Themes - -Additional themes are available as SCSS plugins. Import in your `assets/_custom.scss` - -```scss -@import "plugins/themes"; -``` - -Then set `BookTheme` to one of: - -| Theme | Description | -| --- | --- | -| `contrast-light` | High contrast light variant | -| `contrast-dark` | High contrast dark variant | -| `contrast-auto` | High contrast, auto-switching | -| `catppuccin-light` | [Catppuccin](https://catppuccin.com/) Latte palette | -| `catppuccin-dark` | Catppuccin Frappe palette | -| `catppuccin-auto` | Catppuccin, auto-switching | -| `ayu-light` | [Ayu](https://github.com/ayu-theme) light palette | -| `ayu-dark` | Ayu mirage dark palette | -| `ayu-auto` | Ayu, auto-switching | - -## Custom Theme - -Define a theme mixin in `assets/_custom.scss` - -```scss -@mixin theme-mytheme { - --body-background: #fafafa; - --body-font-color: #333; - --color-link: #0066cc; - --color-visited-link: #6633cc; -} -``` - -Then set `BookTheme = 'mytheme'`. The theme uses `@include theme-{{ .Site.Params.BookTheme }}` to select the mixin at build time. - -For auto-switching themes (light/dark based on OS preference), see the `theme-auto` mixin in `assets/_defaults.scss` as a reference. - -## CSS Custom Properties - -Override CSS custom properties in `_custom.scss` to adjust the current theme. The full set of properties is defined in [`assets/_defaults.scss`](https://github.com/alex-shpak/hugo-book/blob/main/assets/_defaults.scss). - -## Custom Styles - -The theme includes an empty `assets/_custom.scss` file that is loaded after all theme styles. Create this file in your project's `assets/` directory to add custom CSS without overriding the entire stylesheet. - -```scss -// assets/_custom.scss - -.book-page { - max-width: 60rem; -} - -.book-menu nav { - font-size: 0.9rem; -} -``` - -## SCSS Plugins - -The theme ships with optional SCSS plugins. Import them in your `_custom.scss`: - -```scss -@import "plugins/numbered"; /* Automatically number headings in the content area */ -@import "plugins/scrollbars"; /* Style scrollbars in the sidebar and content area */ -``` - -## SCSS Variables - -Layout variables like sidebar width, breakpoints, and padding are defined in [`assets/_defaults.scss`](https://github.com/alex-shpak/hugo-book/blob/main/assets/_defaults.scss). Override them in your `_custom.scss`. - -## 'Inject' Partials - -The theme provides empty partial templates at key points in the page layout. Override these to inject custom HTML without modifying the base templates. - -Create matching files in your project's `layouts/_partials/docs/inject/` directory. - -| Partial | Location | -| --- | --- | -| `inject/head.html` | Inside `
`, e.g. meta tags, stylesheets, scripts | -| `inject/body.html` | Before ``, e.g. analytics, chat widgets, scripts | -| `inject/menu-before.html` | Before the sidebar menu | -| `inject/menu-after.html` | After the sidebar menu | -| `inject/content-before.html` | Before the page content | -| `inject/content-after.html` | After the page content | -| `inject/toc-before.html` | Before the table of contents | -| `inject/toc-after.html` | After the table of contents | -| `inject/footer.html` | Inside the page footer | - -### Example - -To add a Google Analytics script, create `layouts/_partials/docs/inject/head.html` - -```html -{{ with .Site.Params.googleAnalytics }} - -{{ end }} -``` - -To add a custom banner above every page, create `layouts/_partials/docs/inject/content-before.html` - -```html - -``` - -## Override Priority - -Hugo's [lookup order](https://gohugo.io/templates/lookup-order/) lets you override any theme file by creating the same file in your project: - -- `layouts/`: Override templates and partials -- `assets/`: Override SCSS and JavaScript -- `static/`: Override static files (favicon, images) -- `i18n/`: Override or add translations diff --git a/exampleSite/content.en/docs/customization/inject-partials.md b/exampleSite/content.en/docs/customization/inject-partials.md new file mode 100644 index 0000000..4a9de8f --- /dev/null +++ b/exampleSite/content.en/docs/customization/inject-partials.md @@ -0,0 +1,40 @@ +--- +title: Inject Partials +weight: 30 +--- + +# Inject Partials + +The theme provides empty partial templates at key points in the page layout. Override these to inject custom HTML without modifying the base templates. + +Create matching files in your project's `layouts/_partials/docs/inject/` directory. + +| Partial | Location | +| --- | --- | +| `inject/head.html` | Inside ``, e.g. meta tags, stylesheets, scripts | +| `inject/body.html` | Before ``, e.g. analytics, chat widgets, scripts | +| `inject/menu-before.html` | Before the sidebar menu | +| `inject/menu-after.html` | After the sidebar menu | +| `inject/content-before.html` | Before the page content | +| `inject/content-after.html` | After the page content | +| `inject/toc-before.html` | Before the table of contents | +| `inject/toc-after.html` | After the table of contents | +| `inject/footer.html` | Inside the page footer | + +## Example + +To add a Google Analytics script, create `layouts/_partials/docs/inject/head.html` + +```html +{{ with .Site.Params.googleAnalytics }} + +{{ end }} +``` + +To add a custom banner above every page, create `layouts/_partials/docs/inject/content-before.html` + +```html + +``` diff --git a/exampleSite/content.en/docs/customization/styles.md b/exampleSite/content.en/docs/customization/styles.md new file mode 100644 index 0000000..f2b3b66 --- /dev/null +++ b/exampleSite/content.en/docs/customization/styles.md @@ -0,0 +1,102 @@ +--- +title: Styles +weight: 20 +--- + +# Styles + +## Built-in Themes + +Set `BookTheme` in your site config + +```toml {filename=hugo.toml} +[params] + BookTheme = 'light' # or 'dark', 'auto' +``` + +| Theme | Description | +| --- | --- | +| `light` | Default. Light background with dark text. | +| `dark` | Dark background (Nord palette) with light text. | +| `auto` | Switches between light and dark based on OS/browser preference (`prefers-color-scheme`). | + +## Plugin Themes + +Additional themes are available as SCSS plugins. Import in your `assets/_custom.scss` + +```scss +@import "plugins/themes"; +``` + +Then set `BookTheme` to one of: + +| Theme | Description | +| --- | --- | +| `contrast-light` | High contrast light variant | +| `contrast-dark` | High contrast dark variant | +| `contrast-auto` | High contrast, auto-switching | +| `catppuccin-light` | [Catppuccin](https://catppuccin.com/) Latte palette | +| `catppuccin-dark` | Catppuccin Frappe palette | +| `catppuccin-auto` | Catppuccin, auto-switching | +| `ayu-light` | [Ayu](https://github.com/ayu-theme) light palette | +| `ayu-dark` | Ayu mirage dark palette | +| `ayu-auto` | Ayu, auto-switching | + +## Custom Theme + +Define a theme mixin in `assets/_custom.scss` + +```scss +@mixin theme-mytheme { + --body-background: #fafafa; + --body-font-color: #333; + --color-link: #0066cc; + --color-visited-link: #6633cc; +} +``` + +Then set `BookTheme = 'mytheme'`. The theme uses `@include theme-{{ .Site.Params.BookTheme }}` to select the mixin at build time. + +For auto-switching themes (light/dark based on OS preference), see the `theme-auto` mixin in `assets/_defaults.scss` as a reference. + +## CSS Custom Properties + +Override CSS custom properties in `_custom.scss` to adjust the current theme. The full set of properties is defined in [`assets/_defaults.scss`](https://github.com/alex-shpak/hugo-book/blob/main/assets/_defaults.scss). + +## Custom Styles + +The theme includes an empty `assets/_custom.scss` file that is loaded after all theme styles. Create this file in your project's `assets/` directory to add custom CSS without overriding the entire stylesheet. + +```scss +// assets/_custom.scss + +.book-page { + max-width: 60rem; +} + +.book-menu nav { + font-size: 0.9rem; +} +``` + +## SCSS Plugins + +The theme ships with optional SCSS plugins. Import them in your `_custom.scss`: + +```scss +@import "plugins/numbered"; /* Automatically number headings in the content area */ +@import "plugins/scrollbars"; /* Style scrollbars in the sidebar and content area */ +``` + +## SCSS Variables + +Layout variables like sidebar width, breakpoints, and padding are defined in [`assets/_defaults.scss`](https://github.com/alex-shpak/hugo-book/blob/main/assets/_defaults.scss). Override them in your `_custom.scss`. + +## Override Priority + +Hugo's [lookup order](https://gohugo.io/templates/lookup-order/) lets you override any theme file by creating the same file in your project: + +- `layouts/`: Override templates and partials +- `assets/`: Override SCSS and JavaScript +- `static/`: Override static files (favicon, images) +- `i18n/`: Override or add translations diff --git a/exampleSite/content.en/docs/getting-started/_index.md b/exampleSite/content.en/docs/getting-started/_index.md new file mode 100644 index 0000000..e505198 --- /dev/null +++ b/exampleSite/content.en/docs/getting-started/_index.md @@ -0,0 +1,6 @@ +--- +title: Getting Started +weight: 10 +bookFlatSection: true +bookIcon: rocket +--- diff --git a/exampleSite/content.en/docs/configuration/_index.md b/exampleSite/content.en/docs/getting-started/configuration.md similarity index 68% rename from exampleSite/content.en/docs/configuration/_index.md rename to exampleSite/content.en/docs/getting-started/configuration.md index 1928886..3931f9e 100644 --- a/exampleSite/content.en/docs/configuration/_index.md +++ b/exampleSite/content.en/docs/getting-started/configuration.md @@ -1,4 +1,5 @@ --- +title: Configuration weight: 30 --- @@ -50,12 +51,19 @@ All theme parameters are set under `[params]` in your site config. Every paramet # By default uses Disqus; override partials/docs/comments.html for others BookComments = true - # Enable portable markdown links (resolve relative .md links) - # Values: false, 'warning', 'error' + # /!\ Experimental, may change or be removed. + # Enable portable markdown links to resolve relative .md links to Hugo URLs. + # Lets you write [text](./other.md) instead of Hugo's relref shortcode. + # false - disabled, relative .md links not resolved + # 'warning' - enabled, prints a build warning if linked page doesn't exist + # 'error' - enabled, fails the build if linked page doesn't exist BookPortableLinks = false - # Enable service worker for offline caching - # Values: false, true, 'precache' + # /!\ Experimental, may change or be removed. + # Register a service worker for offline access to visited pages. + # false - disabled (default) + # true - caches pages as you visit them + # 'precache' - pre-populates cache with all site pages on first load BookServiceWorker = false # Only show languages that have translations for current page @@ -126,52 +134,3 @@ The theme supports plain text output alongside HTML, useful for accessibility an section = ['html', 'txt'] ``` -## Portable Links - -> [!WARNING] -> Experimental feature. May change or be removed. - -Portable links resolve relative markdown links (`[text](./other-page.md)` or `[text](/docs/other-page.md)`) to the correct Hugo URLs. This lets you write standard markdown that works in both text editors and the rendered site. - -```toml {filename=hugo.toml} -[params] - BookPortableLinks = 'warning' -``` - -`false` -: Disabled. Relative `.md` links are not resolved. - -`'warning'` -: Enabled. Hugo prints a warning during build if a linked page doesn't exist. - -`'error'` -: Enabled. Hugo fails the build if a linked page doesn't exist. - -With portable links enabled, you can write - -```markdown -See [Configuration](./configuration.md) for details. -``` - -Instead of Hugo's `relref` shortcode. Both image links and page links are resolved. - -## Service Worker - -> [!WARNING] -> Experimental feature. May change or be removed. - -Hugo Book can register a service worker for offline access to visited pages. - -```toml {filename=hugo.toml} -[params] - BookServiceWorker = 'precache' -``` - -`false` -: Disabled (default). - -`true` -: Enables a service worker that caches pages as you visit them for offline reading. - -`'precache'` -: Enables a service worker that pre-populates the cache with all site pages on first load. Visited resources are also cached. diff --git a/exampleSite/content.en/docs/getting-started.md b/exampleSite/content.en/docs/getting-started/create-a-site.md similarity index 91% rename from exampleSite/content.en/docs/getting-started.md rename to exampleSite/content.en/docs/getting-started/create-a-site.md index 55302be..1981603 100644 --- a/exampleSite/content.en/docs/getting-started.md +++ b/exampleSite/content.en/docs/getting-started/create-a-site.md @@ -2,7 +2,7 @@ weight: 20 --- -# Getting Started +# Create a Site ## Prerequisites @@ -21,7 +21,7 @@ git submodule update --init --remote hugo server --minify ``` -By default, the theme renders pages under `docs/` section as the sidebar menu. See [Content Organization](/docs/content/) for details. +By default, the theme renders pages under `docs/` section as the sidebar menu. See [Content Organisation](/docs/content/organisation/) for details. ## Installation Methods @@ -98,4 +98,4 @@ theme = 'hugo-book' unsafe = true ``` -See [Configuration](/docs/configuration/) for the full list of parameters. +See [Configuration](/docs/getting-started/configuration/) for the full list of parameters. diff --git a/exampleSite/content.en/docs/introduction.md b/exampleSite/content.en/docs/getting-started/introduction.md similarity index 95% rename from exampleSite/content.en/docs/introduction.md rename to exampleSite/content.en/docs/getting-started/introduction.md index 4b87bd7..2b0a6bf 100644 --- a/exampleSite/content.en/docs/introduction.md +++ b/exampleSite/content.en/docs/getting-started/introduction.md @@ -16,7 +16,7 @@ Theme as an extendable base. Long-term maintainability. : Few dependencies means fewer things to break. The theme avoids heavy JavaScript libraries, CSS frameworks, and complex build pipelines. -[Get Started](/docs/getting-started/) +[Get Started](/docs/getting-started/create-a-site/) ## Links - [Source code](https://github.com/alex-shpak/hugo-book) diff --git a/exampleSite/content.en/docs/shortcodes/experimental/_index.md b/exampleSite/content.en/docs/shortcodes/experimental/_index.md deleted file mode 100644 index 62729a9..0000000 --- a/exampleSite/content.en/docs/shortcodes/experimental/_index.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -bookCollapseSection: true ---- diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 9ac2535..68415b3 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -58,14 +58,9 @@ enableGitInfo = true weight = 3 [menu] -[[menu.home]] - name = 'About' - pageRef = '/docs/introduction/' - weight = 1 - [[menu.home]] name = 'Documentation' - pageRef = '/docs/getting-started/' + pageRef = '/docs/getting-started/introduction' weight = 2 [[menu.home]] diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 2efc9e5..612ae02 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -55,11 +55,8 @@ languages: menu: home: - - name: "About" - pageRef: "/docs/introduction/" - weight: 1 - name: "Documentation" - pageRef: "/docs/getting-started/" + pageRef: "/docs/getting-started/introduction" weight: 2 - name: "Showcases" pageRef: "/showcases/" diff --git a/layouts/_partials/docs/icon.html b/layouts/_partials/docs/icon.html index 859c179..aed0b92 100644 --- a/layouts/_partials/docs/icon.html +++ b/layouts/_partials/docs/icon.html @@ -1,2 +1,2 @@ -{{- $icon := resources.Get (printf "icons/%s.svg" .) -}} +{{- $icon := resources.GetMatch (printf "icons/%s.*" .) -}} {{- return $icon.RelPermalink -}}