huge upgrade to theme and pagefind search bar.
This commit is contained in:
20
themes/hugo-book.backup/layouts/_shortcodes/card.html
Normal file
20
themes/hugo-book.backup/layouts/_shortcodes/card.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- with .Get "href" -}}
|
||||
{{- $destination := partial "docs/links/portable-link" (dict "Page" $.Page "Destination" .) -}}
|
||||
<div class="book-card{{ with $.Get "class" }} {{ . }}{{ end }}"><a href="{{ $destination | safeURL }}">
|
||||
{{- template "book-card-content" $ -}}
|
||||
</a></div>
|
||||
{{- else -}}
|
||||
<div class="book-card{{ with .Get "class" }} {{ . }}{{ end }}">
|
||||
{{- template "book-card-content" $ -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- define "book-card-content" -}}
|
||||
{{- with .Get "image" -}}
|
||||
{{- $destination := partial "docs/links/portable-image" (dict "Page" $.Page "Destination" .) -}}
|
||||
<img src="{{ $destination | safeURL }}" alt="{{ partial "docs/text/i18n" ($.Get "alt" ) }}" />
|
||||
{{- end -}}
|
||||
<div class="markdown-inner">
|
||||
{{ with .Inner }}{{ . }}{{ end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user