Hamlet 0.7

This commit is contained in:
Michael Snoyman 2011-02-05 20:24:58 +02:00
parent 9d25af66bb
commit 2eac2738c9

View File

@ -26,7 +26,7 @@ module Yesod.Helpers.Sitemap
import Yesod.Content (RepXml (..), RepPlain (..), toContent, formatW3) import Yesod.Content (RepXml (..), RepPlain (..), toContent, formatW3)
import Yesod.Handler (Route, GHandler, getUrlRender) import Yesod.Handler (Route, GHandler, getUrlRender)
import Yesod.Widget (hamletToContent) import Yesod.Handler (hamletToContent)
import Text.Hamlet (Hamlet, xhamlet) import Text.Hamlet (Hamlet, xhamlet)
import Data.Time (UTCTime) import Data.Time (UTCTime)
@ -61,13 +61,14 @@ template urls =
#else #else
[$xhamlet| [$xhamlet|
#endif #endif
%urlset!xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" <div id="endif">
$forall urls url <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
%url $forall url <- urls
%loc @sitemapLoc.url@ <url>
%lastmod $formatW3.sitemapLastMod.url$ <loc>@{sitemapLoc url}
%changefreq $showFreq.sitemapChangeFreq.url$ <lastmod>#{formatW3 (sitemapLastMod url)}
%priority $show.priority.url$ <changefreq>#{showFreq (sitemapChangeFreq url)}
<priority>#{show (priority url)}
|] |]
sitemap :: [SitemapUrl (Route master)] -> GHandler sub master RepXml sitemap :: [SitemapUrl (Route master)] -> GHandler sub master RepXml