Breaking Change: replace BookEditPath with BookLastChangeLink and BookEditLink tempaltes

This commit is contained in:
Alex Shpak
2025-08-03 21:40:26 +02:00
parent 7bd4d673cc
commit 2b0d7ffa26
8 changed files with 76 additions and 74 deletions
+13 -18
View File
@@ -1,6 +1,6 @@
# hugo server --minify --themesDir ../.. --baseURL=http://0.0.0.0:1313/theme/hugo-book/
# hugo server --minify --themesDir ../..
baseURL = 'https://example.com/'
baseURL = 'http://0.0.0.0:1313/hugo-book/'
title = 'Hugo Book'
theme = 'hugo-book'
@@ -72,28 +72,23 @@ enableGitInfo = true
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
BookSection = 'docs'
# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
BookRepo = 'https://github.com/alex-shpak/hugo-book'
# (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 'commit') Specifies commit portion of the link to the page's last modified
# commit hash for 'doc' page type.
# Requires 'BookRepo' param.
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
# Github uses 'commit', Bitbucket uses 'commits'
# BookCommitPath = 'commit'
# (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 }}'
# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Edit path must point to root directory of repo.
BookEditPath = 'edit/main/exampleSite'
# Configure the date format used on the pages
# (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,
# (Optional, default true) Enables search function with fuse.js.,
# Index is built on fly, therefore it might slowdown your website.
# Configuration for indexing can be adjusted in i18n folder per language.
BookSearch = true