mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
Merge pull request #13 from kremalicious/feature-relatedposts
Related posts
This commit is contained in:
commit
378bb9c10f
7
Gemfile
7
Gemfile
@ -4,4 +4,9 @@ source "https://rubygems.org"
|
|||||||
# gem "rails"
|
# gem "rails"
|
||||||
gem 'jekyll', '1.5.1'
|
gem 'jekyll', '1.5.1'
|
||||||
gem 'mini_magick', '>=3.6.0'
|
gem 'mini_magick', '>=3.6.0'
|
||||||
gem 'fileutils', '>=0.7'
|
gem 'fileutils', '>=0.7'
|
||||||
|
|
||||||
|
# for faster LSI generation
|
||||||
|
# from http://tonyarnold.com/2014/03/27/speeding-up-jekylls-latent-semantic-mapping.html
|
||||||
|
gem 'narray', :git => "https://github.com/tonyarnold/narray"
|
||||||
|
gem 'gsl', :git => "https://github.com/tonyarnold/rb-gsl"
|
15
Gemfile.lock
15
Gemfile.lock
@ -1,3 +1,16 @@
|
|||||||
|
GIT
|
||||||
|
remote: https://github.com/tonyarnold/narray
|
||||||
|
revision: eeb06b030320a222727e41f11a2f0be300f9dd52
|
||||||
|
specs:
|
||||||
|
narray (0.6.0.8)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/tonyarnold/rb-gsl
|
||||||
|
revision: 659a95fd9b610c02e38035b956feceb5c29e1ecb
|
||||||
|
specs:
|
||||||
|
gsl (1.14.7)
|
||||||
|
narray (>= 0.5.9)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
@ -55,5 +68,7 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
fileutils (>= 0.7)
|
fileutils (>= 0.7)
|
||||||
|
gsl!
|
||||||
jekyll (= 1.5.1)
|
jekyll (= 1.5.1)
|
||||||
mini_magick (>= 3.6.0)
|
mini_magick (>= 3.6.0)
|
||||||
|
narray!
|
||||||
|
@ -46,7 +46,8 @@ module.exports = function(grunt){
|
|||||||
jekyll: {
|
jekyll: {
|
||||||
options: {
|
options: {
|
||||||
src : '<%= config.src %>/',
|
src : '<%= config.src %>/',
|
||||||
config: './_config.yml'
|
config: './_config.yml',
|
||||||
|
lsi: true
|
||||||
},
|
},
|
||||||
production: {
|
production: {
|
||||||
options: {
|
options: {
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
{% if site.related_posts.size > 1 %}
|
{% if site.related_posts.size > 1 %}
|
||||||
<aside class="related-posts">
|
<aside class="related-posts">
|
||||||
|
|
||||||
<h1 class="related-title">Related</h1>
|
<h1 class="related-posts-title">Related</h1>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
{% for post in site.posts limit:6 %}
|
{% for post in site.related_posts limit:6 %}
|
||||||
|
|
||||||
<article class="related-post col2">
|
<article class="related-post col2">
|
||||||
<a href="{{ post.url }}">
|
<a class="post-title-link" href="{{ post.url }}">
|
||||||
<h1 class="post-title">{{ post.title }}</h1>
|
<h1 class="post-title">{{ post.title }}</h1>
|
||||||
</a>
|
</a>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
{% endif %}
|
{% endif %}
|
@ -3,7 +3,7 @@ layout: base
|
|||||||
---
|
---
|
||||||
|
|
||||||
<section role="main" id="main" class="page-single row">
|
<section role="main" id="main" class="page-single row">
|
||||||
|
|
||||||
<article class="hentry format-link">
|
<article class="hentry format-link">
|
||||||
<header>
|
<header>
|
||||||
<h1 class="entry-title">
|
<h1 class="entry-title">
|
||||||
@ -21,11 +21,11 @@ layout: base
|
|||||||
<a class="permalink-link" href="{{ page.url | append: '/' }}" rel="tooltip" title="Permalink">∞</a>
|
<a class="permalink-link" href="{{ page.url | append: '/' }}" rel="tooltip" title="Permalink">∞</a>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% include entry_meta.html %}
|
{% include entry_meta.html %}
|
||||||
|
|
||||||
{% include comments.html %}
|
{% include comments.html %}
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
</section>
|
</section>
|
@ -3,7 +3,7 @@ layout: base
|
|||||||
---
|
---
|
||||||
|
|
||||||
<section role="main" id="main" class="page-single row">
|
<section role="main" id="main" class="page-single row">
|
||||||
|
|
||||||
<article class="hentry format-post">
|
<article class="hentry format-post">
|
||||||
<header>
|
<header>
|
||||||
<h1 class="entry-title">{{ page.title | titlecase }}</h1>
|
<h1 class="entry-title">{{ page.title | titlecase }}</h1>
|
||||||
@ -13,14 +13,16 @@ layout: base
|
|||||||
{% if page.image %}
|
{% if page.image %}
|
||||||
{% picture {{ page.image }} class="teaser" %}
|
{% picture {{ page.image }} class="teaser" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% include entry_meta.html %}
|
{% include entry_meta.html %}
|
||||||
|
|
||||||
{% include comments.html %}
|
{% include comments.html %}
|
||||||
|
|
||||||
|
{% include relatedposts.html %}
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
</section>
|
</section>
|
@ -72,4 +72,6 @@
|
|||||||
|
|
||||||
.photo-link {
|
.photo-link {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
|
&:active { background: none }
|
||||||
}
|
}
|
37
_src/assets/less/content-related.less
Normal file
37
_src/assets/less/content-related.less
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// Related Posts
|
||||||
|
/////////////////////////////////////
|
||||||
|
|
||||||
|
.related-posts {
|
||||||
|
.row { margin-top: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-posts-title {
|
||||||
|
&:extend(.heading-band, .h3);
|
||||||
|
margin-bottom: @line-height-computed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-post {
|
||||||
|
|
||||||
|
.post-title {
|
||||||
|
&:extend(.h6);
|
||||||
|
margin-top: @line-height-computed;
|
||||||
|
margin-bottom: @line-height-computed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-title,
|
||||||
|
.post-title-link {
|
||||||
|
color: @brand-grey-light;
|
||||||
|
.transition;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus { color: @link-color }
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
color: #fff;
|
||||||
|
.transition(none);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-title-link { display: block }
|
||||||
|
|
||||||
|
}
|
@ -49,6 +49,7 @@
|
|||||||
@import 'content.less';
|
@import 'content.less';
|
||||||
@import 'content-photo.less';
|
@import 'content-photo.less';
|
||||||
@import 'content-link.less';
|
@import 'content-link.less';
|
||||||
|
@import 'content-related.less';
|
||||||
@import 'comments.less';
|
@import 'comments.less';
|
||||||
@import 'sticky.less';
|
@import 'sticky.less';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user