From b16cf5d7c9f9f7ebfc7655da10355094eb58c660 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 8 Mar 2017 12:30:45 -0800 Subject: [PATCH] put pronoun examples in meta description for #56 --- src/pronouns/pages.clj | 6 ++++-- src/pronouns/util.clj | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index a9301e3..4940207 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -118,16 +118,18 @@ (defn format-pronoun-examples [pronoun-declensions] (let [sub-objs (map #(s/join "/" (take 2 %)) pronoun-declensions) - title (str "Pronoun Island: " (prose-comma-list sub-objs) " examples")] + title (str "Pronoun Island: " (prose-comma-list sub-objs) " examples") + examples (map #(apply examples-block %) pronoun-declensions)] (html [:html [:head [:title title] [:meta {:name "viewport" :content "width=device-width"}] + [:meta {:name "description" :content (u/strip-markup examples)}] [:link {:rel "stylesheet" :href "/pronouns.css"}]] [:body (header-block title) - (map #(apply examples-block %) pronoun-declensions) + examples (footer-block)]]))) (defn lookup-pronouns [pronouns-string] diff --git a/src/pronouns/util.clj b/src/pronouns/util.clj index a000201..3db3c35 100644 --- a/src/pronouns/util.clj +++ b/src/pronouns/util.clj @@ -103,3 +103,7 @@ is already in a sequence for which vector? is false, this will add another layer of nesting." (if (vector? x) x [x])) + +(defn strip-markup [form] + (s/join " " (filter string? (flatten form)))) +