diff options
author | Morgan Astra <m@morganastra.me> | 2017-03-08 12:30:45 -0800 |
---|---|---|
committer | Morgan Astra <m@morganastra.me> | 2017-03-08 12:30:45 -0800 |
commit | b16cf5d7c9f9f7ebfc7655da10355094eb58c660 (patch) | |
tree | 82b4c1835b07275c1f339c950e80f74b55a57178 /src/pronouns | |
parent | 3dce2d2daee7b748b37645678428ecb95c6af37a (diff) |
put pronoun examples in meta description for #56
Diffstat (limited to 'src/pronouns')
-rw-r--r-- | src/pronouns/pages.clj | 6 | ||||
-rw-r--r-- | 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 @@ <x> 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)))) + |