From 5b68923ba960596b98f579c72ff4c1023feb95b3 Mon Sep 17 00:00:00 2001 From: Evan Buss Date: Fri, 5 Jul 2024 00:57:30 -0400 Subject: [PATCH] refactor: simplify template by using a view model Convert the raw OPDS format to a view model that is easier to work with. Biggest change is that we construct a single "Link" from an entry with an array of Links with different "TypeLinks" and "Rel" attributes. --- html/feed.html | 28 ++++++++------- html/html.go | 82 ++++++++++++++++++++++++++++++++++++++++++- html/static/style.css | 3 +- opds/opds.go | 16 +++------ 4 files changed, 104 insertions(+), 25 deletions(-) diff --git a/html/feed.html b/html/feed.html index ff51bbe..2310466 100644 --- a/html/feed.html +++ b/html/feed.html @@ -1,20 +1,24 @@ +{{define "title"}}{{.Title}}{{end}} {{define "content"}}