Merge pull request #113 from ZeusWPI/better-blog-page

Improved blog page with mobile menu, author and excerpt
This commit is contained in:
lorin 2016-11-01 20:29:49 +01:00 committed by GitHub
commit e2e2ab235e

View file

@ -1,38 +1,52 @@
<div class="columns is-flex-mobile" > <div class="columns" >
<div class="column is-2 is-narrow">
<aside class="menu">
<p class="menu-label">
Academic Year
</p>
<ul class="menu-list">
<% academic_years_items.each do |year, item| %>
<% if @item_rep && @item_rep.path == item.path %>
<li>
<a href="#" class="is-active">
<%= pretty_year(year) %>
</a>
</li>
<% else %>
<li>
<%= link_to pretty_year(year), item %>
</li>
<% end %>
<% end %>
</ul>
</aside>
</div>
<div class="column"> <div class="column">
<% posts_in_year(item[:academic_year]).each do |post| %> <% posts_in_year(item[:academic_year]).each do |post| %>
<a href="<%= relative_path_to(post) %>" > <a href="<%= relative_path_to(post) %>">
<div class="box padbox"> <article class="box padbox">
<article class="media"> <div class="columns">
<div class="media-content"> <div class="column">
<p class="title is-3"><%= post[:title] %></p>
<p class="subtitle is-5">
<% if post[:author] %>
by <%= post[:author] %>
<% end %>
</p>
<div class="content"> <div class="content">
<h2><%= post[:title] %> <small> <%= post[:created_at] %></small></h2>
<%= post[:description] %> <%= post[:description] %>
<br>
<small><%= post[:created_at] %></small>
</div> </div>
</div> </div>
</article> <div class="column">
</div> <div class="content">
<%= excerptize(post.reps[:text].compiled_content, length: 200).tr("\n", ' ')%>
</div>
</div>
</div>
</article>
</a> </a>
<% end %> <% end %>
</div> </div>
<aside class="column is-narrow menu">
<p class="menu-label">
Academic Year
</p>
<ul class="menu-list">
<% academic_years_items.each do |year, item| %>
<% if @item_rep && @item_rep.path == item.path %>
<li>
<a href="#" class="is-active">
<%= pretty_year(year) %>
</a>
</li>
<% else %>
<li>
<%= link_to pretty_year(year), item %>
</li>
<% end %>
<% end %>
</ul>
</aside>
</div> </div>