diff --git a/src/application-globals.rkt b/src/application-globals.rkt index 49ea436..f7d9d67 100644 --- a/src/application-globals.rkt +++ b/src/application-globals.rkt @@ -26,7 +26,7 @@ `(html (head (meta (@ (name "viewport") (content "width=device-width, initial-scale=1"))) - (title ,(format "~a | ~a" title (config-get 'application-name))) + (title ,(format "~a | ~a" title (config-get 'application_name))) (style ":root { --theme-page-background-color: #dfdfe0 }") ; fallback in case styles don't load fast enough ,@(map (λ (url) `(link (@ (rel "stylesheet") (type "text/css") (href ,url)))) @@ -53,22 +53,22 @@ (img (@ (class "my-logo") (src "/static/breezewiki.svg")))) (p (a (@ (href "https://gitdab.com/cadence/breezewiki")) - ,(format "~a source code" (config-get 'application-name)))) + ,(format "~a source code" (config-get 'application_name)))) (p (a (@ (href "https://lists.sr.ht/~cadence/breezewiki-discuss")) "Discussions / Bug reports / Feature requests")) - ,(if (config-get 'instance-is-official) - `(p ,(format "This instance is run by the ~a developer, " (config-get 'application-name)) + ,(if (config-get 'instance_is_official) + `(p ,(format "This instance is run by the ~a developer, " (config-get 'application_name)) (a (@ (href "https://cadence.moe/contact")) "Cadence.")) `(p - ,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application-name))))) + ,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application_name))))) (div (p "This page displays proxied content from " (a (@ (href ,source-url) (rel "noreferrer")) ,source-url) ". Text content is available under the Creative Commons Attribution-Share Alike License 3.0 (Unported), " (a (@ (href "https://www.fandom.com/licensing")) "see license info.") " Media files may have different copying restrictions.") - (p ,(format "Fandom is a trademark of Fandom, Inc. ~a is not affiliated with Fandom." (config-get 'application-name)))))))))))) + (p ,(format "Fandom is a trademark of Fandom, Inc. ~a is not affiliated with Fandom." (config-get 'application_name)))))))))))) (module+ test (check-not-false (xexp->html (generate-wiki-page "" "test" "test" '(template))))) diff --git a/src/config.rkt b/src/config.rkt index 8e785ec..38433f9 100644 --- a/src/config.rkt +++ b/src/config.rkt @@ -16,10 +16,11 @@ (hash-ref config key)) (define default-config - '((port . "10416") + '((application_name . "BreezeWiki") + (canonical_origin . "") (debug . "false") - (instance-is-official . "false") ; please don't turn this on, or you will make me very upset - (application-name . "BreezeWiki"))) + (instance_is_official . "false") ; please don't turn this on, or you will make me very upset + (port . "10416"))) (define config (make-hasheq diff --git a/src/page-category.rkt b/src/page-category.rkt index 83f0f03..bfc689f 100644 --- a/src/page-category.rkt +++ b/src/page-category.rkt @@ -59,7 +59,7 @@ (define data (easy:response-json dest-res)) (define body (generate-results-page dest-url wikiname prefixed-category data)) - (when (config-get 'debug) + (when (config-true? 'debug) ; used for its side effects ; convert to string with error checking, error will be raised if xexp is invalid (xexp->html body)) diff --git a/src/page-home.rkt b/src/page-home.rkt index 4a87a1b..102ab68 100644 --- a/src/page-home.rkt +++ b/src/page-home.rkt @@ -56,20 +56,20 @@ (footer (@ (class "custom-footer")) (div (@ (class "internal-footer")) (img (@ (class "my-logo") (src "/static/breezewiki.svg"))) - ,(if (config-get 'instance-is-official) + ,(if (config-get 'instance_is_official) `(div - (p ,(format "This instance is run by the ~a developer, " (config-get 'application-name)) + (p ,(format "This instance is run by the ~a developer, " (config-get 'application_name)) (a (@ (href "https://cadence.moe/contact")) "Cadence.")) (p "Hosting generously provided by " (a (@ (href "http://alphamethyl.barr0w.net/")) "alphamethyl."))) `(p - ,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application-name)))) + ,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application_name)))) (p "Text content on wikis run by Fandom is available under the Creative Commons Attribution-Share Alike License 3.0 (Unported), " (a (@ (href "https://www.fandom.com/licensing")) "see license info.") " Media files and official Fandom documents have different copying restrictions.") - (p ,(format "Fandom is a trademark of Fandom, Inc. ~a is not affiliated with Fandom." (config-get 'application-name))))))))))) + (p ,(format "Fandom is a trademark of Fandom, Inc. ~a is not affiliated with Fandom." (config-get 'application_name))))))))))) (module+ test (check-not-false (xexp->html body)))