Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
#^{:skip-wiki true}
(:use noir.core
(def header-links [{:url "" :text "Tutorials"}
{:url "" :text "Google Group"}
{:url "" :text "API"}])
(defpartial link [{:keys [url text]}]
(link-to url text))
(defpartial link-item [lnk]
(link lnk)])
(defpartial logo []
(link-to "" (image "/img/noir-logo.png" "Noir")))
(defpartial header []
[:h1 (logo)]
(map link-item header-links)]])
(defpage "/" []
[:p.announce "Noir is up and running... time to start building some websites!"]
"(defpage \"/my-page\" []
[:h1 \"This is my first page!\"]))"]]]
[:p "Time to get going with our first page. Let's open views/welcome.clj
and use (defpage) to add a new page to our site. With that we can go to "
(link-to "http://localhost:8080/my-page" "http://localhost:8080/my-page")
" and see our handiwork."]]]
"(defpartial site-layout [& content]
[:title \"my site\"]]
[:p "We really need a layout for all our pages, so let's create a
partial (a function that returns html). We'll do that
in views/common.clj since all your views will use it."]]]
"(defpage \"/my-page\" []
[:h1 \"Welcome to my site!\"]
[:p \"Hope you like it.\"]))"]]]
[:p "Now we'll update our page to use the layout. Just refresh the browser
and you'll see your change."]]]
[:code "[noir.content.getting-started]"]]
[:p "That's it! You've created your own page. Now get rid of this one simply by
removing the require for getting-started at the top."]]]]))