better blogpost looks and table of contents

This commit is contained in:
Lorin Werthen 2017-02-02 20:44:30 +01:00
parent 42a20b355f
commit 019c41fad9
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
2 changed files with 36 additions and 30 deletions

View file

@ -1,27 +1,24 @@
<div class="columns">
<article class="column is-8 is-offset-2">
<div class="heading">
<h1 class="title is-1 has-text-centered">
<%= item[:title] %>
</h1>
<% if item[:author] %>
<h2 class="subtitle is-3 has-text-centered">
<% if item[:lang] == :en %>
by
<% else %>
door
<% end %>
<%= item[:author] %>
</h2>
<% end %>
<p class="has-text-centered">
<small>Geschreven op <%= item[:created_at] %></small><br>
Leestijd: <%= reading_time @item %>
</p>
<hr>
</div>
<div class="content is-medium">
<%= yield %>
</div>
</article>
<div class="heading">
<h1 class="title is-1 has-text-centered">
<%= item[:title] %>
</h1>
<% if item[:author] %>
<h2 class="subtitle is-3 has-text-centered">
<% if item[:lang] == :en %>
by
<% else %>
door
<% end %>
<%= item[:author] %>
</h2>
<% end %>
<p class="has-text-centered">
<small>Geschreven op <%= item[:created_at] %></small><br>
Leestijd: <%= reading_time @item %>
</p>
<hr>
</div>
<div class="columns">
<%= yield %>
</div>

View file

@ -1,11 +1,20 @@
<article class="column is-offset-2 is-8" markdown="1">
<div class="content is-medium" markdown="1">
<%= yield %>
</div>
</article>
<% if item[:toc] %>
<aside class="menu is-pulled-right" markdown="1">
<div class="menu column" markdown="1">
<p class="menu-label">
Table of Contents
</p>
<% if item[:toc].is_a? Hash %>
* x
{:toc .toc-depth-<%= item[:toc][:depth] %>}
</aside>
<% else %>
* x
{:toc}
<% end %>
</div>
<% end %>
<%= yield %>