I’ve found this nifty little tool that can embed codes directly from your GitHub repositories without using Gist. It’s very easy to use. For example, if you want to embed, say, this whole file, you only need to add this snippet somewhere in your post.md file.
?footer=minimal part is optional. It will look something like this:
It can also embed just a section of code based on line numbers. For example, to embed line 234 to line 257 of this file, this snippet will do.
It will look something like this:
Just note that the
slice= parameter is zero-based and GitHub’s line numbering starts at 1.
Finally, if you have an HTTPS blog, make sure to use
If you have any questions or feedback, please reach out @flowerinthenyt.