Skip to content

Commit

Permalink
put pronoun examples in meta description for #56
Browse files Browse the repository at this point in the history
  • Loading branch information
morganastra committed Mar 8, 2017
1 parent 3dce2d2 commit b16cf5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pronouns/pages.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions src/pronouns/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

0 comments on commit b16cf5d

Please sign in to comment.