diff --git a/.air.toml b/.air.toml
index f2cb1f4..aacdfcd 100644
--- a/.air.toml
+++ b/.air.toml
@@ -9,6 +9,7 @@ cmd = "go build -o ./tmp/main.exe ."
delay = 1000
exclude_dir = [
"assets",
+ "static",
"tmp",
"vendor",
"testdata",
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 9fe1c00..294c171 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -16,6 +16,8 @@
"PGPORT",
"PGUSER",
"regexes",
+ "stylesheet",
+ "tmpl",
"webmail"
]
}
diff --git a/main.go b/main.go
index c110333..41c6b41 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,8 @@
package main
import (
+ "fmt"
+ "html/template"
"log"
"net/http"
@@ -10,11 +12,78 @@ import (
func main() {
r := chi.NewRouter()
+ r.Use(middleware.RealIP)
r.Use(middleware.Logger)
- r.Get("/", func(w http.ResponseWriter, _ *http.Request) {
- w.Write([]byte("welcome"))
- })
+ r.Use(middleware.Recoverer)
+ r.Use(middleware.Compress(5))
+ r.Use(middleware.Heartbeat("/ping"))
- log.Println("listening on http://localhost:8000/")
+ r.Get("/", IndexHandler)
+ r.Get("/api", ApiHandler)
+ r.Get("/about", AboutHandler)
+ r.Get("/donate", DonateHandler)
+ r.Get("/feeds", FeedsHandler)
+
+ r.Handle("/static/*", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
+
+ log.Println("Listening on http://localhost:8000/
+ 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.
+ You can also upload .opml files containing the feeds you wish to archive: Here be dragons. Here be dragons.
- tl;dr: GitHub Sponsors
-
- FeedVault is a free service, and will always be free. However, if you wish to support the project, you can do so by donating to the developer.
-
- The money will be used to pay for the server costs, domain name, and other expenses related to running the service.
- Domain name: 12 € / 13 $ / 10 £ per year
- The preferred method of donating is through GitHub Sponsors due to no fees being taken. However, you can also donate through PayPal.
-
- You can also donate through cryptocurrency. The addresses are listed below. If you wish to donate through a cryptocurrency not listed below, please contact me.
-
- bc1qdgm09zzxllzh4m2edyyx7khwhw5mjrwe0d2dws
-
- 83Hft9zJKPNgMrLAZQ7hhTBeJ6v9bJFJ7P7xfWLRDCiyg4QDwstnjc79Fdn5Y8uY5Hfddj52ok9JF8uisU9UXDJjT4Msevx
- Thank you for supporting FeedVault!
+ tl;dr: GitHub Sponsors
+
+ FeedVault is a free service, and will always be free. However, if you wish to support the project, you can do so by donating to the developer.
+
+ The money will be used to pay for the server costs, domain name, and other expenses related to running the service.
+ Domain name: 12 € / 13 $ / 10 £ per year
+ The preferred method of donating is through GitHub Sponsors due to no fees being taken. However, you can also donate through PayPal.
+
+ You can also donate through cryptocurrency. The addresses are listed below. If you wish to donate through a cryptocurrency not listed below, please contact me.
+
+ bc1qdgm09zzxllzh4m2edyyx7khwhw5mjrwe0d2dws
+
+ 83Hft9zJKPNgMrLAZQ7hhTBeJ6v9bJFJ7P7xfWLRDCiyg4QDwstnjc79Fdn5Y8uY5Hfddj52ok9JF8uisU9UXDJjT4Msevx
+ Thank you for supporting FeedVault!
- {% if feed.created %}Added {{ feed.created|date:"F j, Y" }}{% endif %}
- {% if feed.last_updated %}
- {% if feed.created %}·{% endif %}
- Last updated {{ feed.last_updated|date:"F j, Y" }}
- {% endif %}
- No feeds found.
- 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.
- You can also upload .opml files containing the feeds you wish to archive:
- 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:
-
- FeedVault is a platform crafted to gather, arrange, and preserve information sourced from RSS feeds. It utilizes the feedparser library by Kurt McKee to parse XML data, storing pertinent details in a Django-managed PostgreSQL database.
-
- 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.
-
- Feeds to archive
+
+API documentation
- API documentation
+
- {% endif %}
-
-
- FeedVault
-
-
-
- {% block content %}{% endblock %}
-
-
-
-
diff --git a/templates/base.tmpl b/templates/base.tmpl
new file mode 100644
index 0000000..1b0bf29
--- /dev/null
+++ b/templates/base.tmpl
@@ -0,0 +1,70 @@
+{{ define "base" }}
+
+
+
+
+
+
+ {{ if .Description }}{{ end }}
+ {{ if .Keywords }}{{ end }}
+ {{ if .Author }}{{ end }}
+ {{ if .CanonicalURL }}{{ end }}
+
+ FeedVault
+
+
+
+ {{ block "content" . }}{{ end }}
+
+
+
+
+{{ end }}
diff --git a/templates/donate.html b/templates/donate.html
deleted file mode 100644
index 2824830..0000000
--- a/templates/donate.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{% extends "base.html" %}
-{% block title %}Donate
- What will the money be used for?
- How much does it cost to run FeedVault?
- How can I donate?
- Crypto
- Bitcoin
- Monero
- Thank you!
- Donate
+What will the money be used for?
+How much does it cost to run FeedVault?
+How can I donate?
+Crypto
+Bitcoin
+Monero
+Thank you!
+
-
- {% if feed.title %}
- {{ feed.title }}
- {% else %}
- {{ feed.url }}
- {% endif %}
-
-
- Feeds to archive
-
-
- What are web feeds?
-
-
-
- Learn more about web feeds on Wikipedia.
-
- What is FeedVault?
-
- Why archive feeds?
-
- How does it work?
-
-
-
-
- --
+ 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. +
+ +You can also upload .opml files containing the feeds you wish to archive:
+ +{{ end }}