Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next/Previous post #21

Open
carbontwelve opened this issue Nov 4, 2019 · 4 comments
Open

Next/Previous post #21

carbontwelve opened this issue Nov 4, 2019 · 4 comments
Labels
idea Idea or a discussion

Comments

@carbontwelve
Copy link

It would be nice to have the ability to link to the next/previous post from each post.

@freetonik freetonik added the idea Idea or a discussion label Nov 5, 2019
@carbontwelve
Copy link
Author

carbontwelve commented Nov 7, 2019

If I get some time this month I will work on a PR for this functionality.

In my mind I see it implemented by modifying getMdFiles to return a double linked list (struct) that can then be used by the worker to enable the template to know the previous/next items.

e.g:

type mdFile struct {
    current os.FileInfo
    previous *mdFile
    next *mdFile
}

Then rather than returning []os.FileInfo, getMdFiles would return []mdFile.

@freetonik
Copy link
Owner

This makes perfect sense and seems like an elegant solution.

@carbontwelve
Copy link
Author

Having seen the discussion on categories(#19), the aforementioned mdFile struct could contain a reference for the category/s it's in which can then be used to segment files for each categories index.

@freetonik
Copy link
Owner

Hmm... To be honest, I think this is getting a bit too complicated, as to seemingly defeat the purpose of underblog. I believe prev/next links should not take categories into account, but rather navigate globally, between all posts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Idea or a discussion
Projects
None yet
Development

No branches or pull requests

2 participants