Skip to content

Commit fce5728

Browse files
committed
layout logic bug fixes
1 parent 7c53411 commit fce5728

File tree

6 files changed

+31
-45
lines changed

6 files changed

+31
-45
lines changed

_includes/header.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{% assign icon_color = "#24292e" %}
55
{% endif %}
66

7+
{% assign content = page.content | strip_newlines %}
8+
79
{% assign posts_total = site.posts | size %}
810

911
{% assign user = site.github.owner %}

_layouts/sidebar.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,29 @@ <h1 class="{% if site.style == 'dark' %}text-white{% endif %} mb-2 lh-condensed"
3939
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7">
4040
<div class="mx-auto" style="max-width: 900px;">
4141

42-
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
43-
{% if page.is_post %}
44-
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %}">
45-
<p class="f5"><a href="/" class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %}">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</a></p>
46-
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
47-
<p class="mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
42+
{% unless content == "" %}
43+
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
44+
{% if page.is_post %}
45+
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %}">
46+
<p class="f5"><a href="/" class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %}">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</a></p>
47+
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
48+
<p class="mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
49+
{{ content }}
50+
</div>
51+
{% else %}
4852
{{ content }}
49-
</div>
50-
{% else %}
51-
{{ content }}
52-
{% endif %}
53-
</div>
53+
{% endif %}
54+
</div>
55+
{% endunless %}
5456

5557
{% unless page.is_post %}
5658
{% include projects.html %}
5759

58-
{% include interests.html %}
60+
{% if site.topics %}
61+
{% include interests.html %}
62+
{% endif %}
5963

60-
{% unless post_size == 0 %}
64+
{% unless posts_total == 0 %}
6165
{% include thoughts.html %}
6266
{% endunless %}
6367
{% endunless %}

_layouts/stacked.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ <h1 class="f00-light lh-condensed">{{ page.title }}</h1>
5151
{% include projects.html %}
5252
</div>
5353

54-
<div class="my-6">
55-
{% include interests.html %}
56-
</div>
54+
{% if site.topics %}
55+
<div class="my-6">
56+
{% include interests.html %}
57+
</div>
58+
{% endif %}
5759

58-
{% unless post_size == 0 %}
60+
{% unless posts_total == 0 %}
5961
<div class="my-6">
6062
{% include thoughts.html %}
6163
</div>

_posts/2019-01-29-hello-world.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Welcome to Jekyll!"
3+
published: false
34
---
45

56
**Hello world**, this is my first Jekyll blog post.

_site/index.html

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55

66

7+
8+
79
<!doctype html>
810
<html>
911
<head>
@@ -44,12 +46,7 @@ <h1 class=" mb-2 lh-condensed">Sophie Shepherd</h1>
4446
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7">
4547
<div class="mx-auto" style="max-width: 900px;">
4648

47-
<div class="f4 mb-6">
48-
49-
I have stuff to say here.
50-
51-
52-
</div>
49+
5350

5451

5552
<h2 >My Projects</h2>
@@ -171,7 +168,8 @@ <h1 class="f4 lh-condensed mb-1">
171168
</div>
172169

173170

174-
<h2 >My Interests</h2>
171+
172+
<h2 >My Interests</h2>
175173
<p class="f4 mb-4 text-gray">Topics that I want to learn more about.</p>
176174
<div class="d-flex flex-wrap gutter-condensed mb-4">
177175

@@ -221,27 +219,7 @@ <h2 >My Interests</h2>
221219

222220
</div>
223221

224-
225222

226-
<h2 >My Thoughts</h2>
227-
<p class="f4 mb-4 text-gray">Articles I've written.</p>
228-
<div class="d-sm-flex flex-wrap gutter-condensed mb-4">
229-
230-
<div class="col-sm-6 col-md-12 col-lg-6 col-xl-4 mb-3">
231-
<div class="height-full text-left border border-gray-light bg-white rounded-1 p-3">
232-
<div class="d-flex flex-justify-between flex-items-start mb-1">
233-
<h1 class="f4 lh-condensed mb-1">
234-
<a href="/2019/01/29/hello-world/">
235-
Welcome to Jekyll!
236-
</a>
237-
</h1>
238-
</div>
239-
<div class="text-gray mb-2 ws-normal">Jan 29, 2019</div>
240-
</div>
241-
242-
</div>
243-
244-
</div>
245223

246224

247225

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22
layout: sidebar
33
---
4-
I have stuff to say here.

0 commit comments

Comments
 (0)