Open omarcostahamido opened 1 year ago
to start hinting at an answer to myself, i think all the magic is on https://github.com/maximevaillancourt/digital-garden-jekyll-template/blob/main/_plugins/bidirectional_links_generator.rb now, if only i could understand all of it...
Your last comment is correct: bidirectional_links_generator.rb
is indeed where the magic happens, specifically on this line:
The above works because I defined a collection named notes
here:
If you want to add a collection named database
, try changing the above to this:
collections:
notes:
output: true
permalink: /:slug
database:
output: true
permalink: /database/:slug
Then, in bidirectional_links_generator.rb
, update line 7 (from the first code snippet) to this:
all_notes = site.collections['notes'].docs + site.collections['datbase'].docs
Good luck!
Hey Maxime, Extending on the question, regarding the backlinks:
I am not quite familiar with Ruby syntax and I've been trying to implement my backlinks algorithm in JS. As far as I understood from your code, you basically dump all the posts to all_notes and then scan this dump for the current note.url for every single note and put them in notes_linking_to_current_note for each note.
Afterwards, you write it to that note's frontmatter with:
current_note.data['backlinks'] = notes_linking_to_current_note
Am I correct? _I assume frontmatter of markdown files are stored in currentnote.data object.
Thanks in advance!
this is me not knowing enough about jekyll.
I have made a new collection named
_database
where i will host several pages. Now they are linked using the[[ ]]
technique, which works just fine on obsidian, but the problem is... they don't work on the live website! I've added the collection on_config.yml
as such:but still no good. they just show up as
[[ not linked yeah? ]]
with the brackets showing! (ugly much).I've experimented enough (naively so, perhaps) to know that if I just make it a category, as in make the pages inside a
database
folder instead of a_database
folder, it just works. 🤯 Now the problem is that I do need the collection feature because I want to be able to iterate through its items...Sorry for noise. I appreciate if someone who knows their way around jekyll and this template could help me 🙏
Best,