-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Include page mention excerpt from markdown files in ‘Referred in’ #18
Comments
Ah yeah I'm sure that's possible |
@mathieudutour I would like to solve this, could you give me some pointers? |
So the goal is to add some content here: https://github.com/mathieudutour/gatsby-digital-garden/blob/master/packages/gatsby-theme-garden/src/utils/data-to-note.js#L51 To do so, we need to change the graphql query that get those. Because we support 3 difference types of sources (roam + local files, roam only, files only), there is a bit of a hack to make sure gatsby doesn't crash. So there is 3 different queries, we only need to change 2 of them:
Here we need to change The main thing is to know what is the content we want. If it's the excerpt of the content (the first few lines), it's pretty easy to get it (there is a field in the graphql schema for it). I didn't get around fixing this issue because I wanted the 2nd one - but maybe we can start with the first one and think about the second later. Let me know if that makes no sense |
@mathieudutour If we could extract from the beginning of the paragraph where the page is referenced, that would be really great. Nonetheless, I am also trying to just get just the general excerpt of the source reference note from the graphql. But I cannot figure out why it is always returning
And Not very talented with Gatsby, I would appreciate any other tips that could shine some light. Thanks. |
Would it be possible to include excerpts from markdown files in the ‘Referred in’ section?
Currently, if the mention comes from notes originating from Roam, the parent block with the page mention is shown as a bullet point unter the page title.
But for local markdown files, only the page title is given.
If it is possible to extract and display the sentence or the paragraph where the parent page mention is, or even showing the first paragraph of this parent note as a preview, it would be make ‘Referred in’ more content-rich for markdown files, and also appear to be more consistent with Roam notes.
The text was updated successfully, but these errors were encountered: