Fixes hardcoded href for OpenSearch xml

This commit is contained in:
Kadin Buckton 2020-01-03 10:17:38 -05:00
parent 8bffb61e68
commit 39d824787a

View file

@ -35,6 +35,12 @@ proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";
elif images.len > 0: "photo" elif images.len > 0: "photo"
else: "article" else: "article"
var opensearchUrl = ""
if cfg.useHttps:
opensearchUrl = "https://" & cfg.hostname & "/opensearch"
else:
opensearchUrl = "http://" & cfg.hostname & "/opensearch"
buildHtml(head): buildHtml(head):
link(rel="stylesheet", `type`="text/css", href="/css/style.css") link(rel="stylesheet", `type`="text/css", href="/css/style.css")
link(rel="stylesheet", `type`="text/css", href="/css/fontello.css") link(rel="stylesheet", `type`="text/css", href="/css/fontello.css")
@ -44,7 +50,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";
link(rel="manifest", href="/site.webmanifest") link(rel="manifest", href="/site.webmanifest")
link(rel="mask-icon", href="/safari-pinned-tab.svg", color="#ff6c60") link(rel="mask-icon", href="/safari-pinned-tab.svg", color="#ff6c60")
link(rel="search", type="application/opensearchdescription+xml", title=cfg.title, link(rel="search", type="application/opensearchdescription+xml", title=cfg.title,
href="http://localhost:8080/opensearch") href=opensearchUrl)
if prefs.hlsPlayback: if prefs.hlsPlayback:
script(src="/js/hls.light.min.js") script(src="/js/hls.light.min.js")