Use Go templates for HTML

This commit is contained in:
Joakim Hellsén 2024-02-03 17:47:58 +01:00
commit 51fb9df8b3
14 changed files with 220 additions and 255 deletions

View file

@ -1,103 +0,0 @@
{% extends "base.html" %}
{% block title %}<title>FeedVault</title>{% endblock %}
{% block description %}FeedVault{% endblock %}
{% block keywords %}RSS, Atom, Feed, Archive{% endblock %}
{% block content %}
<h2>Feeds to archive</h2>
<p>
Input the URLs of the feeds you wish to archive below. You can add as many as needed, and access them through the website or API. Alternatively, include links to .opml files, and the feeds within will be archived.
</p>
<form action="/add" method="post">
{% csrf_token %}
<textarea id="urls" name="urls" rows="5" cols="50" required></textarea>
<button type="submit">Add feeds</button>
</form>
<br>
<p>You can also upload .opml files containing the feeds you wish to archive:</p>
<form enctype="multipart/form-data" method="post" action="/upload_opml">
{% csrf_token %}
<input type="file" name="file" id="file" accept=".opml" required>
<button type="submit">Upload OPML</button>
</form>
<hr>
<details>
<summary>What are web feeds?</summary>
<p>
Web feeds let you "subscribe" to website content, notifying you of new updates. Feeds are typically in RSS or Atom formats, recognizable by this icon:
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgY3Vyc29yPSJkZWZhdWx0Ij48ZGVmcz48bGluZWFyR3JhZGllbnQgeDE9Ii4wODUiIHkxPSIuMDg1IiB4Mj0iLjkxNSIgeTI9Ii45MTUiIGlkPSJwcmVmaXhfX2EiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI0UzNzAyRCIvPjxzdG9wIG9mZnNldD0iLjEwNyIgc3RvcC1jb2xvcj0iI0VBN0QzMSIvPjxzdG9wIG9mZnNldD0iLjM1IiBzdG9wLWNvbG9yPSIjRjY5NTM3Ii8+PHN0b3Agb2Zmc2V0PSIuNSIgc3RvcC1jb2xvcj0iI0ZCOUUzQSIvPjxzdG9wIG9mZnNldD0iLjcwMiIgc3RvcC1jb2xvcj0iI0VBN0MzMSIvPjxzdG9wIG9mZnNldD0iLjg4NyIgc3RvcC1jb2xvcj0iI0RFNjQyQiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0Q5NUIyOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiByeD0iNTUiIHJ5PSI1NSIgZmlsbD0iI0NDNUQxNSIvPjxyZWN0IHdpZHRoPSIyNDYiIGhlaWdodD0iMjQ2IiByeD0iNTAiIHJ5PSI1MCIgeD0iNSIgeT0iNSIgZmlsbD0iI0Y0OUM1MiIvPjxyZWN0IHdpZHRoPSIyMzYiIGhlaWdodD0iMjM2IiByeD0iNDciIHJ5PSI0NyIgeD0iMTAiIHk9IjEwIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiLz48Y2lyY2xlIGN4PSI2OCIgY3k9IjE4OSIgcj0iMjQiIGZpbGw9IiNGRkYiLz48cGF0aCBkPSJNMTYwIDIxM2gtMzRhODIgODIgMCAwMC04Mi04MlY5N2ExMTYgMTE2IDAgMDExMTYgMTE2eiIgZmlsbD0iI0ZGRiIvPjxwYXRoIGQ9Ik0xODQgMjEzQTE0MCAxNDAgMCAwMDQ0IDczVjM4YTE3NSAxNzUgMCAwMTE3NSAxNzV6IiBmaWxsPSIjRkZGIi8+PC9zdmc+"
alt="Feed icon"
width="16"
height="16">
<br>
<br>
Learn more about web feeds on <a href="https://en.wikipedia.org/wiki/Web_feed">Wikipedia</a>.
</p>
<hr>
</details>
<details>
<summary>What is FeedVault?</summary>
<p>
FeedVault is a platform crafted to gather, arrange, and preserve information sourced from RSS feeds. It utilizes the <a href="https://github.com/kurtmckee/feedparser">feedparser library by Kurt McKee</a> to parse XML data, storing pertinent details in a Django-managed PostgreSQL database.
</p>
<hr>
</details>
<details>
<summary>Why archive feeds?</summary>
<p>
The web is constantly changing. Websites are redesigned, content is removed, and links are broken. By archiving feeds, we can preserve the content that is published on the web.
</p>
<hr>
</details>
<details>
<summary>How does it work?</summary>
<p>
<ul>
<li>
Parse XML data using the <a href="https://github.com/kurtmckee/feedparser">feedparser</a> library.
</li>
<li>
Sanitize HTML content <a href="https://feedparser.readthedocs.io/en/latest/html-sanitization.html">before</a> saving parsed data to the database.
</li>
<li>Store the sanitized data in a PostgreSQL database using Django's ORM.</li>
<li>
Data is made available through the website and the <a href="/api">API</a>.
</li>
</ul>
</p>
<hr>
</details>
<details>
<summary>How can I access the archived feeds?</summary>
<p>
<ul>
<li>Search for feeds using the top-page search bar.</li>
<li>
Access the archived feeds on the <a href="/feeds">website</a>.
</li>
<li>
Access the archived feeds via the <a href="/api">API</a>.
</li>
<li>
Download database dumps from <a href="">here</a>.
</li>
</ul>
</p>
</details>
<details>
<summary>How can I contribute?</summary>
<p>
<ul>
<li>Add feeds to the archive.</li>
<li>
<a href="https://github.com/TheLovinator1/FeedVault/issues">Report bugs</a> and <a href="https://github.com/TheLovinator1/FeedVault/issues">suggest features</a>.
</li>
<li>
<a href="">Donate</a> to support the project.
</li>
<li>
<a href="">Contribute</a> to the project on GitHub.
</li>
</ul>
</p>
</details>
{% endblock %}