mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Refactor hostname to be a runtime option
Add a `hostname` field under Server in your conf file, see the updated nitter.conf in the repo for an example. The compile-time option (-d:hostname) is no longer used.
This commit is contained in:
parent
3218cc4069
commit
de62eedea5
19 changed files with 91 additions and 85 deletions
|
|
@ -22,7 +22,7 @@ proc createStatusRouter*(cfg: Config) =
|
|||
var error = "Tweet not found"
|
||||
if conversation != nil and conversation.tweet.tombstone.len > 0:
|
||||
error = conversation.tweet.tombstone
|
||||
halt Http404, showError(error, cfg.title)
|
||||
halt Http404, showError(error, cfg)
|
||||
|
||||
let
|
||||
title = pageTitle(conversation.tweet.profile)
|
||||
|
|
@ -32,15 +32,15 @@ proc createStatusRouter*(cfg: Config) =
|
|||
if conversation.tweet.video.isSome():
|
||||
let thumb = get(conversation.tweet.video).thumb
|
||||
let vidUrl = getVideoEmbed(conversation.tweet.id)
|
||||
resp renderMain(html, request, cfg.title, title, desc, images = @[thumb],
|
||||
resp renderMain(html, request, cfg, title, desc, images = @[thumb],
|
||||
`type`="video", video=vidUrl)
|
||||
elif conversation.tweet.gif.isSome():
|
||||
let thumb = get(conversation.tweet.gif).thumb
|
||||
let vidUrl = getVideoEmbed(conversation.tweet.id)
|
||||
resp renderMain(html, request, cfg.title, title, desc, images = @[thumb],
|
||||
resp renderMain(html, request, cfg, title, desc, images = @[thumb],
|
||||
`type`="video", video=vidUrl)
|
||||
else:
|
||||
resp renderMain(html, request, cfg.title, title, desc,
|
||||
resp renderMain(html, request, cfg, title, desc,
|
||||
images=conversation.tweet.photos, `type`="photo")
|
||||
|
||||
get "/@name/status/@id/photo/@i":
|
||||
|
|
|
|||
Loading…
Reference in a new issue