Skip to content

Commit

Permalink
Updating theme - version 4.0.0 - fonts, conditional comments, prev & …
Browse files Browse the repository at this point in the history
…next posts, share buttons
  • Loading branch information
raivis-vitols committed Dec 29, 2016
1 parent dd5a6c2 commit c2c7aa7
Show file tree
Hide file tree
Showing 25 changed files with 331 additions and 198 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Willow Ghost Theme 3.0
# Willow Ghost Theme 4.0

Personal, responsive, minimalist and open-source theme for Ghost blogging platform.
Lightweight - only 2.9KB of CSS and 820B of JavaScript. No jQuery, vanilla JS only.
Version 2.0 comes with SASS in BEM style using ITCSS (http://itcss.io/) architecture.
Personal, responsive, minimalist and open-source theme for Ghost blogging platform. Lightweight - only 3KB of CSS and 820B of JavaScript. No jQuery, vanilla JS only. Starting version 2.0 theme is built with SASS in BEM style using ITCSS (http://itcss.io/) architecture.

![Willow Ghost Theme](http://i.imgur.com/a8WfkoS.png)

Expand All @@ -27,4 +25,4 @@ Edit the `content/themes/[theme-folder]/partials/sidebar.hbs` file.
1. Edit the `content/themes/[theme-folder]/post.hbs` file, uncomment "comments" partial
inclusion.

2. Replace Disqus embed code with your site code - https://disqus.com/admin/universalcode/
2. Replace Disqus embed code with your site code - https://disqus.com/admin/universalcode/. Edit `content/themes/[theme-folder]/partials/comments.hbs` file and replace `loadDisqusComments` function body with Disqus embed code function body.
2 changes: 1 addition & 1 deletion assets/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Willow",
"version": "3.0.0",
"version": "4.0.0",
"main": "Gruntfile.js",
"author": {
"name": "Raivis Vitols",
Expand Down
26 changes: 17 additions & 9 deletions partials/comments.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<div class="c-disqus-comments">
{{! Replace Code From Here }}
<div id="disqus_thread"></div>
<div id="disqus_thread">
<a class="c-disqus-comments__button" onclick="WillowGhostTheme.loadDisqusComments();">
Load Comments
</a>
</div>
<script>
(function() {
var d = document, s = d.createElement('script');
s.src = '//yourssite.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
var WillowGhostTheme = {
loadDisqusComments: function () {
{{! Replace Code From Here }}
var d = document, s = d.createElement('script');
s.src = '//yourssite.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
{{! Replace Code Until Here }}
}
};
</script>
{{! Replace Code Until Here }}
</div>
2 changes: 0 additions & 2 deletions partials/post-meta.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
{{/foreach}}
</span>
{{/if}}
|
{{> "post-share"}}
</div>
12 changes: 5 additions & 7 deletions partials/post-share.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<span class="c-post-view-share">
<a class="c-post-view-share__item--twitter" href="https://twitter.com/intent/tweet?text={{encode title}}&amp;url={{url absolute="true"}}"
<div class="c-post-view-share">
<a class="c-post-view-share__item c-post-view-share__item--twitter" href="https://twitter.com/intent/tweet?text={{encode title}}&amp;url={{url absolute="true"}}"
onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
Share on Twitter
</a>
|
<a class="c-post-view-share__item--facebook" href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}"
<a class="c-post-view-share__item c-post-view-share__item--facebook" href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}"
onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
Share on Facebook
</a>
|
<a class="c-post-view-share__item--google" href="https://plus.google.com/share?url={{url absolute="true"}}"
<a class="c-post-view-share__item c-post-view-share__item--google" href="https://plus.google.com/share?url={{url absolute="true"}}"
onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
Share on Google+
</a>
</span>
</div>
47 changes: 47 additions & 0 deletions partials/prev-next.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div class="c-post-view-prev-next">
{{#next_post}}
<article class="c-post-view-prev-next__item {{post_class}}">
<a class="c-post-view-prev-next__image" href="{{url}}" title="{{title}}">
<img class="c-post-view-prev-next__image__img" src="{{image}}" alt="{{title}}"/>
<span class="c-post-view-prev-next__image__label c-post-view-prev-next__image__label--next">
Next Post
</span>
</a>

<h3 class="c-post-view-prev-next__title">
<a href="{{url}}" title="{{title}}">{{title}}</a>
</h3>
</article>
{{else}}
<article class="c-post-view-prev-next__item">
<div class="c-post-view-prev-next__image c-post-view-prev-next__image--placeholder">
<span class="c-post-view-prev-next__image__label c-post-view-prev-next__image__label--next">
No Newer Posts
</span>
</div>
</article>
{{/next_post}}

{{#prev_post}}
<article class="c-post-view-prev-next__item {{post_class}}">
<a class="c-post-view-prev-next__image" href="{{url}}" title="{{title}}">
<img class="c-post-view-prev-next__image__img" src="{{image}}" alt="{{title}}"/>
<span class="c-post-view-prev-next__image__label c-post-view-prev-next__image__label--previous">
Previous Post
</span>
</a>

<h3 class="c-post-view-prev-next__title">
<a href="{{url}}" title="{{title}}">{{title}}</a>
</h3>
</article>
{{else}}
<article class="c-post-view-prev-next__item">
<div class="c-post-view-prev-next__image c-post-view-prev-next__image--placeholder">
<span class="c-post-view-prev-next__image__label c-post-view-prev-next__image__label--previous">
No Older Posts
</span>
</div>
</article>
{{/prev_post}}
</div>
6 changes: 3 additions & 3 deletions post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</div>

<div class="c-post-view__footer">
{{> "post-meta"}}
{{> "post-share"}}
{{> "prev-next"}}
<!--{{> "comments"}}-->
</div>

<!--{{> "comments"}}-->
</div>
{{/post}}
2 changes: 1 addition & 1 deletion source/sass/components/_author-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// Bio
.c-author-page__bio {
max-width: 600px;
max-width: 580px;
font-size: 0.9em;
color: $c-grayDark;
font-weight: normal;
Expand Down
8 changes: 8 additions & 0 deletions source/sass/components/_disqus-comments.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@
padding-top: 30px;
border-top: 1px solid $c-gray;
}

.c-disqus-comments__button {
display: block;
cursor: pointer;
margin-top: 10px;
padding: 20px 25px;
background: $c-gray;
}
2 changes: 1 addition & 1 deletion source/sass/components/_page-title.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.c-page-title {
text-align: center;
margin-bottom: 40px;
padding: 10px 0 40px 0;
padding: 10px 0 35px 0;
border-bottom: 1px solid $c-gray;
}

Expand Down
2 changes: 1 addition & 1 deletion source/sass/components/_post-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

// Meta info
.c-post-list__meta {
font-size: 0.8em;
font-size: 0.9em;
font-style: italic;
color: $c-grayDark;
}
Expand Down
19 changes: 0 additions & 19 deletions source/sass/components/_post-view-meta.scss

This file was deleted.

20 changes: 0 additions & 20 deletions source/sass/components/_post-view-share.scss

This file was deleted.

134 changes: 126 additions & 8 deletions source/sass/components/_post-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,132 @@
// Footer
.c-post-view__footer {
text-align: center;
margin-top: 40px;
padding: 40px 0 10px;
margin-top: 30px;
padding: 30px 0 10px;
border-top: 1px solid $c-gray;
}

// Narrow post page view
.c-post-view--narrow {
text-align: center;
max-width: 610px;
margin: 0 auto;
}
/*
|-------------------------------------------------------------------------------
| Post view meta - date & tags
|-------------------------------------------------------------------------------
*/
.c-post-view-meta {
line-height: 2;
font-size: 0.9em;
font-style: italic;
color: $c-grayDark;
}

.c-post-view-meta__tags {
text-transform: lowercase;
}

.c-page-title__heading + .c-post-view-meta {
margin-top: 10px;
}

/*
|-------------------------------------------------------------------------------
| Post view share - share on Twitter, Facebook and Google+
|-------------------------------------------------------------------------------
*/
.c-post-view-share {
@extend .clear;
}

.c-post-view-share__item {
float: left;
width: 100%;
padding: 10px;
margin: 1px 0;
color: $c-white;
font-size: 0.9em;
font-weight: bold;

@media (min-width: 550px) {
width: 33.333%;
}
}

.c-post-view-share__item:hover {
opacity: 0.9;
color: $c-white;
}

.c-post-view-share__item--twitter {
background: #4099FF;
}

.c-post-view-share__item--facebook {
background: #3B5998;
}

.c-post-view-share__item--google {
background: #d34836;
}

/*
|-------------------------------------------------------------------------------
| Post view previous / next post
|-------------------------------------------------------------------------------
*/
.c-post-view-prev-next {
@extend .clear;
margin-top: 30px;
padding-top: 30px;
border-top: 1px solid $c-gray;
}

.c-post-view-prev-next__item {
@media (min-width: 700px) {
@include post2Col();
}

@media (max-width: 701px) {
&:first-child {
margin-bottom: 35px;
padding-bottom: 20px;
border-bottom: 1px solid $c-gray;
}
}
}

// Image and image link
.c-post-view-prev-next__image {
margin-bottom: 15px;
position: relative;
display: block;

&:hover {
opacity: 0.8;
}
}

.c-post-view-prev-next__image__img {
width: 100%;
display: block;
}

.c-post-view-prev-next__image--placeholder {
opacity: 0.8;
padding-top: 50%;
background: $c-gray;
}

// Previous and Next labels
.c-post-view-prev-next__image__label {
top: 10px;
color: $c-white;
position: absolute;
padding: 10px 15px;
background: rgba($c-black, 0.5);
}

.c-post-view-prev-next__image__label--next {
left: 10px;
}

.c-post-view-prev-next__image__label--previous {
right: 10px;
}
12 changes: 0 additions & 12 deletions source/sass/components/_sidebar-blog-description.scss

This file was deleted.

Loading

0 comments on commit c2c7aa7

Please sign in to comment.