sawhney17 / logseq-citation-manager

73 stars 12 forks source link

[Feature request] Add `fileName` variable to template for file linking #41

Open ebbertd opened 1 year ago

ebbertd commented 1 year ago

When currently adding a page for a reference that includes the link to the PDF, this link will include the full path to the file. This leads to two issues:

  1. The path to the file is going to show up in the graph. This clutters the graph view quite a bit and to make it useable again every path needs to be manually excluded from the graph.
  2. Using the same set of notes with another setup becomes difficult, the path to files might be different. If the path is different, this needs to be changed across the whole graph.

I propose to instead use the same way for accessing files as is done when adding a reference via the build in Zotero integration. This would solve issue 1 and make issue 2 easier because the path would only need to be adjusted once in the settings. The pattern for the Zotero integration seems to be: {{zotero-imported-file key, "fileName"}}. Getting to this could be accomplished with the template for File URLs. The variable key already seems to be available, so only the variable fileName would need to be added, which is part of fileLink.

PS: Thank you for the great work of creating this plugin. It is very useful.