Skip to content

Commit 24bf5a4

Browse files
committed
hugo: use new hugo-book edit link feature
Remove custom footer template and only override the edit link partial with the custom book index replace logic. This helps to reduce future incompatibility by minimizing overwritten templates.
1 parent 1fc4b74 commit 24bf5a4

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

website/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ theme = "hugo-book"
2929
BookPortableLinks = true
3030
BookRepo = 'https://github.com/uapi-group/kernel-features'
3131
BookCommitPath = 'commit'
32-
BookEditPath = 'edit/main'
32+
BookEditLink = '{{ .Site.Params.BookRepo }}/edit/main/{{ .Path }}'
3333
BookIndexPage = 'README.md'
3434

3535
[modules]

website/layouts/partials/docs/footer.html

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- return (partial "docs/text/template" (dict "Template" .Site.Params.BookEditLink "Context" (dict
2+
"Site" .Site
3+
"Page" .Page
4+
"Path" (strings.TrimPrefix hugo.WorkingDir ( replace .Page.File.Path "_index.md" .Site.Params.BookIndexPage))
5+
)) | urls.JoinPath) -}}

0 commit comments

Comments
 (0)