Files
51l3nt51n-blog/templates/index.html

61 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>blog</title>
<style>
* {
font-family: monospace !important;
}
body {
max-width: 780px;
}
img {
max-width: 100%;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<div style="text-align: right;">
{% if let Some(u) = user %}
Logged in as: <b>{{ u.username }}</b> | <form action="/__dungeon/logout" method="post" style="display: inline;">
<input type="submit" value="Logout">
</form>
{% else %}
Not logged in | <a href="/__dungeon/login">Login</a>
{% endif %}
</div>
<h1>blog</h1>
<p>Welcome to my corner of the web.</p>
<hr size="1">
<h2>Posts</h2>
{% if posts.is_empty() %}
<p>No posts available yet.</p>
{% else %}
{% for (post, author) in posts %}
<p>
<b><a href="/post/{{ post.id }}">{{ post.title }}</a></b>
{% if post.visibility == "private" %}
<span style="background-color: #ffff00; color: #000000; padding: 0 4px; font-size: 0.8em;">PRIVATE</span>
{% endif %}
<br>
<i>Posted by {{ author }} on {{ post.formatted_created_at() }}</i><br>
{% if !post.categories.is_empty() %}
Categories: {{ post.categories }}<br>
{% endif %}
{% if !post.tags.is_empty() %}
Tags: {{ post.tags }}<br>
{% endif %}
</p>
<br>
{% endfor %}
{% endif %}
</body>
</html>