blog previews update

This commit is contained in:
Lorin Werthen 2017-04-20 23:06:45 +02:00
parent a6a9a27fda
commit d228607e50
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
5 changed files with 50 additions and 31 deletions

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'nanoc', '4.7.4'
gem 'nanoc', '4.7.7'
# General filtering
gem 'coffee-script'

View file

@ -13,7 +13,7 @@ GEM
coffee-script-source (1.12.2)
colored (1.2)
concurrent-ruby (1.0.5)
cri (2.7.1)
cri (2.8.0)
colored (~> 1.2)
css_press (0.3.2)
csspool-st (= 3.1.2)
@ -60,8 +60,8 @@ GEM
css_press
multi_js (0.1.0)
uglifier (~> 2)
nanoc (4.7.4)
cri (~> 2.3)
nanoc (4.7.7)
cri (~> 2.8)
ddplugin (~> 1.0)
hamster (~> 3.0)
ref (~> 2.0)
@ -111,7 +111,7 @@ DEPENDENCIES
html_press
icalendar
kramdown
nanoc (= 4.7.4)
nanoc (= 4.7.7)
sass
terminal-notifier
terminal-notifier-guard

View file

@ -71,3 +71,17 @@ dl {
background: $zeus-orange;
}
}
.blog-preview {
position: relative;
&::after {
content: '';
position: absolute;
bottom: 20px;
left: 0;
background: linear-gradient(to bottom, transparent, white);
height: 100px;
width: 100%;
}
}

View file

@ -22,31 +22,18 @@
</aside>
</div>
<div class="column">
<% posts_in_year(item[:academic_year]).each do |post| %>
<a href="<%= relative_path_to(post) %>">
<article class="box padbox">
<div class="columns">
<div class="columns is-multiline">
<div class="column">
<p class="title is-3"><%= post[:title] %></p>
<p class="subtitle is-5">
<% if post[:author] %>
door <%= post[:author] %>
<% posts_in_year(item[:academic_year]).each_with_index.select {|e, i| i.even?}.map(&:first).each do |post| %>
<%= render '/partials/_blog_preview.*', post: post %>
<% end %>
</p>
<div class="content">
<%= post[:description] %>
<br>
<small><%= post[:created_at] %></small>
</div>
</div>
<div class="column">
<div class="content">
<%= excerptize(post.reps[:text].compiled_content, length: 200).tr("\n", ' ')%>
</div>
</div>
</div>
</article>
</a>
<% posts_in_year(item[:academic_year]).each_with_index.reject {|e, i| i.even?}.map(&:first).each do |post| %>
<%= render '/partials/_blog_preview.*', post: post %>
<% end %>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,18 @@
<a href="<%= relative_path_to(post) %>">
<article class="box blog-preview">
<div class="content">
<h3 class="has-text-centered"><%= post[:title] %></h3>
<p class="has-text-centered">
<%= post[:description] %>
</p>
<h5 class="has-text-centered">
<% if post[:author] %>
door <%= post[:author] %>
<% end %>
</h5>
<small><%= post[:created_at] %></small>
<br>
<%= excerptize(post.reps[:text].compiled_content, length: 200).tr("\n", ' ')%>
</div>
</article>
</a>