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

18
templates/index.tmpl Normal file
View file

@ -0,0 +1,18 @@
{{template "base"}}
{{ define "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">
<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">
<input type="file" name="file" id="file" accept=".opml" required>
<button type="submit">Upload OPML</button>
</form>
{{ end }}