hikerpig / foam-template-gatsby-kb

A Foam/Obsidian template using gatsby-theme-kb for publishing your knowledge base
https://foam-template-gatsby-kb.hikerpig.vercel.app
60 stars 13 forks source link

Links reload page since changes from 02/21 #2

Closed GBrachetta closed 3 years ago

GBrachetta commented 3 years ago

I don't know what changed in the latest version from February 13th but now all the wikilinks result in a reload.

Additionally, all backlinks are broken and they show multiple times.

I updated package.json and gatsby-config to the latest version, by the way.

I'm not sure how to sort this.

hikerpig commented 3 years ago

Sorry for your inconvenience. I ran the master code locally without noticing strange behaviors. Could it be that you didn't not run yarn install after updating the code? I did add a new dependency so this is needed. If that's not the problem, could you provide a github repo so I can reproduce and fix the problem?

GBrachetta commented 3 years ago

Thank you for getting back about this.

That's strange, I indeed ran yarn install, and I get the same problem running the dev build as well as the deployed version to Vercel.

I also lost the preview of links on hover.

Is there any information I could provide you with in order to see how to debug the issue?

hikerpig commented 3 years ago

Oh I did notice the 'page reloading' you mentioned now. That is introduced by gatsby-theme-kb version v0.3.0 since I rewrite the parser a little. I will fix it soon and update it here. Thank you for the feedback 👍

GBrachetta commented 3 years ago

That's great to hear, thank you very much! I also lost linking in deeper nested files:

So I have: readme.md linking to javascript.md (that works) but javascript.md linking to its own subfile doesn't work.

If I can provide you with any extra information, please let me know.

Here's one of my Foams deployed for you to check how I lost functionality (it all worked up to the latest update):

https://my-second-brain.vercel.app/

You can also see that backlinks don't work anymore.

hikerpig commented 3 years ago

Did you set the foam.edit.linkReferenceDefinitions to off? I noticed that with this turned of, current gatsby-theme-kb will have problems with nested files. Since [[javascript-es6+]] will not have the correct path without linkDefinition. (I should update my README since it's misleading.) If it's not offensive, could you provide the git repo of your notes, so I can test if it's OK after my fix? (It's OK not to, though)

GBrachetta commented 3 years ago

Yes, I turned it to off because it wasn't working when it was 'on'. We had a short talk on discord about it. Turning it off made it all work fine until the last update. And of course you can see my repo, haha!

It's currently set to "private", can you still visit the link? If not, I will make it public for you:

hikerpig commented 3 years ago

Yes, I turned it to off because it wasn't working when it was 'on'. We had a short talk on discord about it. Turning it off made it all work fine until the last update. And of course you can see my repo, haha!

It's currently set to "private", can you still visit the link? If not, I will make it public for you:

https://github.com/GBrachetta/my-second-brain

I can't view a private repo. And I don't know if it is possible to be just public for me (may I need to be a collaborator?)

The nested notes should work with the option value withoutExtensions(this is my option) or withExtensions now. I will try to make it possible with it being off since it's the most intuitive way, but I'm not very familiar with developing Gatsby plugins so this might take sometime.

GBrachetta commented 3 years ago

Just sent you an invite to it. Hopefully it works! :)

hikerpig commented 3 years ago

@GBrachetta The bug is fixed in gatsby-theme-kb@0.4.2, you can try update it in your project.

GBrachetta commented 3 years ago

Great, I'll try that right away! Do I need to change any file or just rebuild? I'll take a look, thank you for letting me know!

hikerpig commented 3 years ago

Great, I'll try that right away! Do I need to change any file or just rebuild? I'll take a look, thank you for letting me know!

Just install new dependency and rebuild.

GBrachetta commented 3 years ago

Fantastic, that sorted it, I believe! 😄 The only difference I still see is that backlinks include now the original nested link to the current file, but perhaps that's intentional?

Screenshot 2021-02-14 at 16 21 18

Thank you for such speedy response, amazing work!

hikerpig commented 3 years ago

@GBrachetta Yeah, that is a feature, something like 'Backlink Context', mentioned in this issue hikerpig/gatsby-project-kb#1.

GBrachetta commented 3 years ago

Ah okay, thank you! I was confused because it's unformatted and unclickable, and because if I am in a page it was clear that the backlink references it.

Thanks a lot for bringing it back to life! 😄

GBrachetta commented 3 years ago

Please don't hate me for contacting again, just a small thing and perhaps it's my fault, but links to files other than .md give me a 404 now.

- [Emmet](./cheat-sheets/emmet-cheatsheet.pdf)

GBrachetta commented 3 years ago

Forget what I said. I realised about the two extra dependencies and that while trying to fix it earlier I reverted to the previous version. It all seems to be working perfect now, thank you so much!

hikerpig commented 3 years ago

Forget what I said. I realised about the two extra dependencies and that while trying to fix it earlier I reverted to the previous version. It all seems to be working perfect now, thank you so much!

Good to see you got it done. 😁 ( I was asleep last night when you post the question ).