forked from Ivasoft/opds-proxy
We now allow multiple OPDS feeds to be pre-defined and displayed on the homepage. As a result we need to pass the feed navigation URLs via query parameter rather than a subpath which would only support proxying to a single OPDS feed. The feed is passed via the q= query parameter and any relative links from the OPDS XML are resolved to a complete URL with domain / scheme. We also check the "Content-Type" header in the response received from the OPDS feed to determine whether to parse an OPDS catalog or just proxy the raw response back (images / files).
54 lines
1.2 KiB
HTML
54 lines
1.2 KiB
HTML
{{define "title"}}{{.Title}}{{end}} {{define "content"}}
|
|
|
|
<nav class="navigation">
|
|
{{if .Search }}
|
|
<div class="search">
|
|
<a href="{{.Search}}" tabindex="-1">
|
|
<svg
|
|
width="30"
|
|
height="30"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
/>
|
|
</svg>
|
|
</a>
|
|
</div>
|
|
{{end}}
|
|
|
|
<div class="nav-controls">
|
|
<a tabindex="-1" href="/">Home</a>
|
|
{{range .Navigation}}
|
|
<a tabindex="-1" href="?q={{.Href}}">{{.Label}}</a>
|
|
{{end}}
|
|
</div>
|
|
</nav>
|
|
|
|
<ul>
|
|
{{range .Links}}
|
|
<li class="link">
|
|
{{if .ImageURL}}
|
|
<img src="?q={{.ImageURL}}" alt="{{.Title}}" height="40" />
|
|
{{end}}
|
|
|
|
<div class="info">
|
|
{{if .IsDownload}}
|
|
<a href="?q={{.Href}}" download>{{.Title}}</a>
|
|
{{else}}
|
|
<a href="?q={{.Href}}">{{.Title}}</a>
|
|
{{end}}
|
|
<p>{{.Author}}</p>
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
{{end}}
|