emanote
emanote copied to clipboard
Add support for extra navigation with next/prev links
This change enables setting ema:note:next and ema:note:prev template to insert extra navigation link in the page from the metadata.
Hello @srid, with this change I'm trying to setup extra navigation links between notes, for example to suggest the next thing to read. I guess this can be done as part of the note, but I'd like to have a consistent theme similar to the backlinks component so this should be displayed via a template. Also, we might be able to automatically add the prev/next value for chronological notes like for a blog.
Does that sounds like a good idea? I wrote this PR quickly to test this feature for my new video feed, which is presently not very usable since you have to go back to the directory to pick the next note.
Do you have to define next and prev explicitly for each note? Is it not possible to automatically determine them from a listing (query timeline for example)?
Generally a good idead to expose 'next' and 'prev' note to templates, yes.
we might be able to automatically add the prev/next value for chronological notes like for a blog.
Oh right you stated this too. Yes, something like that would be ideal. Basically like how mdBook works (the arrows on bottom of https://omnix.page/om/show.html for example)
Ok that's good to hear, I'll clean-up this initial change, then I'll look into adding the values automatically.
I already tried to implement a lookupSiblingNotes :: Model -> R.LMLRoute -> (Maybe R.LMLRoute, Maybe R.LMLRoute), but I'm not sure how to use the IxNote to get the notes sharing the same parent. Should I just use allRoutes = Set.fromList $ fmap N._noteRoute $ Ix.toList $ model ^. modelNotes and find the prev/next from there?