My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Support for embedding only one file from a gist

Dhruv Saraiya
·Aug 10, 2021·

1 min read

Right now you can embed the gist by % followed by [] having the link to your gist, which includes all the files from that gist.

If you want to only add some files from that gist, you have to do it by adding ?file=index.js to the link. That seems to not work in hashnode, as the API response automatically adds .js at the end of generated URL in script tag

e.g.

This is snippet from my draft article image.png

Response from first embed image.png

Response from second embed image.png