Fixed blog pagination link issue
See TODO.org for more details Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This commit is contained in:
parent
b8b003f103
commit
5e9ff21813
5
TODO.org
5
TODO.org
|
@ -23,7 +23,7 @@
|
|||
In order to implement this, a reasonable size refactor needs to take place. Below is a list
|
||||
of things to be completed in order to successfully achieve the aforementioned goals.
|
||||
|
||||
*** TODO [1/3] Fix issue with tag and pagination page generation <<link issue>>
|
||||
*** TODO [2/3] Fix issue with tag and pagination page generation <<link issue>>
|
||||
Currently URLs to paginated pages (which includes the blog and tag pages) are broken. They
|
||||
generate "/tags/*.html" instead of "/tags/*1.html".
|
||||
|
||||
|
@ -33,7 +33,8 @@
|
|||
artifact of pagination. It contains all blog posts (contained in "/blog1.html" through
|
||||
"/blogN.html").
|
||||
|
||||
**** TODO Blog pagination
|
||||
**** DONE Blog pagination
|
||||
CLOSED: [2015-08-15 Sat 05:21]
|
||||
**** DONE Tag pages pagination
|
||||
CLOSED: [2015-08-13 Thu 22:26]
|
||||
**** TODO Tag cloud and tagField are broken
|
||||
|
|
15
src/site.hs
15
src/site.hs
|
@ -187,11 +187,14 @@ main = do
|
|||
-- Generate tag pages
|
||||
paginateTagsRules "tags" tags
|
||||
|
||||
let navgenRoute = gsubRoute "pages/" (const "") `composeRoutes`
|
||||
setExtension "html"
|
||||
let pageRoute = gsubRoute "pages/" (const "") `composeRoutes` setExtension "html"
|
||||
|
||||
match "pages/*" $ version "nav-gen" $ do
|
||||
route navgenRoute
|
||||
match ("pages/*" .&&. complement "pages/blog.markdown") $ version "nav-gen" $ do
|
||||
route $ pageRoute
|
||||
compile $ pandocCompiler
|
||||
|
||||
match "pages/blog.markdown" $ version "nav-gen" $ do
|
||||
route $ constRoute "blog1.html"
|
||||
compile $ pandocCompiler
|
||||
|
||||
paginateRules paginatedPosts $ \pageNum pattern -> do
|
||||
|
@ -209,8 +212,8 @@ main = do
|
|||
>>= loadAndApplyTemplate "templates/pages/blog.html" ctx
|
||||
>>= loadAndApplyTemplate "templates/default.html" indexCtx
|
||||
|
||||
match "pages/*" $ do
|
||||
route navgenRoute
|
||||
match ("pages/*" .&&. complement "pages/blog.markdown") $ do
|
||||
route $ pageRoute
|
||||
compile $ do
|
||||
posts <- recentFirst =<< loadAllSnapshots "posts/**" "content"
|
||||
|
||||
|
|
Loading…
Reference in New Issue