This repository is the starter blog project to be turned into a full-fledged blog using Jekyll.
By following the below instructions, you should produce a product very similar to my finished product found here:
https://github.com/JacobHelton57/Jekyll-Blog-Undiscovered
Before following these instructions, you will need to install the Jekyll Gem. This process should be pretty straight forward.
We'll be following along with the instructions below during the actual Undiscovered Session.
_config.yml
in root directory:markdown: kramdown
baseurl: /zen-habits
permalink: pretty
exclude: ['README.md']
_includes
folder in root_layouts
folder in rootdefault.html
layout to _layouts
index.html
into default.html
.home-page
fromdefault.html
and paste in index.html
in place of everything elsedefault.html
with {{content}}
taglayout:default
to index.html's front matterCreate nav.html
file in _includes
directory
Move the navbar section to nav.html
Insert {% include nav.html %}
in default template where nav code was
Use {{site.baseurl}}/
in hrefs
Logic for active url
{% if page.url == '/' %}active{%endif%}
Do the same thing for the about link using {{site.baseurl}}/about/
paginator.html
into _includes
index.html
paginate: 3
posts
directory name to _posts
{% for post in paginator.posts%}
and {% endfor %}
default.html
, fix stylesheet and favicon links using {{site.baseurl}}
{{post.title}}
and {{post.excerpt}}
to .title
and .text
fields{{site.baseurl}}/img/{{post.thumbnail}}
{{post.date | date: "%b %d, %Y"}}
{{post.author}}
{{site.baseurl}}{{ post.url }}
Add post.html
layout to _layouts
Instead of creating a new layout, we are extending the default layout
Copy .post
div from HTML sample post into post.html
Replace fields with {{page.title}}
, {{page.author}}
, and {{page.date | date: "%b %d, %Y"}}
tags
Replace img url with {{site.baseurl}}/img/{{page.banner_image}}
Add {{content}}
Make all posts use post layout by default
defaults:
-
scope:
path: ""
type: "pages"
values:
layout: "default"
-
scope:
path: ""
type: "posts"
values:
layout: "post"
category: "blog"
author: "Jacob Helton"
banner_image: "900x300.png"
thumbnail: "750x300.png"
sidebar.html
include file and add {% include sidebar.html %}
to default{% for post in site.posts limit:5 %}
& {% endfor %}
{{site.baseurl}}/{{post.url}}
, title for {{post.title}}
and date for {{post.date | date: "%b %d, %Y"}}
post
layoutAdd layout: post
to about.html
Create about.md
file
In front matter, add
---
layout: post
title: About Me
author: Mr. Miyagi
banner_image: miyagi.jpg
thumbnail: miyagi.jpg
---
Copy text over below front matter
Delete about.html
Refresh page