Skip to content

Instantly share code, notes, and snippets.

@lukenetti3
Created June 14, 2018 23:30
Show Gist options
  • Save lukenetti3/b6fa45d2bb6709474d483b0366e882ca to your computer and use it in GitHub Desktop.
Save lukenetti3/b6fa45d2bb6709474d483b0366e882ca to your computer and use it in GitHub Desktop.
<% include ./partials/header.ejs %>
<div class="ui text container main center aligned">
<h1 class="title center aligned">List of Favorite Books</h1>
<div class="ui stackable two column grid">
<% for(var i = 0; i<books.total; i++) { %>
<div class="column">
<div class="ui segment">
<a href="/books/<%= books.objects[i].slug %>"><h4 id="title"><%= books.objects[i].title %></h4></a>
<a href="/books/<%= books.objects[i].slug %>">
<svg width="150" height="230">
<image xlink:href="<%= books.objects[i].metadata.image.imgix_url %>" x="0" y="0" width="100%" height="100%"></image>
</svg>
</a>
<% if(typeof books.objects[i].metadata.comments !== "undefined" && books.objects[i].metadata.comments.length > 75) { %>
<p id="comments"><%- books.objects[i].metadata.comments.substring(0,75) %>...</p>
<% } else { %>
<p><%- books.objects[i].metadata.comments %></p>
<% } %>
<a href="/books/<%= books.objects[i].slug %>" class="ui inverted blue button left aligned">More Info</a>
</div>
</div>
<% } %>
</div>
</div>
<% include ./partials/footer.ejs %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment