I am creating a blog using github pages and jekyll. I wonder if there is a way to embed code snippets from a github file (i.e., a file in a repo) in a blog post. I can find a solution on this page about embedding gists: https://gist.github.com/benbalter/5555251.
No direct solution for github files, though.
Jekyll has a pretty nifty syntax-highlighting system (provides _sass/sytax-highlighting.scss
is present and correct), so it would be possible to just copy the code over into a blogpost, using `s to wrap the code.
As per actually embedding from a Github repo, there is a pretty nifty project here, if you want to check it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With