no need for js on clientside anymore to display the blog

This commit is contained in:
Leonard Lorenz 2020-10-27 23:04:55 +01:00
parent 77fb38403e
commit 874ec7e095

View file

@ -15,16 +15,11 @@
<a href="/blog/id/{{ post.id }}" class="post-link">[link]</a> <a href="/blog/id/{{ post.id }}" class="post-link">[link]</a>
<div class="post-content"> <div class="post-content">
<h2 class="post-title">{{ post.title }}</h2> <h2 class="post-title">{{ post.title }}</h2>
<sub class="post-publish-date"> {{ post.publish_date }}</sub> <sub class="post-publish-date"> {{ post.publish_date | date(format="%Y-%m-%d at %H:%M") }}</sub>
<p class="post-body">{{ post.body }}</p> <p class="post-body">{{ post.body }}</p>
</div> </div>
</article> </article>
{% endfor %} {% endfor %}
</ul> </ul>
<script>
let dates = document.querySelectorAll(".post-publish-date");
Array.from(dates).map((d) => d.textContent = `${d.textContent.split("T")[0]} - ${d.textContent.split("T")[1].split(".")[0]}`)
</script>
</body> </body>
</html> </html>