How to embed a github file in a github blog post

I am creating a blog using the github and jekyll pages. I wonder if there is a way to insert code snippets from a github file (i.e. File in repo) in a blog post. I can find a solution on this page about implementing gists: https://gist.github.com/benbalter/5555251 .

There is no direct solution for github files.

+7
github jekyll r-markdown
source share
1 answer

Jekyll has a pretty nice syntax highlighting system (provides _sass/sytax-highlighting.scss present and corrects), so you could just copy the code into your blog post using `s to wrap the code.

According to the actual implementation from the Github repository, there is a pretty nice project here if you want to check it out.

+2
source share

All Articles