diff options
author | Somrat <58769763+tfsomrat@users.noreply.github.com> | 2022-03-23 07:13:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 07:13:52 +0300 |
commit | cce6f84a7ff0f552f72327e785cfe37430bc089c (patch) | |
tree | 6cd44e37f99fc7325a9102571d8c45ac75727dbe | |
parent | c001173e8118523d6dfb7fb7585a99d8690905bc (diff) | |
parent | 72261f0bf2efa48f4f5752bfe861f64dbd91b582 (diff) |
Merge pull request #34 from cedi/master
add expand shortcode
-rw-r--r-- | layouts/shortcodes/expand.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html new file mode 100644 index 0000000..0e7ddb1 --- /dev/null +++ b/layouts/shortcodes/expand.html @@ -0,0 +1,17 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +<div class="expand"> + <div class="expand-label" style="cursor: pointer;" onclick="$h = $(this);$h.next('div').slideToggle(100,function () {$h.children('i').attr('class',function () {return $h.next('div').is(':visible') ? 'fas fa-chevron-down' : 'fas fa-chevron-right';});});"> + <i style="font-size:x-small;" class="fas fa-chevron-right"></i> + <span> + {{$expandMessage := T "Expand-title"}} + {{ if .IsNamedParams }} + {{.Get "default" | default $expandMessage}} + {{else}} + {{.Get 0 | default $expandMessage}} + {{end}} + </span> + </div> + <div class="expand-content" style="display: none;"> + {{.Inner | safeHTML}} + </div> +</div>
\ No newline at end of file |