Skip to content

Instantly share code, notes, and snippets.

@hobelinm
Created August 17, 2020 03:05
Show Gist options
  • Select an option

  • Save hobelinm/667e929b1de8b57eabf360bb1781bb9d to your computer and use it in GitHub Desktop.

Select an option

Save hobelinm/667e929b1de8b57eabf360bb1781bb9d to your computer and use it in GitHub Desktop.
Shortcode that connects auto-instagram.ts library with Hugo framework posts
<script type="text/javascript">
//< autoinstagram "fromUrl" "Instagram-Auto-Embed" >
//< autoinstagram "123qwer" "Instagram-Auto-Embed" >
{{ if eq (.Get 0) "fromUrl" }}
if (window.AutoInstagram.Control.LoadFromParam() === '') {
// Loads error image
window.AutoInstagram.Control.QueryAndAddInstagramPost(
'CDqPPKxp1cT',
{{.Get 1}}
);
} else {
window.AutoInstagram.Control.QueryAndAddInstagramPost(
window.AutoInstagram.Control.LoadFromParam(),
{{.Get 1}}
);
}
{{ else }}
window.AutoInstagram.Control.QueryAndAddInstagramPost(
({{.Get 0}}),
({{.Get 1}})
);
{{ end }}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment