search-remove-accents config should default to existing behavior

Also start a default-config to start a data-first approach
to config
pull/6199/head
Gabriel Horner 2022-08-02 12:48:45 -04:00
parent da6ba03ca3
commit 01c8f41b61
1 changed files with 10 additions and 6 deletions

View File

@ -297,17 +297,22 @@
(when-not (mobile-util/native-platform?)
"local")))
(def default-config
"Default config for a repo-specific, user config"
{:feature/enable-search-remove-accents? true
:default-arweave-gateway "https://arweave.net"})
(defn get-config
"User config for the given repo or current repo if none given"
([]
(get-config (get-current-repo)))
([repo-url]
(get-in @state [:config repo-url])))
(def default-arweave-gateway "https://arweave.net")
(merge default-config
(get-in @state [:config repo-url]))))
(defn get-arweave-gateway
[]
(:arweave/gateway (get-config) default-arweave-gateway))
(:arweave/gateway (get-config)))
(defonce built-in-macros
{"img" "[:img.$4 {:src \"$1\" :style {:width $2 :height $3}}]"})
@ -1702,5 +1707,4 @@
(defn enable-search-remove-accents?
[]
(:feature/enable-search-remove-accents?
(get (sub-config) (get-current-repo))))
(:feature/enable-search-remove-accents? (get-config)))