Hugo Instagram shortcode is broken
I’ve been using Hugo since 2016 to build this website. Some pages containInstagram shortcode . Today they are broken 💔
Lets fix it!
A quick search on Git issues shows #7879 :
Basically Facebook has ended free access to the Instagram API. This affects both the regular and simple Instagram shortcodes.
The announcement of Facebook is HERE .
The problem should be fixed in the next release of Hugo .
Remediation
As temporary remediation I will comment out all the references to Instagram shortcode so I can build my website and publish updates.
The change affects 12 links in total, you can tell I’m not a heavy Instagram user .
Some posts will lose some content, the impact shouldn’t be significant based on the metrics of this website 😢
Original line (with additional spaces between {{ and }} to avoid unwanted rendering):
{ { < instagram 12345678901 >} }
commented line (with additional spaces between {{ and }} to avoid unwanted rendering):
<!-- { {< instagram 12345678901 >} } -->
Sed command to get this result:
sed -i 's/{.*{< instagram\(.*\)>}.*}/<!-- -->/g' *.md
Great!
Lesson learned
- Relaying on other product’s API means being dependent on them (obvisous but easy to forget)
- My previous blog about sed was really helpful to apply the remediation in minutes instead of hours digging in the documentation of sed
- In case of doubt, blog it!