Skip to content

Commit

Permalink
Merge pull request #6 from alysbrooks/add-github-upload
Browse files Browse the repository at this point in the history
Miscellaneous improvements
  • Loading branch information
alysbrooks authored Dec 18, 2024
2 parents 5c5b091 + 36e518b commit 48a3e2b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 33 deletions.
54 changes: 22 additions & 32 deletions src/pronouns/pages.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
[url text]
[:a {:href url} text])

;; FIXME morgan.astra <2018-11-14 Wed>
;; use a div for this instead of a plain bold tag
(defn wrap-pronoun
[pronoun]
[:b pronoun])
[:em pronoun])

(defn render-sentence [& content]
[:p [:span.sentence content]])
Expand Down Expand Up @@ -72,6 +70,21 @@
(wrap-pronoun reflexive)
"."))

(defn page-head [title description]
[:head
[:title title]
[:meta {:name "viewport" :content "width=device-width"}]
[:meta {:charset "utf-8"}]
[:meta {:name "description" :content description}]
;; Twitter previews
[:meta {:name "twitter:card" :content "summary"}]
[:meta {:name "twitter:title" :content title}]
[:meta {:name "twitter:description" :content description}]
;; Open graph
[:meta {:name "og:title" :content title}]
[:meta {:name "og:description" :content description}]
[:link {:rel "stylesheet" :href "/pronouns.css"}]])

(defn header-block [header]
[:div {:class "section title"}
(href "/" [:h1 header])])
Expand Down Expand Up @@ -134,15 +147,7 @@
examples (map #(apply examples-block %) pronoun-declensions)]
(html
[:html
[:head
[:title title]
[:meta {:name "viewport" :content "width=device-width"}]
[:meta {:charset "utf-8"}]
[:meta {:name "description" :content (u/strip-markup examples)}]
[:meta {:name "twitter:card" :content "summary"}]
[:meta {:name "twitter:title" :content title}]
[:meta {:name "twitter:description" :content (u/strip-markup examples)}]
[:link {:rel "stylesheet" :href "/pronouns.css"}]]
(page-head title (u/strip-markup examples))
[:body
(header-block title)
examples
Expand Down Expand Up @@ -174,15 +179,7 @@
description "Pronoun.is is a website for personal pronoun usage examples."]
(html
[:html
[:head
[:title title]
[:meta {:name "description" :content description}]
[:meta {:name "twitter:card" :content "summary"}]
[:meta {:name "twitter:title" :content title}]
[:meta {:name "twitter:description" :content description}]
[:meta {:name "viewport" :content "width=device-width"}]
[:meta {:charset "utf-8"}]
[:link {:rel "stylesheet" :href "/pronouns.css"}]]
(page-head title description)
[:body
(header-block title)
[:div {:class "section table"}
Expand All @@ -195,14 +192,11 @@
(defn all-pronouns []
(let [abbreviations (u/abbreviate @pronouns-table)
links (map make-link abbreviations)
title "Pronoun Island"]
title "Pronoun Island"
description "List of of all personal pronouns known by Pronoun.is"]
(html
[:html
[:head
[:title title]
[:meta {:name "viewport" :content "width=device-width"}]
[:meta {:charset "utf-8"}]
[:link {:rel "stylesheet" :href "/pronouns.css"}]]
(page-head title description)
[:body
(header-block title)
[:div {:class "section table"}
Expand All @@ -215,11 +209,7 @@
or-re #"/[oO][rR]/"]
(html
[:html
[:head
[:title title]
[:meta {:name "viewport" :content "width=device-width"}]
[:meta {:charset "utf-8"}]
[:link {:rel "stylesheet" :href "/pronouns.css"}]]
(page-head nil nil)
[:body
(header-block title)
[:div {:class "section examples"}
Expand Down
2 changes: 1 addition & 1 deletion src/pronouns/web.clj
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@
params/wrap-params))

(defn -main []
(let [port (Integer. (:port env))]
(let [port (Integer. (:port env "8081"))]
(jetty/run-jetty app {:port port})))

0 comments on commit 48a3e2b

Please sign in to comment.