blog previews update
This commit is contained in:
parent
a6a9a27fda
commit
d228607e50
5 changed files with 50 additions and 31 deletions
2
Gemfile
2
Gemfile
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'nanoc', '4.7.4'
|
gem 'nanoc', '4.7.7'
|
||||||
|
|
||||||
# General filtering
|
# General filtering
|
||||||
gem 'coffee-script'
|
gem 'coffee-script'
|
||||||
|
|
|
@ -13,7 +13,7 @@ GEM
|
||||||
coffee-script-source (1.12.2)
|
coffee-script-source (1.12.2)
|
||||||
colored (1.2)
|
colored (1.2)
|
||||||
concurrent-ruby (1.0.5)
|
concurrent-ruby (1.0.5)
|
||||||
cri (2.7.1)
|
cri (2.8.0)
|
||||||
colored (~> 1.2)
|
colored (~> 1.2)
|
||||||
css_press (0.3.2)
|
css_press (0.3.2)
|
||||||
csspool-st (= 3.1.2)
|
csspool-st (= 3.1.2)
|
||||||
|
@ -60,8 +60,8 @@ GEM
|
||||||
css_press
|
css_press
|
||||||
multi_js (0.1.0)
|
multi_js (0.1.0)
|
||||||
uglifier (~> 2)
|
uglifier (~> 2)
|
||||||
nanoc (4.7.4)
|
nanoc (4.7.7)
|
||||||
cri (~> 2.3)
|
cri (~> 2.8)
|
||||||
ddplugin (~> 1.0)
|
ddplugin (~> 1.0)
|
||||||
hamster (~> 3.0)
|
hamster (~> 3.0)
|
||||||
ref (~> 2.0)
|
ref (~> 2.0)
|
||||||
|
@ -111,7 +111,7 @@ DEPENDENCIES
|
||||||
html_press
|
html_press
|
||||||
icalendar
|
icalendar
|
||||||
kramdown
|
kramdown
|
||||||
nanoc (= 4.7.4)
|
nanoc (= 4.7.7)
|
||||||
sass
|
sass
|
||||||
terminal-notifier
|
terminal-notifier
|
||||||
terminal-notifier-guard
|
terminal-notifier-guard
|
||||||
|
|
|
@ -71,3 +71,17 @@ dl {
|
||||||
background: $zeus-orange;
|
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%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -22,31 +22,18 @@
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<% posts_in_year(item[:academic_year]).each do |post| %>
|
<div class="columns is-multiline">
|
||||||
<a href="<%= relative_path_to(post) %>">
|
|
||||||
<article class="box padbox">
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<p class="title is-3"><%= post[:title] %></p>
|
<% posts_in_year(item[:academic_year]).each_with_index.select {|e, i| i.even?}.map(&:first).each do |post| %>
|
||||||
<p class="subtitle is-5">
|
<%= render '/partials/_blog_preview.*', post: post %>
|
||||||
<% if post[:author] %>
|
|
||||||
door <%= post[:author] %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
|
||||||
<div class="content">
|
|
||||||
<%= post[:description] %>
|
|
||||||
<br>
|
|
||||||
<small><%= post[:created_at] %></small>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="content">
|
<% posts_in_year(item[:academic_year]).each_with_index.reject {|e, i| i.even?}.map(&:first).each do |post| %>
|
||||||
<%= excerptize(post.reps[:text].compiled_content, length: 200).tr("\n", ' ')%>
|
<%= render '/partials/_blog_preview.*', post: post %>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</a>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
18
layouts/partials/_blog_preview.erb
Normal file
18
layouts/partials/_blog_preview.erb
Normal 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>
|
Loading…
Reference in a new issue