refactor: cleanup

naming and other things
This commit is contained in:
Evan Buss
2024-07-13 19:37:57 +00:00
parent 349e86f0b1
commit 3d4af0bd61
7 changed files with 62 additions and 68 deletions

View File

@@ -92,6 +92,7 @@ func constructLink(url string, entry opds.Entry) LinkViewModel {
return vm
}
func resolveHref(feedUrl string, relativePath string) string {
baseUrl, err := url.Parse(feedUrl)
if err != nil {

View File

@@ -39,11 +39,8 @@ type LoginParams struct {
ReturnURL string
}
func Login(w io.Writer, p LoginParams, partial string) error {
if partial == "" {
partial = "layout.html"
}
return login.ExecuteTemplate(w, partial, p)
func Login(w io.Writer, p LoginParams) error {
return login.Execute(w, p)
}
type FeedParams struct {
@@ -51,14 +48,9 @@ type FeedParams struct {
Feed *opds.Feed
}
func Feed(w io.Writer, p FeedParams, partial string) error {
if partial == "" {
partial = "layout.html"
}
func Feed(w io.Writer, p FeedParams) error {
vm := convertFeed(&p)
return feed.ExecuteTemplate(w, partial, vm)
return feed.Execute(w, vm)
}
type FeedInfo struct {
@@ -66,11 +58,8 @@ type FeedInfo struct {
URL string
}
func Home(w io.Writer, vm []FeedInfo, partial string) error {
if partial == "" {
partial = "layout.html"
}
return home.ExecuteTemplate(w, partial, vm)
func Home(w io.Writer, vm []FeedInfo) error {
return home.Execute(w, vm)
}
func StaticFiles() embed.FS {