Tips and tricks
The next tip is to use some advanced techniques that use the GitHub API.
Making use of Github Pages' metadata with Jekyll
GitHub provides some metadata when using Jekyll for GitHub Pages. This means that you can add certain keywords in the Jekyll templates and these will be rendered automatically.
For example, you could add the {{ site.github.project_title }}
variable, and the project title would be filled by GitHub automatically.
Following the example in the Introduction to Jekyll section of this chapter, we will add a new post to the Jekyll site.
Firstly, head over to the repository directory and make sure you are in the master
branch and up to date:
git checkout master git pull origin master
Next, copy the default post to have it as a reference (the dates in your site will differ):
cp _posts/2018-06-02-welcome-to-jekyll.markdown _posts/2018-06-02-testing-github-metadata-with-jekyll.markdown
Then, open the new file and remove all content except for the following:
--- layout: post...