refactor: new version of lorem

fix: change image parameters to width and padding
master
Kebler Network System Administrator 2021-11-24 09:34:40 -08:00
parent f6217a6abc
commit 1ad4d928af
2 changed files with 20 additions and 17 deletions

View File

@ -5,17 +5,21 @@
{{ with .Get "style"}} box--image-{{ . }}{{ end }} {{ with .Get "style"}} box--image-{{ . }}{{ end }}
{{ with .Get "link"}}{{ if eq . "lightbox" }} box--image-lightbox{{ end }}{{ end }} {{ with .Get "link"}}{{ if eq . "lightbox" }} box--image-lightbox{{ end }}{{ end }}
" "
{{ with .Get "maxwidth"}} maxWidth="{{ . }}"{{ end }} style="
{{ with .Get "wpad"}} wPad="{{ . }}"{{ end }} {{ with .Get "width"}} width:{{ . }};{{ end }}
{{ with .Get "pad"}} padding:{{ . }}{{ end }}
"
> >
{{ with .Get "title" }} {{ with .Get "title" }}<div class="box__title">{{ . }}</div>{{ end }}
<div class="box__title">{{ . }}</div> <a href="{{ if .Get "link" }}{{ .Get "link" }}{{ else }}{{ $path }}{{ $filename }}{{ end }}" target="_blank" >
{{ end }} <img
{{ with .Get "link"}} style="
{{ if eq . "lightbox" }}<a href="{{ $path }}{{ $filename }}">{{ else }}<a href="{{.}}" target="_blank" >{{ end }} {{ with .Get "width"}} width={{ . }};{{ end }}
{{ end }} {{ with .Get "pad"}} padding={{ . }}{{ end }}
<img src="{{ $path }}{{ .Get "filename" }}" /> "
{{ if .Get "link"}}</a>{{ end }}
src="{{ $path }}{{ .Get "filename" }}" />
</a>
{{ with .Get "caption"}} {{ with .Get "caption"}}
<div class="box__caption">{{ . }}</div> <div class="box__caption">{{ . }}</div>
{{ end }} {{ end }}

View File

@ -1,7 +1,6 @@
<!-- https://github.com/f/loremjs {{/* parameter is number of paragraphs */}}
shorcode parameter {{ $lorem := "<p><em>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan rutrum consectetur. Vivamus eu ex quis leo posuere convallis. Nunc laoreet velit sed ullamcorper mollis. Mauris porta consequat tortor aliquet maximus. Quisque sed purus condimentum orci sodales aliquam non vel tellus. Praesent lorem arcu, scelerisque a semper at, iaculis eget purus. Etiam ullamcorper orci a porttitor sodales. Nullam tincidunt nibh et hendrerit auctor. Quisque vitae quam ut lorem vehicula condimentum. In commodo cursus elit, non volutpat lectus sagittis non.</em></p>" }}
2p = 2 paragraphs
5s = 5 sentences {{ range seq (.Get 0 | default "2") }}
6w = 6 words {{ $lorem | safeHTML }}
1-6w = between 1 and 6 words --> {{ end }}
<div data-lorem={{ .Get 0 | default "2p" }}></div>