docs and also I improved the readability/user friendliness of the EJS
This commit is contained in:
@@ -1,23 +1,51 @@
|
||||
<h3>
|
||||
<%= post.title %>
|
||||
</h3>
|
||||
<%- func.render_md(post.content) %><br/>
|
||||
<a href="<%= config.edit_post_base_url %>/<%= postID %>"><%= locale.edit_post %></a><br/>
|
||||
<a href="/post/<%- postID %>"><%= locale.permalink %></a><br/>
|
||||
<%- func.hyperlink_tags(post.tags) %>
|
||||
<br/>
|
||||
<div id="post-header">
|
||||
<h1>
|
||||
<%= post.title %>
|
||||
</h1>
|
||||
</div>
|
||||
<div id="post-content">
|
||||
<p>
|
||||
<%- func.render_md(post.content) %><br/>
|
||||
</p>
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<div id="post-author">
|
||||
<i><%= locale.written_by %> <a href="/user/<%= user.username %>"><%= user.username %></a><br/></i>
|
||||
</div>
|
||||
<div id="post-permalink">
|
||||
<a href="/post/<%= post["id"] %>"><%= locale.permalink %><a/>
|
||||
</div>
|
||||
<div id="post-tags">
|
||||
<%- func.render_tags(post.tags) %><br/>
|
||||
</div>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.edit_post_base_url %>/<%= post["id"] %>"><%= locale.edit_post %></a><br/>
|
||||
</div>
|
||||
<div id="post-pubdate">
|
||||
<i><%= locale.published %>: <%= func.unix_time_to_date_format(post.pubdate) %></i><br/>
|
||||
</div>
|
||||
<div id="post-editdate">
|
||||
<i><%= locale.last_modified %>: <%= func.unix_time_to_date_format(post.pubdate) %></i><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= postID %>">
|
||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||
<label><%= locale.comment %>:</label><br/><textarea name="content"></textarea><br/>
|
||||
<button type="submit"><%= locale.submit %></button>
|
||||
</form>
|
||||
<div id="post-commentform">
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= post["id"] %>">
|
||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||
<label><%= locale.comment %>:</label><br/><textarea name="content"></textarea><br/>
|
||||
<button type="submit"><%= locale.submit %></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<% comments[postID].forEach((comment) => { %>
|
||||
<%- include('../partials/comment', {comment: comment}) %>
|
||||
<% }) %>
|
||||
<div id="post-comments">
|
||||
<% comments.forEach((comment, index) => { %>
|
||||
<div id="comment-no<%= comment.id %>" class="post-comment-<%= index %>">
|
||||
<%- include('../partials/comment', {comment: comment}) %>
|
||||
</div>
|
||||
<% }) %>
|
||||
</div>
|
||||
|
||||
<%- config.seperator %>
|
||||
|
||||
|
Reference in New Issue
Block a user