Skip to content

Commit

Permalink
Closes #3: Added a contact subscribe form to each post page
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhkelly committed Aug 25, 2015
1 parent b6eab79 commit 52470e4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
17 changes: 17 additions & 0 deletions _includes/signup_widget.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="signup_widget">
<h3>Newsletter signup</h3>
<form action="//formspree.io/[email protected]" method="post">
<div class="form-group">
<label for="email">Email address</label>
<input type="email" name="_replyto" class="form-control">
</div>
<div class="form-group">
<label for="name">Your name</label>
<input type="text" name="name" class="form-control">
</div>
<input type="hidden" name="_next" value="/thanks/" />
<input type="hidden" name="_subject" value="New Signup from Kenhkelly.us" />
<input type="text" name="_gotcha" style="display:none" />
<button type="submit" class="btn btn-green">Submit</button>
</form>
</div>
9 changes: 7 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ <h1 class="text-center">{{ page.title }}</h1>
<?= the_author_posts_link() ?></a>
<span class="date">{{ page.date | date: "%B %-d %Y" }}</span>
</div>

{{ content }}

<div class="post_content">
{{ content }}
</div>

{% include signup_widget.html %}
<div class="clearfix"></div>

<div class="tags">
{% for tag in page.tags %}
Expand Down
2 changes: 0 additions & 2 deletions _posts/2014-12-02-new-site-and-blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@

<p>Cheers,<br>
Ken</p>

[contact-form-7 id="65" title="Mailing List (Post)"]
16 changes: 16 additions & 0 deletions _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ body.home {
padding-top: 25px;
padding-bottom: 25px;
}
.post_content {
float: left;
width: calc(100% - 350px);
padding-right: 15px;
}
.signup_widget {
float: right;
}
.meta {
text-align: center;
font-size: smaller;
Expand Down Expand Up @@ -486,6 +494,14 @@ body.home {
}
}

.signup_widget {
width: 350px;
padding: 15px;
border-radius: 3px;
background: white;
border: 1px solid #ededed;
}


@media (max-width: $screen-xs-max) {
img {
Expand Down

0 comments on commit 52470e4

Please sign in to comment.