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 | cb3faa12d88539d6837d71a45a5524c7b78fc550 (patch) | |
| tree | 293f4c7d2a758490575cc72f72fa0795f902fa8d | |
| parent | 8a355d8a7066b95eeb5356c79957a2df8f160c57 (diff) | |
fix: book cannot be found in subfolders
| -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"> |
