Skip to content

Commit 84032ee

Browse files
author
vishalvivekm
committed
add required shortcodes
Signed-off-by: vishalvivekm <110674407+vishalvivekm@users.noreply.github.com>
1 parent 00c4a19 commit 84032ee

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ $style := .Get "style" | default "" }}
2+
<div class="chapter-content"{{ with $style }} style="{{ . }}"{{ end }}>
3+
{{ .Inner | markdownify }}
4+
</div>

layouts/shortcodes/image.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ $src := .Get "src" }}
2+
{{ $width := .Get "width" | default "100%" }}
3+
{{ $align := .Get "align" | default "center" }}
4+
{{ $alt := .Get "alt" | default "" }}
5+
{{ $title := .Get "title" | default "" }}
6+
7+
<div class="image-container" style="text-align: {{ $align }}; margin: 1rem 0;">
8+
<img src="{{ $src | safeURL }}" alt="{{ $alt }}" {{ with $title }}title="{{ . }}"{{ end }} style="width: {{ $width }}; max-width: 100%; height: auto; border-radius: 0.5rem; box-shadow: 0 0 0.5rem rgba(0, 179, 159, 0.4);" data-modal="true" onclick="openModal(this)" />
9+
{{ with $title }}<p style="text-align: center; margin-top: 0.5rem;">{{ . }}</p>{{ end }}
10+
</div>

0 commit comments

Comments
 (0)