Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to embed github file to a github pages blog post

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.

like image 279
John Avatar asked Jun 02 '16 07:06

John


1 Answers

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.

like image 82
ajsalkeld Avatar answered Nov 11 '22 16:11

ajsalkeld