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

Add support for extra navigation with next/prev links #553

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TristanCacqueray
Copy link
Contributor

This change enables setting ema:note:next and ema:note:prev template to insert extra navigation link in the page from the metadata.

This change enables setting ema:note:next and ema:note:prev template to
insert extra navigation link in the page from the metadata.
@TristanCacqueray TristanCacqueray marked this pull request as draft September 30, 2024 21:51
@TristanCacqueray
Copy link
Contributor Author

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.

@srid
Copy link
Owner

srid commented Sep 30, 2024

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.

@srid
Copy link
Owner

srid commented Sep 30, 2024

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)

@TristanCacqueray
Copy link
Contributor Author

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?

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

Successfully merging this pull request may close these issues.

2 participants