I am using Github pages and jekyll to write a scientific tutorial, with code that is also hosted on Github. In my Github repo I have a “codes” folder and a “docs” folder. The former hosts the code, the latter hosts my jekyll website, as recommended on GitHub and Jekyll websites.
In my tutorial I want to discuss/display code that is hosted on the GitHub repo, under “codes”, and I would like to avoid copy/pasting code from the repo to the page. I think it would be much easier to link directly to one of the files in the Github repo.
Is there a way to do this automatically, so that if I change any of the files in “codes”, the changes will be reflected in the Jekyll website?
I know that there exists a Jekyll-gist plugin, but I don’t think I am allowed to use it on GitHub pages. Also I don’t know if this requires me to setup another layer (“a gist”) for each file I want to link to.
Do you know if this can be done at all?