Deprecate built-in instagram shortcode?

Seeking opinions…

A few years ago it was simple to use the built-in instagram shortcode. Then Facebook changed the API, requiring anyone who wants to use the API to register their app or website, obtain approval, then generate an access token.

For both new and experienced Hugo users, this seems like it is more trouble than it is worth. Unlike other built-in shortcodes, this doesn’t work out-of-the-box.

For a site where content authors are trusted, I’d rather just copy/paste the embed code available when viewing an Instagram post.

It certainly doesn’t hurt to keep the shortcode in place, but… yuck.

Here are WP instructions for reference—walks you through the process:
https://docs.oceanwp.org/article/487-how-to-get-instagram-access-token

I’ve updated the documentation to reflect the requirements:
https://gohugo.io/content-management/shortcodes/#instagram

5 Likes

For a site where content authors are trusted, I’d rather just copy/paste the embed code available when viewing an Instagram post.

What kind of embed do you get with this? Do you see the actual image?

Looks like…

Because the embed code is a mouthful, I’d probably do something like:

content/
├── posts/
│   └── post-1/
│       ├── ig-001.html  <-- embed code copied from Instagram
│       ├── ig-002.html  <-- embed code copied from Instagram
│       └── index.md
└── _index.md

markdown

{{< instagram "ig-001.html" >}}

{{< instagram "ig-002.html" >}}

layouts/shortcodes/instagram.html

{{ with .Page.Resources.Get (.Get 0) }}
  {{ .Content | safeHTML }}
{{ end }}

Please note: when you copy the embed code…

image

You are agreeing to this:
https://developers.facebook.com/terms

1 Like

And I guess the terms say that you’re not allowed to use the instagram.com/embed.js with your own markup?

Requires legal counsel… I’m the wrong guy.

But I suspect, if they wanted to, Facebook as plaintiff could make a case to prevent such use.

The license for instagram.com/embed.js states:

in connection with the web services and APIs provided by Facebook

And the “web services and APIs” have their own terms and conditions. Which may bring us back to:
https://developers.facebook.com/docs/features-reference/oembed-read

But like I said, I’m the wrong guy.

1 Like

So, I agree that we do not want to maintain the instagram shortcode in its current form.

But I find it a little surprising if Facebook/YouTube does not allow us to somehow create a template for this markup. Just tested this, and it works fine:

I will try to look around at what “others” are doing.

1 Like