foambubble / foam

A personal knowledge management and sharing system for VSCode
https://foambubble.github.io/
Other
15.09k stars 648 forks source link

Add customized Link Reference Definitions will cause two node, and can't to jump by graph node. #621

Closed HIDE-r closed 3 years ago

HIDE-r commented 3 years ago

Summary Because I want to link my articles through foam, and also make hexo blog jump to the correct URL when I click that link. So I set the Link Reference Definitions to off and add myself correct wiki-links. the article like below.

[[git-add说明文档]]
....
[git-add说明文档]: /git-add说明文档 "git-add说明文档"

but question is that, when I show graph , What I see will look like the picture below. image

So if I link many my article. This will generate a lot of individual nodes. Emm.. I think that not pretty. Is there a way to solve this situation? Although this does not seem to be a bug, it’s understandable that different paths produce two nodes. I still hope there is a way to solve it.

riccardoferretti commented 3 years ago

Sorry I am not sure I understand, what do you mean by "add myself correct wiki-links"? It might help me to see examples in latin chars, just to be sure I am not losing something "in translation" Can you share a repo to reproduce the issue?

HIDE-r commented 3 years ago

I am very sorry that what I described above is not clear. I want to use both Foam and Hexo Blog to manage my notes. I set the Foam repo in ....../_post/, it look like:

$ pwd
....../_post
$
$ ls
.vscode

......
......

git-note.md
git-add-document.md

......
......

In the process of using, I found that if I use wiki-links in git-note.md file

......
this is more detail for git-add: [[ git-add-document ]]
......
[ git-add-document ]: /git-add-document "git-add-document"

In the Hexo blog, It can be resolved to

<a href="/git-add-document" title="git-add-document">git-add-document</a>

because the git-add-document url is http://localhost:4000/git-add-document/ , So it can jump this url correctly by clicking that link in the Hexo website. But at this time, in Foam, It will not find the note by this wiki-link. and the graph will look like image


If I modify wiki-link to this:

......
this is more detail for git-add: [[ git-add-document ]]
......
[ git-add-document ]: git-add-document "git-add-document"

When I Browsing http://localhost:4000/git-note/ and click the link [[ git-add-document ]] in Hexo website. It will jump to http://localhost:4000/git-note/git-add-document, It is an wrong url.

It seems just I can’t combine the Foam and Hexo Blog very well.

riccardoferretti commented 3 years ago

so the difference is here right?

[ git-add-document ]: /git-add-document "git-add-document"

and

[ git-add-document ]: git-add-document "git-add-document"

where the first one works with Hugo but not Foam, and the latter with Foam and not Hugo. Is that right?

If that is the case, I wouldn't consider it a bug in Foam. To address it in Foam, it would need to support some sort of absolute location for path in a wikilink definition. You can address it in Hugo as well, by adding a / to the definition on site generation. I also don't know whether adding / in Foam will make the definition compatible with Github pages / Jekyll.

I am happy for someone to further investigate, it doesn't feel a priority to Foam atm ahead of V1.

Let me know if I understood this correctly though, maybe I am missing something.

HIDE-r commented 3 years ago

Yes, You are right, that is the problem I have. And this maybe isn't a bug in Foam.

I will attempt your method. It seems that I want to combine both of Hugo and Foam, which still requires some effort.

Thank you for your help, maybe this issue can be closed now.