Skip to content

Instantly share code, notes, and snippets.

@AlexBaranosky
Created September 12, 2014 04:35
Show Gist options
  • Save AlexBaranosky/21ff994ec4ff3889440c to your computer and use it in GitHub Desktop.
Save AlexBaranosky/21ff994ec4ff3889440c to your computer and use it in GitHub Desktop.
(require '[hiccup.core :as hiccup])
(def nav-links [{:url "a.html"
:text "Resume"}
{:url "b.html"
:text "Blog"}
{:url "c.html"
:text "About"}])
(defn nav-hiccup [nav-links]
[:div#nav
[:ul
(for [{:keys [url text]} nav-links]
[:li [:a {:href url} text]])]])
(defn page-hiccup [nav content]
[:html
[:header]
[:body
nav
content]
[:footer]])
(defn page [content]
(page-hiccup (nav-hiccup nav-links)
content))
(defn homepage []
(hiccup/html
(page "Welcome to my website!")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment