feat: Add password protection for posts, improve markdown rendering for code and images, and introduce basic responsive styling.

This commit is contained in:
2026-03-03 19:13:28 +00:00
parent 347ac8af55
commit bfcf45343f
9 changed files with 153 additions and 20 deletions

View File

@@ -8,6 +8,14 @@
* {
font-family: monospace !important;
}
body {
max-width: 780px;
}
img {
max-width: 100%;
}
</style>
</head>

View File

@@ -8,6 +8,14 @@
* {
font-family: monospace !important;
}
body {
max-width: 780px;
}
img {
max-width: 100%;
}
</style>
</head>

View File

@@ -9,6 +9,14 @@
font-family: monospace !important;
}
body {
max-width: 780px;
}
img {
max-width: 100%;
}
code {
background-color: #f0f0f0;
padding: 2px 4px;
@@ -56,14 +64,25 @@
<p>Tags: {{ post.tags }}</p>
{% endif %}
{% if post.visibility == "password_protected" %}
<p><b>[This post is password protected. In a full implementation, you'd enter a password here.]</b></p>
{% if post.visibility == "password_protected" && !unlocked %}
<p><b>This post is password protected. Please enter the password to view it:</b></p>
<form action="/post/{{ post.id }}/unlock" method="post">
<input type="password" name="password" placeholder="Enter password" required>
<input type="submit" value="Unlock">
</form>
<hr size="1">
{% else if post.visibility == "private" && user.is_none() %}
<p><b>[This post is private and only visible to authorized users.]</b></p>
<hr size="1">
{% else %}
<hr size="1">
{% if post.visibility == "password_protected" && unlocked %}
<div style="text-align: right;">
<form action="/post/{{ post.id }}/lock" method="post" style="display: inline;">
<input type="submit" value="Lock Post">
</form>
</div>
{% endif %}
{{ post.rendered_content()|safe }}
<hr size="1">
{% endif %}