{{- $pc := .Page.Site.Config.Privacy.Instagram -}} {{- $sc := .Page.Site.Config.Services.Instagram -}} {{- if not $pc.Disable -}} {{- $id := .Get 0 -}} {{- $item := getJSON "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/" $id "/&maxwidth=640&omitscript=true" -}} {{- $class1 := "__h_instagram" -}} {{- $class2 := "s_instagram_simple" -}} {{- $hideCaption := (eq (.Get 1) "hidecaption") -}} {{ with $item }} {{- $mediaURL := printf "https://instagram.com/p/%s/" $id | safeURL -}} {{- if not $sc.DisableInlineCSS -}} {{ template "__h_simple_instagram_css" $ }} {{- end -}}
{{ $item.author_name }}
Instagram Image
{{ if not $hideCaption }}

{{ $item.author_name }} {{ $item.title}}

{{ end }} View More on Instagram
{{ end }} {{- end -}} {{ define "__h_simple_instagram_css" }} {{ if not (.Page.Scratch.Get "__h_simple_instagram_css") }} {{/* Only include once */}} {{ .Page.Scratch.Set "__h_simple_instagram_css" true }} {{ end }} {{ end }}{{- $pc := .Page.Site.Config.Privacy.Instagram -}} {{- if not $pc.Disable -}} {{- if $pc.Simple -}} {{ template "_internal/shortcodes/instagram_simple.html" . }} {{- else -}} {{ $id := .Get 0 }} {{ $hideCaption := cond (eq (.Get 1) "hidecaption") "1" "0" }} {{ with getJSON "https://api.instagram.com/oembed/?url=https://instagram.com/p/" $id "/&hidecaption=" $hideCaption }}{{ .html | safeHTML }}{{ end }} {{- end -}} {{- end -}}