diff options
author | Morgan <m@morganastra.me> | 2015-03-14 00:35:43 -0700 |
---|---|---|
committer | Morgan <m@morganastra.me> | 2015-03-14 00:35:43 -0700 |
commit | 98e7444f18da961af397bfc08cd1e67186bfa282 (patch) | |
tree | 8247581d15c617c7e6086cdecfc0cc99a7016434 /src/pronouns/pages.clj | |
parent | 2a78ab1eb05c5aa7203df769a7a696c2ce987bb7 (diff) | |
parent | f74fa10cbb3f29ae8fa9e7b29e827e688b6c8ceb (diff) |
Merge pull request #8 from non/topic/pronoun-list
Add support for a global pronoun list at /.
Diffstat (limited to 'src/pronouns/pages.clj')
-rw-r--r-- | src/pronouns/pages.clj | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index f380542..b3ad43a 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -78,8 +78,25 @@ (take 5 inputs) (u/table-lookup inputs pronouns-table)))) -(defn front [] - (str "pronoun.is is a www site for showing people how to use pronouns")) +;; we could choose to display the entire row for the label. +;; currently the first two entries are enough to disambiguate the +;; pronouns -- will that always be true? +(defn make-link [row] + (let [link (str "/" (s/join "/" row)) + label (str (first row) "/" (first (rest row)))] + [:li [:a {:href link} label]])) + +(defn front [pronouns-table] + (let [links (map make-link (sort pronouns-table))] + (html + [:html + [:head + [:title "Main Page"] + [:link {:rel "stylesheet" :href "/pronouns.css"}]] + [:body + [:p "pronoun.is is a www site for showing people how to use pronouns"] + [:p "here are some pronouns the site knows about:"] + [:ul links]]]))) (defn not-found [] (str "We couldn't find those pronouns in our database, please ask us to " |