Support ?theme= url parameter

Fixes #84
This commit is contained in:
Zed 2019-12-06 08:21:37 +01:00
commit fddf1d510a
2 changed files with 8 additions and 2 deletions

View file

@ -44,3 +44,10 @@ proc createPrefRouter*(cfg: Config) =
cache(prefs)
savePrefs()
redirect(refPath())
before:
if @"theme".len > 0:
var prefs = cookiePrefs()
prefs.theme = @"theme".capitalizeAscii.replace("_", " ")
cache(prefs)
savePrefs()