From 3663ba897a56fa372afd3f4724d61eb8fb5a8af9 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 23 Mar 2016 12:56:23 -0400 Subject: [PATCH] Create includes for greater layout flexibility --- _includes/archive-single.html | 2 +- _includes/page__hero.html | 12 ++++ _includes/sidebar.html | 20 +++++++ _layouts/archive.html | 20 +++++-- _layouts/default.html | 41 +------------ _layouts/single.html | 106 +++++++++++++++++----------------- 6 files changed, 104 insertions(+), 97 deletions(-) create mode 100644 _includes/page__hero.html create mode 100644 _includes/sidebar.html diff --git a/_includes/archive-single.html b/_includes/archive-single.html index 258db9ff..94687910 100644 --- a/_includes/archive-single.html +++ b/_includes/archive-single.html @@ -22,7 +22,7 @@ alt="{{ page.title }}"> {% endif %} -

{% if post.id %}{{ post.title | markdownify | remove: "

" | remove: "

" }}{% else %}{{ post.title }}{% endif %}

+

{% if post.id %}{{ post.title | markdownify | remove: "

" | remove: "

" }}{% else %}{{ post.title }}{% endif %}{% if post.link %}{% endif %}

{% if site.read_time and post.read_time %}

{% include read-time.html %}

{% endif %} {% if post.excerpt %}

{{ post.excerpt | markdownify | strip_html | truncate: 160 }}

{% endif %} diff --git a/_includes/page__hero.html b/_includes/page__hero.html new file mode 100644 index 00000000..4a325e4e --- /dev/null +++ b/_includes/page__hero.html @@ -0,0 +1,12 @@ +
+ {{ page.title }} + {% if page.header.caption %} + {{ page.header.caption | markdownify | remove: "

" | remove: "

" }}
+ {% endif %} +
\ No newline at end of file diff --git a/_includes/sidebar.html b/_includes/sidebar.html new file mode 100644 index 00000000..c447a69d --- /dev/null +++ b/_includes/sidebar.html @@ -0,0 +1,20 @@ +{% if page.author_profile or page.sidebar %} + +{% endif %} \ No newline at end of file diff --git a/_layouts/archive.html b/_layouts/archive.html index 959cb6a4..e37bfb2e 100644 --- a/_layouts/archive.html +++ b/_layouts/archive.html @@ -2,7 +2,19 @@ layout: default --- -
-

{{ page.title }}

- {{ content }} -
\ No newline at end of file +{% if page.header.image %} + {% include page__hero.html %} +{% endif %} + +{% if page.url != "/" and site.breadcrumbs and site.categories.type == "jekyll-archives" %} + {% include breadcrumbs.html %} +{% endif %} + +
+ {% include sidebar.html %} + +
+

{{ page.title }}

+ {{ content }} +
+
\ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index 9891b730..1fe162d9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -16,46 +16,7 @@ layout: compress {% include browser-upgrade.html %} {% include masthead.html %} - {% if page.header.image %} -
- {{ page.title }} - {% if page.header.caption %} - {{ page.header.caption | markdownify | remove: "

" | remove: "

" }}
- {% endif %} -
- {% endif %} - - {% if page.url != "/" and site.breadcrumbs and site.categories.type == "jekyll-archives" %} - {% include breadcrumbs.html %} - {% endif %} - -
- {% if page.author_profile or page.sidebar %}{% endif %} - {{ content }} -
+ {{ content }} \ No newline at end of file