page layouts Jekyll's blog
12 Apr 2020 - Kovacs J Giulia
Layouts are templates that wrap around your content. They live in a directory called _layouts
in the root.
These layouts would be override the Minima-theme layouts.
Create your first layout at _layouts/default.html
with the following content:
---
layout: default # we get Minima's default
---
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{ page.title } }</title>
</head>
<body>
{{ content } }
</body>
</html>
Reused from Minima's „default” layout
K.i.s.s. & write:
---
layout: default # Minima
---
{{ content } }
To have index.html
use this layout, you can set a layout
variable in front matter. The layout wraps around the content of the page so all you need in index.html
is:
---
layout: mydefault
title: Home
---
<h1>{{ "k.i.s.s." | capitalize } }</h1>
<p>
Keep it simple stupid.
</p>
We have a reusable code yet. We are able to create a new about
file in the root directory with a few lines. The about.md
's code is:
---
layout: mydefault
title: About
---
# About page
This page tells you a little bit about me. They have a short text.
Amend you should upload to the github.
~/git/kissjgabiGIT/kiss$ git add .
~/git/kissjgabiGIT/kiss$ git commit -m "start github.com/kissjgabi/kiss intro"
~/git/kissjgabiGIT/kiss$ git push
Publish the repository on the GitHub Pages for free.
At least the website has been displayed at kissjgabi.github.io/kiss.