Skip to content

Instantly share code, notes, and snippets.

View Agurato's full-sized avatar
🦕

Vincent Monot Agurato

🦕
View GitHub Profile
@Agurato
Agurato / expand.html
Created July 2, 2020 15:22
Hugo shortcode for expendable content
<span class="expand">
<span 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') ? '{{.Get 2 | default `fas fa-chevron-down`}}' : 'fas fa-{{.Get 1 | default `fas fa-chevron-right`}}';});});">
{{.Get 0}}
<i class="{{.Get 1 | default `fas fa-chevron-right`}}"></i>
</span>
<div class="expand-content" style="display: none; margin: 10px 0px 10px">
{{.Inner | safeHTML}}
</div>
</span>
@Agurato
Agurato / fa.html
Last active July 2, 2020 17:04
Font Awesome shortcode for Hugo websites
<i class="{{.Get 0}}"></i>