Auto adding formatted next/prev links to posts #564
-
Hi, Happy Hugo Ananke user here (as a git submodule). My site code is all here: For this question I have specifically tweaked single.html to automagically add links to the bottom of every post to the previous and next posts in that section (if there is one). You can see the changes on lines 66-72 here. It appears to be working correctly with Next and Previous section links taking me to the correct places and only displaying links when they exist. So no previous link on the first post and no next link on the last post. However, as you can see, on a desktop screen, they are not formatted "nicely". I'd like the Previous link to be left justified (seems to be center) and Next link, right justified, which it appears to be. Any tips on how to do that? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Played around with it a bit more and I think I have it. Not sure if this is a bad idea but it seems to work. I just wrapped the next and previous section post links in a text-aligned table that uses 100% of the page width. Also changed it to have next/prev links at the top and bottom of the post pages. |
Beta Was this translation helpful? Give feedback.
-
Tidied this up a lot more. Code is here. See it in action here (top and bottom of every article). If the |
Beta Was this translation helpful? Give feedback.
Played around with it a bit more and I think I have it. Not sure if this is a bad idea but it seems to work. I just wrapped the next and previous section post links in a text-aligned table that uses 100% of the page width. Also changed it to have next/prev links at the top and bottom of the post pages.