Steps to set up personal blog website in Github
Install Jekyll and related environments follow the instruction strictly here.
Before finally call build function of Jekyll, you should follow these steps to let it run successfully on Windows system.
-
Add your repository name with organization to your _config.yml, like: repository: henry/henrydf.github.io. See it from here
-
About “GitHub Metadata warning”, you should follow these steps as describe in this site:
2.1 GitHub Metadata is a gem required by Jekyll. We need a GitHub personal token to make it work. Follow the excellent guide on GitHub to create a token, copy it to a safe place. Now, create new environment variable in your system named
JEKYLL_GITHUB_TOKEN
with the value pasted from the created token.2.2 Now, down load the .pem file from here. Then, create another environment variable called
SSL_CERT_FILE
pointing to the location of downloaded .pem file.
You can also check this video out.
Create contents of the blog website
The Github pages blog system is heavily based on the Github repository. Any new posted posts should be placed in _posts folder, and give a specific file name date YYYY-MM-DD-name-of-post.markdown
.
Any posted articles will be automatically updated by Github pages after you push them to your Github repository.
Grab particular posts in the blog website
If you want to collect some particular posts in a page, code work wouldn’t be avoided. The code below will collect all posts have category type poem, and the post date will also be rendered:
<ul>
{% for post in site.posts %}
{% if post.categories contains 'poem' %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
<span>({{ post.date | date:"%Y-%m-%d" }})</span>
{{ post.excerpt }}
</li>
{% endif %}
{% endfor %}
</ul>
Keep update of the resource
You should always update functions to keep your Jekyll resources up to date.
If you followed our setup recommendations and installed Bundler, run bundle update github-pages
or simply bundle update
and all your gems will update to the latest versions.
If you don’t have Bundler installed, run gem update github-pages