diff options
Diffstat (limited to 'views/blog/blog.ejs')
-rw-r--r-- | views/blog/blog.ejs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/views/blog/blog.ejs b/views/blog/blog.ejs new file mode 100644 index 0000000..2afe769 --- /dev/null +++ b/views/blog/blog.ejs @@ -0,0 +1,35 @@ +<%- include('../partials/header') %> + +<div class='content'> + <div class='leftie'> + <ul> + <% if(!currentUser) { %> + <li><a href='/search/all'>Search for blog posts</a></li> + <li><a href='/'>About</a></li> + <li><a href='/browsers'>Minimal browsers</a></li> + <% } else { %> + <% if(currentUser.username === account.username) { %> + <li><a href='/blog/<%= currentUser.username %>'><strong>My Blog</strong></a></li> + <% } else { %> + <li><a href='/blog/<%= currentUser.username %>'>My Blog</a></li> + <% } %> + <li><a href='/blog/<%= currentUser.username %>/new'>Create a blog post</a></li> + <li><a href='/search/all'>Search for blog posts</a></li> + <li><a href='/'>About</a></li> + <li><a href='/browsers'>Minimal browsers</a></li> + <% } %> + </ul> + </div> + <div class='rightie' id='rev'> + <% posts.map((post) => { %> + <div class='bpost'> + <h4><a href="/blog/<%= account.username %>/<%= post._id %>"><%= post.title %></a></h4> + <img src="<%= post.image %>" alt="..."> + <p><%- post.body.substring(0, 300) %>...</p> + </div> + <% }) %> + <h3><a id='bname' href="/blog/<%= account.username %>"><%= account.username.toUpperCase() %></a></h3> + </div> +</div> + +<%- include('../partials/footer') %>
\ No newline at end of file |