diff options
Diffstat (limited to 'bin/serve.fnl')
| -rw-r--r-- | bin/serve.fnl | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl index ad53afc..1fc7bd9 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -449,20 +449,39 @@ (table.unpack (map #(item-template $2) (teas-of-the-day 10)))]])]) (fn base-template [form path content aside-content] + (local title (if (str.empty? form.query) + texts.meta-title + (.. form.query " | " texts.meta-title))) + (local canonical-url (str.trim (.. "https://everytea.ru" path) "/")) [:html {:lang "ru-RU"} [:head {} [:meta {:charset "utf-8"}] - [:meta {:name "viewport" :content "width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=5.0"}] + [:meta {:name "viewport" + :content (.. "width=device-width,initial-scale=1," + "minimum-scale=1.0,maximum-scale=5.0")}] + ;; opengraph + [:meta {:property "og:title" :content title}] + [:meta {:property "og:description" :content texts.meta-description}] + [:meta {:property "og:type" :content "website"}] + [:meta {:property "og:url" :content canonical-url}] + [:meta {:property "og:image" + :content "https://everytea.ru/static/og:image.png"}] + [:meta {:property "twitter:image" + :content "https://everytea.ru/static/og:image.png"}] + [:meta {:property "vk:image" + :content "https://everytea.ru/static/og:image.png"}] + [:meta {:property "og:image:width" :content "1200"}] + [:meta {:property "og:image:height" :content "630"}] + [:meta {:property "twitter:card" :content "summary_large_image"}] + [:meta {:property "og:locale" :content "ru_RU"}] + ;; inline styles so the page loads faster [:style {} [:NO-ESCAPE (fs.read-file "static/style.css")]] - [:link {:rel "icon" :href "/static/favicon.png"}] + [:link {:rel "icon" :href "https://everytea.ru/static/favicon.png"}] [:link {:rel "preload" :fetchpriority "high" :as "image" :href "/static/logo-hor.svg" :type "image/svg+xml"}] - [:link {:rel "canonical" - :href (str.trim (.. "https://everytea.ru" path) "/")}] - [:title {} (if (str.empty? form.query) - texts.meta-title - (.. form.query " | " texts.meta-title))] + [:link {:rel "canonical" :href canonical-url}] + [:title {} title] [:meta {:name "description" :content texts.meta-description}]] [:body {} [:div {:class "container"} |
