Skip to content
This repository was archived by the owner on Mar 26, 2023. It is now read-only.

Commit d872f0c

Browse files
committed
initial support for sponsored links
1 parent 4aba5aa commit d872f0c

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

_layouts/post.html

+17-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55
{% assign author = site.data.authors[page.author] %}
66

77
<article>
8-
<h1 class="post-title">{{ page.title }} <small class="post-date">{{ page.date | date_to_string }}</small></h1>
9-
<p class="lead"><em>Written by: <a href="https://twitter.com/{{ author.twitter }}" target="_blank">{{ author.name }}</a></em></p>
10-
<div class="post-content">
11-
{{ content }}
12-
</div> <!-- post-content -->
8+
<h1 class="post-title">{{ page.title }} <small class="post-date">{{ page.date | date_to_string }}</small></h1>
9+
<p class="lead"><em>Written by: <a href="https://twitter.com/{{ author.twitter }}" target="_blank">{{ author.name }}</a></em></p>
10+
<div class="post-content">
11+
{{ page.excerpt }}
12+
13+
{% if page.sponsor %}
14+
<div class="alert alert-warning sponsor">
15+
<h4>Sponsored Link</h4>
16+
<h4><a href="{{ page.sponsor.link }}/?utm_campaign={{ site.title }}&utm_medium=web&utm_source={{ site.title }} {{ page.title | remove: '#' }}"
17+
target="_blank">{{ page.sponsor.heading | markdownify }}</a>
18+
</h4>
19+
<p>{{ page.sponsor.body | markdownify }}</p>
20+
</div>
21+
{% endif %}
22+
23+
{{ page.content | remove: page.excerpt }}
24+
</div> <!-- post-content -->
1325
</article>
1426

1527
{% include social_share.html %}

css/style.css

+13-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ a:active {
5252
text-decoration:none;
5353
}
5454

55-
h1 > a:link {
55+
h1 > a:link,
56+
.sponsor a:link {
5657
border-width: 0px;
5758
}
5859

@@ -82,6 +83,17 @@ header h2 {
8283
color: #666666;
8384
}
8485

86+
/* SPONSOR */
87+
88+
.sponsor p {
89+
padding: 0rem;
90+
}
91+
92+
.sponsor {
93+
margin-top: 3rem;
94+
margin-bottom: 3rem;
95+
}
96+
8597
/* POST LIST */
8698

8799
.post {

0 commit comments

Comments
 (0)