RSS for posts

This commit is contained in:
Bad Manners 2025-04-19 09:03:40 -03:00
parent bb118f6144
commit 8fac396d7e
13 changed files with 233 additions and 14 deletions

View file

@ -1,6 +1,7 @@
<video
id="media"
src="/files/{{ post.media }}"
controls="controls"
:style="{ width: '100%', height: '100%', 'max-width': width + 'px', 'max-height': height + 'px', 'aspect-ratio': width + ' / ' + height }"
controls="true"
style="width: 100%; height: 100%"
:style="{ 'max-width': width + 'px', 'max-height': height + 'px', 'aspect-ratio': width + ' / ' + height }"
></video>

View file

@ -0,0 +1,11 @@
<h1>
{% if let Some(title) = post.title %}{{ title }}{% else %}Details{% endif %}
</h1>
{% match post.media_type.as_ref() %}{% when "image" %}
<img src="{{ base_url }}/files/{{ post.media }}" />
{% when "video" %}
<video src="{{ base_url }}/files/{{ post.media }}" controls="true"></video>
{% else %}{% endmatch %}{% if let Some(description) = post.description %}
<h2>Description</h2>
<div>{{ description | markdown }}</div>
{% endif %}

View file

@ -18,10 +18,17 @@ parent_post %}
{% else %}
<article id="parent-post" hx-swap-oob="outerHTML" hidden></article>
{% endif %}
<ul id="tags-list" hx-swap-oob="outerHTML">
{% for tag in tags %}
<li>
<a href="/posts?tags={{ tag.name }}">{{ tag.name }}</a>
</li>
{% endfor %}
</ul>
<article id="tags-list" hx-swap-oob="outerHTML">
<h2>Tags</h2>
{% if tags.is_empty() %}
<p>No tags in post. Consider adding some!</p>
{% else %}
<ul>
{% for tag in tags %}
<li>
<a href="/posts?tags={{ tag.name }}">{{ tag.name }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</article>

View file

@ -9,6 +9,7 @@
{% if age_confirmation %}{% include "fragments/age_restricted_check.html"
%}{% endif %}
<div><a href="/">&lt; To home</a></div>
<div><a href="{% if let Some(tags_text) = tags_text %}/posts.xml?tags={{ tags_text.replace(' ', "+") }}{% else %}/posts.xml{% endif %}">RSS feed</a></div>
<article>
<h2>Search</h2>
<form method="get" action="/posts">

View file

@ -20,6 +20,10 @@
value="{{ application_name }}"
/>
</div>
<div>
<label>Base URL</label>
<input name="base_url" type="text" value="{{ base_url }}" />
</div>
<div>
<label>Ask for age confirmation?</label>
<input

View file

@ -92,12 +92,12 @@
</ul>
</article>
{% endif %}
<article>
<article id="tags-list">
<h2>Tags</h2>
{% if tags.is_empty() %}
<p>No tags in post. Consider adding some!</p>
{% else %}
<ul id="tags-list">
<ul>
{% for tag in tags %}
<li>
<a href="/posts?tags={{ tag.name }}">{{ tag.name }}</a>