Adds in basic page layouts and includes for pages, posts and a front blog

This commit is contained in:
David Darnes 2016-06-15 01:28:56 +01:00
parent 99c790e68f
commit 522d13352b
10 changed files with 161 additions and 7 deletions

18
_includes/favicons.html Normal file
View File

@ -0,0 +1,18 @@
<link rel="apple-touch-icon" sizes="57x57" href="{{ site.logo | replace: "300", "57" }}">
<link rel="apple-touch-icon" sizes="60x60" href="{{ site.logo | replace: "300", "60" }}">
<link rel="apple-touch-icon" sizes="72x72" href="{{ site.logo | replace: "300", "72" }}">
<link rel="apple-touch-icon" sizes="76x76" href="{{ site.logo | replace: "300", "76" }}">
<link rel="apple-touch-icon" sizes="114x114" href="{{ site.logo | replace: "300", "114" }}">
<link rel="apple-touch-icon" sizes="120x120" href="{{ site.logo | replace: "300", "120" }}">
<link rel="apple-touch-icon" sizes="144x144" href="{{ site.logo | replace: "300", "144" }}">
<link rel="apple-touch-icon" sizes="152x152" href="{{ site.logo | replace: "300", "152" }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.logo | replace: "300", "180" }}">
<link rel="icon" type="image/png" href="{{ site.logo | replace: "300", "32" }}" sizes="32x32">
<link rel="icon" type="image/png" href="{{ site.logo | replace: "300", "194" }}" sizes="194x194">
<link rel="icon" type="image/png" href="{{ site.logo | replace: "300", "96" }}" sizes="96x96">
<link rel="icon" type="image/png" href="{{ site.logo | replace: "300", "192" }}" sizes="192x192">
<link rel="icon" type="image/png" href="{{ site.logo | replace: "300", "16" }}" sizes="16x16">
<link rel="shortcut icon" href="{{ site.logo }}">
<meta name="msapplication-TileColor" content="{{ site.color }}">
<meta name="msapplication-TileImage" content="{{ site.logo | replace: "300", "144" }}">
<meta name="theme-color" content="{{ site.color }}">

9
_includes/footer.html Normal file
View File

@ -0,0 +1,9 @@
<footer class="footer">
<div class="container">
<small class="small">&copy; {{ site.time | date: '%Y' }} — {{ site.title }}</small>
</div>
</footer>

15
_includes/header.html Normal file
View File

@ -0,0 +1,15 @@
<header class="header">
<a href="{{ page.url }}" title="{{ page.title }}">
<img class="avatar" src="{{ site.logo | replace: "300", "72" }}" alt="{{ site.title }}" srcset="{{ site.logo | replace: "300", "72" }} 72w, {{ site.logo | replace: "300", "144" }} 144w">
</a>
<div class="container">
<h1>{{ page.title }}</h1>
</div>
</header>

17
_includes/pagination.html Normal file
View File

@ -0,0 +1,17 @@
<aside class="container">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="pagination pagination--previous">&larr; Previous</a>
{% else %}
<span class="pagination pagination--previous">&larr; Previous</span>
{% endif %}
<span class="pagination pagination--divider">&bull;</span>
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="pagination pagination--next">Next &rarr;</a>
{% else %}
<span class="pagination pagination--next">Next &rarr;</span>
{% endif %}
</aside>

22
_includes/posts.html Normal file
View File

@ -0,0 +1,22 @@
<ul class="posts">
{% for item in paginator.posts %}
<li class="post">
<article class="container">
<h2>
<a href="{{ item.url }}" title="{{ item.title }}">{{ item.title }}</a>
</h2>
<small class="small">
<time datetime="{{ item.date | date_to_xmlschema }}" class="time">{{ item.date | date_to_string }}</time>
</small>
{{ item.excerpt | markdownify }}
</article>
</li>
{% endfor %}
</ul>

View File

@ -1,8 +1,21 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./css/styles.css">
</head>
<html>
<h1>Hello world</h1>
{{ content }}
<html lang="en-GB">
<head>
<!-- General meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% seo %}
{% if site.logo %}
{% include favicons.html %}
{% endif %}
<link href="/css/styles.css" media="all" rel="stylesheet" type="text/css">
</head>
<body>
{{ content }}
</body>
</html>

21
_layouts/front.html Normal file
View File

@ -0,0 +1,21 @@
---
layout: default
---
<main class="container">
{% include header.html %}
<article class="content">
{{ content }}
</article>
{% include posts.html %}
{% include pagination.html %}
{% include footer.html %}
</main>

17
_layouts/page.html Normal file
View File

@ -0,0 +1,17 @@
---
layout: default
---
<main class="container">
{% include header.html %}
<article class="content">
{{ content }}
</article>
{% include footer.html %}
</main>

22
_layouts/post.html Normal file
View File

@ -0,0 +1,22 @@
---
layout: default
---
<main class="container">
{% include header.html %}
<article class="content">
<small class="small">
{% assign words = content | number_of_words %}
<time datetime="{{ page.date | date_to_xmlschema }}" class="time">{{ page.date | date_to_string }}</time>&nbsp;&nbsp;&nbsp;&nbsp;<span class="time time--reading">{{ words | divided_by:180 }} minute read</span>
</small>
{{ content }}
</article>
{% include footer.html %}
</main>

View File

@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'garth-jekyll-theme'
s.version = '0.1.5'
s.version = '0.1.6'
s.license = 'MIT'
s.summary = 'An experimental theme for Jekyll'
s.description = 'An experimental theme for Jekyll, just to test this out'