Skip to content

Commit

Permalink
add sticky for sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
GodoFredo committed Dec 17, 2016
1 parent 028682b commit 908bd94
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 37 deletions.
7 changes: 2 additions & 5 deletions assets/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 52 additions & 9 deletions assets/js/bundle.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions partials/footer.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer class="footer">
<footer class="footer">
<div class="footer-wrap">
<div class="footer-copy">&copy; {{date format="YYYY"}} <a href="{{@blog.url}}">{{@blog.title}}</a> Powered by <a href="https://ghost.org" target="_blank">Ghost</a></div>
<div class="footer-design-author"><span>Design with</span> <i class="i-favorite heart"></i> by <a href="http://bit.ly/GodoFredoNinja" target="_blank" title="Desarrollador Web FullStack.">@GodoFredoNinja</a></div>
<div class="footer-design-author"><span>Design with</span> <i class="i-favorite heart"></i> by <a href="http://bit.ly/GodoFredoNinja" target="_blank" title="Developer Web FullStack.">@GodoFredoNinja</a></div>
</div>
</footer>
36 changes: 23 additions & 13 deletions partials/sidebar.hbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
{{!-- Sidebar right --}}
<div id="sidebar" class="col s12 sidebar u-h-b-lg">

{{!-- 5 articles featured in page (home - author - tag) --}}
{{#is "home"}}
{{#get "posts" filter="featured:true" limit="5" as |featured|}}
{{> "widget-entry-sidebar" widgetTitle="Featured Posts" widgetPosts=featured}}
{{/get}}
{{/is}}
{{!-- 5 articles featured in page (home - author - tag) --}}
{{#is "home"}}
{{#get "posts" filter="featured:true" limit="5" as |featured|}}
{{> "widget-entry-sidebar" widgetTitle="Featured Posts" widgetPosts=featured}}
{{/get}}
{{/is}}

{{!-- 5 articles recents in page (post) --}}
{{#is "post, tag, author, paged"}}
{{#get "posts" limit="5" as |recents|}}
{{> "widget-entry-sidebar" widgetTitle="Latest" widgetPosts=recents}}
{{/get}}
{{/is}}
{{!-- 5 articles recents in page (post) --}}
{{#is "post, tag, author, paged"}}
{{#get "posts" limit="5" as |recents|}}
{{> "widget-entry-sidebar" widgetTitle="Latest" widgetPosts=recents}}
{{/get}}
{{/is}}

{{!-- Add your content here --}}
{{!-- Add your content here --}}
<div class="sidebar-items">
<div class="sidebar-title">... your title ...</div>
... your content ...
</div>

{{!-- Add your content sticky --}}
<div class="sidebar-sticky">
<div class="sidebar-title">...your title sticky ...</div>
... your content sticky ...
</div>

</div>
6 changes: 6 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Mapache Javascript Functions

// import external dependencies
// import ghostHunter from './lib/jquery.ghostHunter'; // eslint-disable-line
import stickyKit from './lib/sticky-kit'; // eslint-disable-line

// import local dependencies
import Mapache from './app/app.helper';
Expand Down Expand Up @@ -178,6 +179,11 @@ $doc.on('ready', () => {
related.mapacheGet();
}

/* sticky fixed for Sidenar */
$('.sidebar-sticky').stick_in_parent({
offset_top: $header.outerHeight() + 16,
});

/* Disqys Comments */
if (typeof disqusShortname !== 'undefined' && $comments.length > 0) disqusComments(disqusShortname); // eslint-disable-line
});
10 changes: 10 additions & 0 deletions src/js/lib/sticky-kit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/sass/app/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
background: $footer-bg-color;
color: $footer-color;
padding: 1.6rem 15px;
font-size: 15px;
font-size: 14px;
font-weight: 500;

a{
color: $footer-color-link;
Expand Down
7 changes: 0 additions & 7 deletions src/sass/app/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,4 @@
font-size: 18px;
}

// Fixed
.fixed.active{
position: fixed;
top: $header-height + 28;
width: 300px;
}

}

0 comments on commit 908bd94

Please sign in to comment.