Skip to content

Commit 0593f02

Browse files
authored
Update readme with main branch, update config examples (#771)
1 parent 7fe158c commit 0593f02

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### [Hugo](https://gohugo.io) documentation theme as simple as plain book
88

9-
![Screenshot](https://raw.githubusercontent.com/alex-shpak/hugo-book/master/images/screenshot.png)
9+
![Screenshot](https://raw.githubusercontent.com/alex-shpak/hugo-book/main/images/screenshot.png)
1010

1111
- [Features](#features)
1212
- [Requirements](#requirements)
@@ -105,7 +105,7 @@ A blog is not the primary usecase of this theme, so it has only minimal features
105105
### Site Configuration
106106

107107
There are a few configuration options that you can add to your `hugo.toml` file.
108-
You can also see the `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/hugo.yaml).
108+
You can also see the `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/main/exampleSite/hugo.yaml).
109109

110110
```toml
111111
# (Optional) Set Google Analytics if you use it to track your website.
@@ -272,10 +272,10 @@ To enable plugins, add `@import "plugins/{name}";` to `assets/_custom.scss` in y
272272

273273
There are a few hugo templates inserted in `<head>`
274274

275-
- [Google Analytics](https://gohugo.io/templates/internal/#google-analytics)
276-
- [Open Graph](https://gohugo.io/templates/internal/#open-graph)
275+
- [Google Analytics](https://gohugo.io/templates/embedded/#google-analytics)
276+
- [Open Graph](https://gohugo.io/templates/embedded/#open-graph)
277277

278-
To disable Open Graph inclusion you can create your own empty file `/layouts/_internal/opengraph.html`.
278+
To disable Open Graph inclusion you can create your own empty file `/layouts/partials/opengraph.html`.
279279
In fact almost empty not quite empty because an empty file looks like absent for HUGO. For example:
280280
```
281281
<!-- -->
@@ -304,7 +304,7 @@ If you are using `config.yaml` or `config.json`, consult the [configuration mark
304304

305305
This theme follows a simple incremental versioning. e.g. `v1.0.0`, `v2.0.0` and so on. Releases will happen on breaking changes.
306306

307-
If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `master` branch and update your website when needed.
307+
If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `main` branch and update your website when needed, this also the default branch.
308308

309309
## Contributing
310310

exampleSite/hugo.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# hugo server --minify --themesDir ../..
22

3+
# for maximum cleanups and rebuilds, run where you checked out the repository
4+
# hugo server --printPathWarnings --disableFastRender --cleanDestinationDir=true --logLevel=debug \
5+
# --gc -M -s exampleSite --themesDir ../.. -b http://127.0.0.1/
6+
37
baseURL = 'http://0.0.0.0:1313/hugo-book/'
48
title = 'Hugo Book'
59
theme = 'hugo-book'
@@ -86,7 +90,7 @@ enableGitInfo = true
8690
BookTheme = 'light'
8791

8892
# (Optional, default none) Controls table of contents visibility on right side of pages.
89-
# Start and end levels can be controlled with markup.tableOfContents setting.
93+
# Start and end levels can be controlled globally with markup.tableOfContents setting.
9094
# You can also specify this parameter per page in front matter.
9195
# BookToC = true
9296

@@ -103,7 +107,8 @@ enableGitInfo = true
103107
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
104108
BookSection = 'docs'
105109

106-
# Here for backwar compatibility, not required.
110+
# Here for backward compatibility, not required.
111+
# It's here as an example how to use it with BookLastChangeLink or BookEditLink
107112
BookRepo = 'https://github.com/alex-shpak/hugo-book/'
108113

109114
# (Optional, default none) Set template for commit link for the page. Requires enableGitInfo.
@@ -128,20 +133,22 @@ enableGitInfo = true
128133
BookSearch = true
129134

130135
# (Optional, default true) Enables comments template on pages
131-
# By default partals/docs/comments.html includes Disqus template
136+
# By default partials/docs/comments.html includes Disqus template
132137
# See https://gohugo.io/content-management/comments/#configure-disqus
133138
# Can be overwritten by same param in page frontmatter
134139
BookComments = true
135140

136141
# /!\ This is an experimental feature, might be removed or changed at any time
137142
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
138143
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
139-
# Theme will print warning or error if page referenced in markdown does not exists.
144+
# Hugo Book will print warning or error if page referenced in markdown does not exists.
140145
# Possible values are false | 'warning' | 'error'
141146
BookPortableLinks = 'warning'
142147

143148
# /!\ This is an experimental feature, might be removed or changed at any time
144-
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
149+
# (Optional, experimental, default false)
150+
# When set to 'preache' it enables a service worker that caches visited pages and resources for offline use.
151+
# Possible values are false | true | 'precache'
145152
BookServiceWorker = 'precache'
146153

147154
# /!\ This is an experimental feature, might be removed or changed at any time

exampleSite/hugo.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# hugo server --minify --themesDir ../..
22

3+
# for maximum cleanups and rebuilds, run where you checked out the repository
4+
# hugo server --printPathWarnings --disableFastRender --cleanDestinationDir=true --logLevel=debug \
5+
# --gc -M -s exampleSite --themesDir ../.. -b http://127.0.0.1/
6+
37
baseURL: http://0.0.0.0:1313/hugo-book/
48
title: Hugo Book
59
theme: hugo-book
@@ -73,7 +77,7 @@ params:
7377
BookTheme: "light"
7478

7579
# (Optional, default none) Controls table of contents visibility on right side of pages.
76-
# Start and end levels can be controlled with markup.tableOfContents setting.
80+
# Start and end levels can be controlled globally with markup.tableOfContents setting.
7781
# You can also specify this parameter per page in front matter.
7882
# BookToC: true
7983

@@ -112,21 +116,22 @@ params:
112116
BookSearch: true
113117

114118
# (Optional, default true) Enables comments template on pages
115-
# By default partals/docs/comments.html includes Disqus template
119+
# By default partials/docs/comments.html includes Disqus template
116120
# See https://gohugo.io/content-management/comments/#configure-disqus
117121
# Can be overwritten by same param in page frontmatter
118122
BookComments: true
119123

120124
# /!\ This is an experimental feature, might be removed or changed at any time
121125
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
122126
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
123-
# Theme will print warning or error if page referenced in markdown does not exists.
127+
# Hugo Book will print warning or error if page referenced in markdown does not exists.
124128
# Possible values are false | 'warning' | 'error'
125129
BookPortableLinks: 'warning'
126130

127131
# /!\ This is an experimental feature, might be removed or changed at any time
128-
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
129-
# can be false, true or 'precache', precache will try to download all content pages on install.
132+
# (Optional, experimental, default false)
133+
# When set to 'preache' it enables a service worker that caches visited pages and resources for offline use.
134+
# Possible values are false | true | 'precache'
130135
BookServiceWorker: "precache"
131136

132137
# /!\ This is an experimental feature, might be removed or changed at any time
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<!-- This partial can be replaced to support other commenting engines -->
2-
{{ template "_internal/disqus.html" . }}
2+
{{ partial "disqus.html" . }}

layouts/_partials/docs/html-head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<meta http-equiv="Refresh" content="0; url='{{ . }}'" />
1515
{{- end -}}
1616

17-
{{- template "_internal/opengraph.html" . -}}
17+
{{ partial "opengraph.html" . }}
1818

1919
<title>{{ partial "docs/html-head-title" . }}</title>
2020
{{ partial "docs/html-head-favicon" . }}
@@ -45,7 +45,7 @@
4545
<script defer src="{{ $swJS.RelPermalink }}" {{ template "integrity" $swJS }}></script>
4646
{{ end -}}
4747

48-
{{- template "_internal/google_analytics.html" . -}}
48+
{{ partial "google_analytics.html" . }}
4949

5050
<!-- RSS -->
5151
{{- with .OutputFormats.Get "rss" -}}

layouts/term.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h2>
1111
</article>
1212
{{ end }}
1313

14-
{{ template "_internal/pagination.html" . }}
14+
{{ partial "pagination.html" . }}
1515
{{ end }}
1616

1717
{{ define "toc-container" }}

theme.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
name = "Book"
55
license = "MIT"
6-
licenselink = "https://github.com/alex-shpak/hugo-book/blob/master/LICENSE"
6+
licenselink = "https://github.com/alex-shpak/hugo-book/blob/main/LICENSE"
77
description = "Hugo documentation theme as simple as plain book"
88
homepage = "https://github.com/alex-shpak/hugo-book"
99
demosite = "https://hugo-book-demo.netlify.app"

0 commit comments

Comments
 (0)