New option: promotions::indie_wiki_buddy
This commit is contained in:
parent
b5fb99c8ab
commit
040d9b94de
3 changed files with 28 additions and 6 deletions
|
@ -62,10 +62,19 @@
|
|||
(p
|
||||
(a (@ (href "https://lists.sr.ht/~cadence/breezewiki-discuss"))
|
||||
"Chat / Bug reports / Feature requests"))
|
||||
,(if (config-member? 'promotions::indie_wiki_buddy "footer")
|
||||
`(p
|
||||
(a (@ (href "https://getindie.wiki/"))
|
||||
"Get Indie Wiki Buddy browser extension - be redirected to BreezeWiki every time!"))
|
||||
"")
|
||||
,(if (config-true? 'instance_is_official)
|
||||
`(p ,(format "This instance is run by the ~a developer, " (config-get 'application_name))
|
||||
(a (@ (href "https://cadence.moe/contact"))
|
||||
"Cadence."))
|
||||
"Cadence")
|
||||
". Proudly hosted by "
|
||||
(a (@ (href "http://alphamethyl.barr0w.net"))
|
||||
"Barrow Network Solutions" (sup "XD"))
|
||||
".")
|
||||
`(p
|
||||
,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application_name)))))
|
||||
,(if source-url
|
||||
|
@ -201,6 +210,7 @@
|
|||
,(let ([extension-eligible?
|
||||
(cond/var
|
||||
[(not req) #f]
|
||||
[(not (config-member? 'promotions::indie_wiki_buddy "banner")) #f]
|
||||
(var ua-pair (assq 'user-agent (request-headers req)))
|
||||
[(not ua-pair) #f]
|
||||
(var ua (string-downcase (cdr ua-pair)))
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
(provide
|
||||
config-parameter
|
||||
config-true?
|
||||
config-member?
|
||||
config-get)
|
||||
|
||||
(module+ test
|
||||
|
@ -23,6 +24,11 @@
|
|||
(define (config-true? key)
|
||||
(not (member ((config-parameter key)) '("" "false"))))
|
||||
|
||||
(: config-member? (Symbol String [#:sep String] -> Boolean))
|
||||
(define (config-member? key item #:sep [sep #px"\\s+"])
|
||||
(and (config-true? key)
|
||||
(not (not (member item (string-split (config-get key) sep))))))
|
||||
|
||||
(: config-get (Symbol -> String))
|
||||
(define (config-get key)
|
||||
((config-parameter key)))
|
||||
|
@ -42,7 +48,9 @@
|
|||
(feature_offline::format . "json.gz")
|
||||
(feature_offline::only . "false")
|
||||
|
||||
(access_log::enabled . "false")))
|
||||
(access_log::enabled . "false")
|
||||
|
||||
(promotions::indie_wiki_buddy . "banner home")))
|
||||
|
||||
(define loaded-alist
|
||||
(with-handlers
|
||||
|
@ -109,8 +117,10 @@
|
|||
(module+ test
|
||||
; this is just a sanity check
|
||||
(parameterize ([(config-parameter 'application_name) "JeffWiki"]
|
||||
[(config-parameter 'strict_proxy) ""])
|
||||
[(config-parameter 'strict_proxy) ""]
|
||||
[(config-parameter 'promotions::indie_wiki_buddy) "a b c"])
|
||||
(check-equal? (config-get 'application_name) "JeffWiki")
|
||||
(check-false (config-true? 'strict_proxy))
|
||||
(check-equal? (string? (config-get 'feature_offline::format)) #t)))
|
||||
(check-equal? (string? (config-get 'feature_offline::format)) #t)
|
||||
(check-true (config-member? 'promotions::indie_wiki_buddy "b"))))
|
||||
|
||||
|
|
|
@ -31,8 +31,10 @@
|
|||
(url-host (string->url (config-get 'canonical_origin)))
|
||||
"breezewiki.com")))
|
||||
(p "If you'd like to be automatically sent to BreezeWiki every time in the future, "
|
||||
(a (@ (href "https://getindie.wiki")) "get our affiliated browser extension (NEW!)")
|
||||
" or "
|
||||
,@(if (config-member? 'promotions::indie_wiki_buddy "home")
|
||||
`((a (@ (href "https://getindie.wiki")) "get our affiliated browser extension (NEW!)")
|
||||
" or ")
|
||||
null)
|
||||
(a (@ (href "https://docs.breezewiki.com/Automatic_Redirection.html")) "check out the tutorial in the manual."))
|
||||
(p "BreezeWiki is available on several different websites called " (a (@ (href "https://en.wikipedia.org/wiki/Mirror_site")) "mirrors") ". Each is independently run. If one mirror is offline, the others still work. "
|
||||
(a (@ (href "https://docs.breezewiki.com/Links.html#%28part._.Mirrors%29")) "See the list."))
|
||||
|
|
Loading…
Reference in a new issue