Blog about engineering and product at HackerEarth. Visit engineering.hackerearth.com.
Introduction:
We write engineering blog posts whenever we build something cool, which is always. So every now and then we'll be writing engineering & news blog posts.
Setup:
Both Engineering blog and news blog have the same setup instructions. Please follow steps mentioned below to setup news blog locally:
-
Make sure you have access to respective repositories.
-
Clone the repository once you have access:
git clone https://github.com/HackerEarth/engineering.hackerearth.com.git
- As mentioned above we use Jekyll to power our news/engineering blog, install Jekyll using the following command:
sudo gem install jekyll
or
sudo apt install jekyll
- If you are unable to install jekyll, install rouge first
sudo gem install rouge
- You may need to install kramdown also.
sudo gem install kramdown
- Start the server by executing:
jekyll serve # It will start the server on: http://127.0.0.1:4000
To start the server on different port execute:
jekyll serve --port=5001 # It will start the server on: http://127.0.0.1:5001
- Server should be running now so setup is complete.
Q. How to write a new post or edit existing ones?
Please follow the instructions mentioned below to get started with writing news/engineering posts.
-
I assume you have already cloned the respective repository, so navigate to that directory.
-
There are two main sub directories (
_posts
andimages
) that you will be altering generally while adding or editing posts. -
If you do not know how to write markdown please learn: [[ http://markdown-guide.readthedocs.io/en/latest/basics.html | Markdown Basics ]]. This covers almost everything to write a beautiful news post.
-
All markdown content (posts) goes to
_posts
directory and images goes toimages
. //Please check out how other posts have been written//. -
The name of markdown file starts with date. For example: For [[ http://news.hackerearth.com/2016/02/08/filter-candidates-easily-in-reports/ | this post ]] the filename is:
2016-02-08-filter-candidates-easily-in-reports.md
. -
If you have already added your content to
_posts/
named as2016-05-26-demo-news-post.md
, it will be accessible on:http://127.0.0.1:4000/2016/05/26/demo-news-post/
.(No need to restart your server, just refresh your browser.)
Important Notes:
-
Please make sure your news post is successfully rendering on your local before pushing it to master.
-
Add as many images or/and videos possible to explain your content.
-
Proof read your content again, you can take help from your peers.