Skip to content

Commit 7c53411

Browse files
committed
sidebar blog permalink support
1 parent 7febc36 commit 7c53411

File tree

5 files changed

+61
-51
lines changed

5 files changed

+61
-51
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818
path: "" # an empty string here means all files in the project
1919
type: "posts"
2020
values:
21-
layout: "stacked"
21+
layout: "sidebar"
2222
is_post: true
2323

2424
topics:

_layouts/sidebar.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,28 @@ <h1 class="{% if site.style == 'dark' %}text-white{% endif %} mb-2 lh-condensed"
3838

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;">
41-
<div class="{% if site.style == 'dark' %}text-white{% endif %} mb-6">
42-
{{ content }}
41+
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>
48+
{{ content }}
49+
</div>
50+
{% else %}
51+
{{ content }}
52+
{% endif %}
4353
</div>
4454

45-
{% include projects.html %}
55+
{% unless page.is_post %}
56+
{% include projects.html %}
4657

47-
{% include interests.html %}
58+
{% include interests.html %}
4859

49-
{% unless post_size == 0 %}
50-
{% include thoughts.html %}
60+
{% unless post_size == 0 %}
61+
{% include thoughts.html %}
62+
{% endunless %}
5163
{% endunless %}
5264
</div>
5365
</div>

_layouts/stacked.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ <h1 class="{% if site.style == 'dark' %}text-white{% endif %} mb-2 lh-condensed"
3333
</div>
3434
{% endunless %}
3535

36-
<div {% if site.style == 'dark' %}class="text-white"{% endif %}>
37-
{% if page.is_post %}
38-
<div class="container-md f4 text-left border rounded-2 bg-white p-3 p-sm-5 mt-6">
39-
<p class="f5"><a href="/" class="d-flex flex-items-center">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:#0366d6 aria-label:Home %}Home</a></p>
40-
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
41-
<p class="{% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %} mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
42-
{{ content }}
43-
</div>
44-
{% else %}
36+
{% if page.is_post %}
37+
<div class="container-md f4 text-left border rounded-2 bg-white p-3 p-sm-5 mt-6">
38+
<p class="f5"><a href="/" class="d-flex flex-items-center">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:#0366d6 aria-label:Home %}Home</a></p>
39+
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
40+
<p class="mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
41+
{{ content }}
42+
</div>
43+
{% else %}
44+
<div {% if site.style == 'dark' %}class="text-white"{% endif %}>
4545
{{ content }}
46-
{% endif %}
47-
</div>
46+
</div>
47+
{% endif %}
4848

4949
{% unless page.is_post %}
5050
<div class="my-6">

_site/index.html

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,45 @@
1414
<body class="bg-gray-light" >
1515

1616

17-
<div class="container-lg py-6 p-responsive text-center">
18-
<img src="https://avatars3.githubusercontent.com/u/527589?v=4" class="circle mb-3" style="max-width: 150px;">
19-
<h1 class=" mb-2 lh-condensed">Sophie Shepherd</h1>
20-
<p class="col-lg-8 mx-auto mb-3 f3 text-gray">
21-
✏ Design manager at @github
22-
</p>
23-
17+
<div class="d-md-flex" style="height: 100vh">
18+
<div class="flex-self-stretch border-bottom border-md-none border-md-right border-gray-light bg-white col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
19+
<img src="https://avatars3.githubusercontent.com/u/527589?v=4" class="circle mb-3" style="max-width: 150px;">
20+
<h1 class=" mb-2 lh-condensed">Sophie Shepherd</h1>
21+
<p class="mb-3 f4 text-gray">
22+
✏ Design manager at @github
23+
</p>
2424
<div class="f4 mb-6">
2525

26-
<div class="d-md-inline-block mr-3">
27-
<svg height="20" class="octicon octicon-mark-github mr-1 v-align-middle" fill="#24292e" aria-label="GitHub" viewBox="0 0 16 16" version="1.1" width="20" role="img"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
26+
<div class="d-flex flex-items-center mb-3">
27+
<svg height="20" class="octicon octicon-mark-github mr-2 v-align-middle" fill="#24292e" aria-label="GitHub" viewBox="0 0 16 16" version="1.1" width="20" role="img"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
2828
<a href="https://github.com/sophshep" >
2929
@sophshep
3030
</a>
3131
</div>
3232

3333

3434

35-
<div class="d-md-inline-block ">
36-
<svg height="20" class="octicon octicon-location mr-1 v-align-middle" fill="#24292e" aria-label="Location" viewBox="0 0 12 16" version="1.1" width="15" role="img"><path fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
35+
<div class="d-flex flex-items-center mb-3">
36+
<svg height="20" class="octicon octicon-location mr-2 v-align-middle" fill="#24292e" aria-label="Location" viewBox="0 0 12 16" version="1.1" width="15" role="img"><path fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
3737
Austin TX
3838
</div>
3939

40+
4041
</div>
41-
42+
</div>
4243

43-
<div >
44-
45-
I have stuff to say here.
44+
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7">
45+
<div class="mx-auto" style="max-width: 900px;">
4646

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

50-
51-
<div class="my-6">
52-
<h2 >My Projects</h2>
51+
52+
</div>
53+
54+
55+
<h2 >My Projects</h2>
5356
<p class="f4 mb-4 text-gray">GitHub repositories that I've built.</p>
5457
<div class="d-sm-flex flex-wrap gutter-condensed mb-4">
5558

@@ -167,10 +170,8 @@ <h1 class="f4 lh-condensed mb-1">
167170

168171
</div>
169172

170-
</div>
171173

172-
<div class="my-6">
173-
<h2 >My Interests</h2>
174+
<h2 >My Interests</h2>
174175
<p class="f4 mb-4 text-gray">Topics that I want to learn more about.</p>
175176
<div class="d-flex flex-wrap gutter-condensed mb-4">
176177

@@ -220,11 +221,9 @@ <h2 >My Interests</h2>
220221

221222
</div>
222223

223-
</div>
224224

225-
226-
<div class="my-6">
227-
<h2 >My Thoughts</h2>
225+
226+
<h2 >My Thoughts</h2>
228227
<p class="f4 mb-4 text-gray">Articles I've written.</p>
229228
<div class="d-sm-flex flex-wrap gutter-condensed mb-4">
230229

@@ -244,13 +243,12 @@ <h1 class="f4 lh-condensed mb-1">
244243

245244
</div>
246245

247-
</div>
248-
249-
246+
247+
248+
</div>
249+
</div>
250250
</div>
251251

252-
253-
254252
</body>
255253
</html>
256254

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
layout: stacked
2+
layout: sidebar
33
---
44
I have stuff to say here.

0 commit comments

Comments
 (0)