Creating a new post
Run the ./scripts/newpost script with the file name of the post as an argument:
cd <your { Personal } repo>
./scripts/newpost hello-world
A a new post template with name YYYY-MM-DD-hello-world.md will be created under ./_posts, with the current date.
In the created post, just replace the Title, Category and tags and you can start writing your post in markdown right bellow the end of the post header.
Every file with the format YYYY-MM-DD-post-title.md will be processed as a post, with publication date YYYY-MM-DD.
The content starts with:
---
layout: post
section-type: post
title: Title
category: Category
tags: [ 'tag1', 'tag2' ]
---
The layout and section-type variables are used by the theme and you shouldn’t remove them.
Hashtags
Jekyll generates a static pages. As a result we have to create the tag pages before building and publishing the site. In order to generate the tag pages, simply run the generate-tags script from the repo’s root directory:
./scripts/generate-tags
The script will parse all your posts, and generate the tag pages for the newly added tags.
If you are not using GitHub Pages, you can automate the execution of this script during build time.
Categories
You can organize your posts under categories. Categories are behaving like hashtags, they have to be generated offline, by running the ./scripts/generate-categories script.
The category of the post is specified in the yaml header, in the Category variable.
NB! Only one category can be defined per post.
Syntax highlighting
If you want to demonstrate source code in your posts, syntax highlighting is provided. If you want to see how to render your code with the highlight, simply check the source code of this tutorial post
int main()
{
printf("Hello, world of syntax highlighting!");
return 0;
}
If you don’t need syntax highlight in your website you can disable it by setting the syntax-highlight variable to False
Emoji support
You can add emojis to your posts by simply typing their emoji code
Author Blurb
You can add a short description of yourself bellow your posts, by setting the next two variables in the site config
################
# Author Blurb #
################
# The author blurb goes underneath blog posts.
# This works best when your author blurb image has a transparent background, or matches your site background color.
# if the author_blurb is not set, then this feature is skipped
author_blurb: "John Smith is an awesome person. He lives in Flatland, where he works on two-dimensional engineering projects. In his spare time, John likes to eat cotton candy."
author_blurb_image: "/img/author.png"
Comments
Unfortunately the comments have been turned off but dont worry they will be back soon.
Reply