diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-27 14:14:28 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-27 14:14:28 +0800 |
| commit | 68ab4eb24125ffc983a1d3518eb8aee9db6c62c1 (patch) | |
| tree | 186abb11770869939d989bed926f88d56a5362a6 /layouts/shortcodes | |
| parent | e985258cc6769080d657e13f76b86928b1f47a97 (diff) | |
fix: book cannot be found in subfolders
Former-commit-id: cb3faa12d88539d6837d71a45a5524c7b78fc550
Diffstat (limited to 'layouts/shortcodes')
| -rw-r--r-- | layouts/shortcodes/bookcard.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/layouts/shortcodes/bookcard.html b/layouts/shortcodes/bookcard.html index fd7f81df..27d96001 100644 --- a/layouts/shortcodes/bookcard.html +++ b/layouts/shortcodes/bookcard.html @@ -1,4 +1,5 @@ -{{- $book := .Site.GetPage (printf "library/%s" (.Get 0)) -}} +{{- $books := where .Site.Pages "Section" "library" -}} +{{- $book := index (where $books "File.BaseFileName" (.Get 0)) 0 -}} {{- if $book }} <div class="markdown-body book-body"> |
