summaryrefslogtreecommitdiff
path: root/bin/serve.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/serve.fnl')
-rw-r--r--bin/serve.fnl24
1 files changed, 13 insertions, 11 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl
index 8cdd673..5cfc535 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -393,14 +393,14 @@
[:nav {:class (.. "menu" (if (str.empty? extra-class)
""
(.. " " extra-class)))}
- (item "/red-tea" "Красный чай")
- (item "/sheng-puer" "Шен пуэр")
- (item "/shou-puer" "Шу пуэр")
- (item "/oolong" "Улун")
- (item "/green-tea" "Зеленый чай")
- (item "/white-tea" "Белый чай")
- (item "/yellow-tea" "Желтый чай")
- (item "/teaware" "Посуда")])
+ (item "/red-tea" "Красный чай")
+ (item "/sheng-puer" "Шен пуэр")
+ (item "/shou-puer" "Шу пуэр")
+ (item "/oolong" "Улун")
+ (item "/green-tea" "Зеленый чай")
+ (item "/white-tea" "Белый чай")
+ (item "/yellow-tea" "Желтый чай")
+ (item "/teaware" "Посуда")])
(fn aside-template [form path aside-content]
[:aside {:class "aside"}
@@ -414,7 +414,10 @@
(menu-template path "menu-mobile")
[:form {:class "form"}
[:input {:type :search :name "query" :value form.query
- :autofocus true :placeholder "Поисковый запрос"}]
+ ;; autofocus makes browser scroll up to the input on reloads
+ ;; and that doesn't work well with _G.reload
+ :autofocus (if luna.debug nil true)
+ :placeholder "Поисковый запрос"}]
[:div {}
[:select {:name "tags"}
[:option {:value ""} "~ Тег ~"]
@@ -564,8 +567,7 @@
(cache.set db cache-key
(.. "<!DOCTYPE html>\n" (html.render page true)))))
- ;; TODO: if !dev && cached
- (if cached
+ (if (and (not luna.debug) cached)
(values 200 {:content-type "text/html"} cached)
(do
(local form (collect-form query))