Luke Plant  committed 89ae4cf

Improved feed links - every page has the link to 'all blog posts', and titles for other feeds set correctly.

  • Participants
  • Parent commits 5aa538d
  • Branches default

Comments (0)

Files changed (2)

File src/Blog/Views.hs

 import qualified Blog.Post as P
 import qualified Blog.Settings as Settings
 import qualified Data.Map as Map
-import qualified Data.ByteString.Lazy as LB
+import qualified Data.ByteString.Lazy.Char8 as LB
 import qualified Data.Text.Lazy as LT
 import qualified Data.Text.Lazy.Encoding as LT
 import qualified Text.XHtml as X
         t2 = setAttribute "csrffield" csrffield template
         qs = formEncode (allGET req)
         t3 = setAttribute "currentpath" (urlEncode (Settings.root_url ++ pathInfo req ++ (if not $ null qs then "?" ++ qs else ""))) t2
-        rendered = render t3
+        t4 = setAttribute "allpostsfeedurl" allPostsFeedUrl t3
+        rendered = render t4
     in buildResponse [ addContent rendered
                      ] utf8HtmlResponse
               ("posts", map postTemplateInfo posts)
               ("categories", map (map categoryTemplateInfo) cats)
               ("paginglinks", pagingLinks indexUrl curpage more)
-              ("atomfeedurl", allPostsFeedUrl)
 -- Feed for all posts
                        ("titles", map (P.title . snd) commentsAndPosts)
                        ("paginglinks", pagingLinks allCommentsUrl curpage more)
                        ("atomfeedurl", allCommentsFeedUrl)
+                       ("atomfeedtitle", "All comments in this blog")
 allCommentsFeedView req = do
                           ("categories", map (map categoryTemplateInfo) cats)
                           ("paginglinks", pagingLinks (categoryUrl cat) curpage more)
                           ("atomfeedurl", categoryPostsFeedUrl cat)
+                          ("atomfeedtitle", LB.pack "All posts in category " `LB.append` cat)
 categoryPostsFeedView slug req = do
                         ("formatWidget", X.toHtml $ formatWidgetForComment commentData)
                         ("commentExtra", commentExtra)
                         ("atomfeedurl", postCommentFeedUrl post)
-                        ("atomfeedtitle", "Atom feed for comments in this post")
+                        ("atomfeedtitle", "All comments on this post")
                         ("editpageurl", adminEditPostUrl post)

File src/templates/

 <html lang="en">
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <link rel="alternate" type="application/atom+xml" title="All posts in this blog" href="$allpostsfeedurl$">
     <link rel="alternate" type="application/atom+xml" title="$if(atomfeedtitle)$$atomfeedtitle$$else$Atom feed$endif$" href="$atomfeedurl$">