Writing new blog on Jekyll
Written by Ilkka TengvallI was asked how to write a new blog into our Jekyll. It’s really straight forward. Here’s list of steps you need to do.
- Clone this repository:
git clone git@github.com:RedHatNordicsSA/RedHatNordicsSA.github.io.git
- Make sure you have Jekyll installed, instructions for RHEL
- If on RHEL, enter software channel:
scl enable rh-ruby23 bash
- Edit your blog in _posts directory, create new file with name:
YYYY-MM-DD-topic.markdown.
e.g.
atom _posts/2019-02-18-new-post.markdown
- Add header to post, like in this topic:
--- layout: post title: "Writing new blog on Jekyll" date: 2019-02-18 15:20:00 +0200 tags: jekyll author: ikke ---
- Start writing using markdown language. If you want to attach e.g pictures, add them to assets/images -directory. We use Hacker theme for now, see their example here.
- Once done, make sure the date and time in header is passed, or drop the post into _drafts folder. Jekyll uses the time to publish blog only after given time.
- Try locally by starting local Jekyll server in repository directory
(bundle install is here just in case you skipped something):
bundle install jekyll serve
Now you can browse to http://localhost:4000 to review your blog. If you dropped the blog into _drafts/, add
--drafts
to command. - Once happy, do
git status
to verify no junk is added, and dogit add
for added files, andgit commit
andgit push
- After few seconds, your blog should be visible at site blog list.
For reference, see this blog markdown file.
Happy Writing!
BR,
ikke
I work as an SA at Red Hat Nordics, mainly with speeding things up using automation and hybrid cloud.
tags: random