diff --git a/src/views/general.nim b/src/views/general.nim
index 78b8fe9..e1ed4da 100644
--- a/src/views/general.nim
+++ b/src/views/general.nim
@@ -88,13 +88,15 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
else:
text cfg.title
+ let finalizedTitleText = (if ogTitle.len > 0: ogTitle else: titleText)
+
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="theme-color", content="#1F1F1F")
meta(property="og:type", content=ogType)
if video.len > 0:
meta(property="og:title", content=stripHtml(desc))
else:
- meta(property="og:title", content=(if ogTitle.len > 0: ogTitle else: titleText))
+ meta(property="og:title", content=finalizedTitleText)
meta(property="og:description", content=stripHtml(desc))
meta(property="og:site_name", content="Nitter")
meta(property="og:locale", content="en_US")
@@ -122,9 +124,9 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
meta(property="og:video:url", content=video)
meta(property="og:video:secure_url", content=video)
meta(property="og:video:type", content="video/mp4")
- verbatim &" 0: ogTitle else: titleText)}\" type=\"application/json+oembed\" />"
+ verbatim &""
#link(rel="alternate",
- # href=getUrlPrefix(cfg) & "/oembed.json?type=video&title=" & encodeUrl(stripHtml(desc)) & "&user=" & encodeUrl(if ogTitle.len > 0: ogTitle else: titleText),
+ # href=&"{getUrlPrefix(cfg)}/oembed.json?type=video&title={encodeUrl(stripHtml(desc))}&user={encodeUrl(finalizedTitleText)}&url={encodeUrl(req.path)}",
# `type`="application/json+oembed")
# this is last so images are also preloaded