mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-30 01:06:00 -04:00
clean up shortcodes
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
<div class="embed {{ .Name }}">
|
||||
<iframe src="{{ .Get "src" }}"{{ with .Get "title" }} title="{{ . }}"{{ end }}{{ with .Get "sandbox" }} sandbox="{{ . }}"{{ end }}></iframe>
|
||||
<iframe
|
||||
src="{{ .Get "src" }}"
|
||||
{{ with .Get "title" }}
|
||||
title="{{ . }}"
|
||||
{{ end }}
|
||||
{{ with .Get "sandbox" }}
|
||||
sandbox="{{ . }}"
|
||||
{{ end }}>
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
{{- with .Inner }}
|
||||
alt="{{ . | $.Page.RenderString | plainify | safeHTML }}"
|
||||
{{- else }}
|
||||
{{ with .Get "alt" }} alt="{{ . | safeHTML }}"{{ end }}
|
||||
{{ with .Get "alt" }}
|
||||
alt="{{ . | safeHTML }}"
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
>
|
||||
/>
|
||||
{{ if .Get "link" }}</a>{{ end }}
|
||||
|
||||
{{ with .Inner -}}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
{{- $optimized := partial "functions/optimize-image" . -}}
|
||||
|
||||
<p align="center">
|
||||
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
|
||||
<img src="{{ print .Site.Params.baseUrl $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
|
||||
{{- with .Get "alt" }} alt="{{ . | safeHTML }}"{{ end }}
|
||||
{{- with .Inner }} alt="{{ . | $.Page.RenderString | plainify | safeHTML }}"{{ end }}>
|
||||
{{ if .Get "link" }}</a>{{ end }}
|
||||
{{ with .Inner }}<br>{{ . | $.Page.RenderString | safeHTML }}{{ end -}}
|
||||
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
|
||||
<img src="{{ print .Site.Params.baseUrl $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
|
||||
{{- with .Inner }}
|
||||
alt="{{ . | $.Page.RenderString | plainify | safeHTML }}"
|
||||
{{- else }}
|
||||
{{ with .Get "alt" }}
|
||||
alt="{{ . | safeHTML }}"
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
/>
|
||||
{{ if .Get "link" }}</a>{{ end }}
|
||||
|
||||
{{ with .Inner }}<br>{{ . | $.Page.RenderString | safeHTML }}{{ end -}}
|
||||
</p>
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
</div>
|
||||
|
||||
{{- define "__shortcode_instagram_js" }}
|
||||
<script async src="https://www.instagram.com/embed.js"></script>
|
||||
<script async defer src="https://www.instagram.com/embed.js"></script>
|
||||
{{- end }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&align=center&url=%s" (index .Params 0 | safeURL) -}}
|
||||
{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&url=%s" (index .Params 0 | safeURL) -}}
|
||||
{{- $json := getJSON $url -}}
|
||||
|
||||
<div class="embed {{ .Name }}">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&align=center&url=%s" (index .Params 0 | safeURL) -}}
|
||||
{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&url=%s" (index .Params 0 | safeURL) -}}
|
||||
{{- $json := getJSON $url -}}
|
||||
|
||||
{{ $json.html | safeHTML }}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<div class="embed {{ .Name }}" style="padding:75% 0 0 0;position:relative;">
|
||||
<iframe src="https://player.vimeo.com/video/{{ .Get "id" }}&dnt=1" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" allow="fullscreen" allowfullscreen></iframe>
|
||||
<div class="embed {{ .Name }}">
|
||||
<iframe
|
||||
class="vimeo-player"
|
||||
src="https://player.vimeo.com/video/{{ .Get "id" }}&dnt=1"
|
||||
allow="fullscreen"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
{{- define "__shortcode_vimeo_js" }}
|
||||
<script src="https://player.vimeo.com/api/player.js"></script>
|
||||
<script async defer src="https://player.vimeo.com/api/player.js"></script>
|
||||
{{ end }}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<iframe
|
||||
class="youtube-player"
|
||||
src="https://www.youtube-nocookie.com/embed/{{ index .Params 0 }}?autoplay=0&hl=en&fs=1&showinfo=1&rel=0&iv_load_policy=3"
|
||||
allow="fullscreen"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user