badrbouslikhin / obsidian-vault-changelog

Plugin for Obsidian to maintain a changelog of recently edited files in your vault.
73 stars 16 forks source link

[BUG] Changelog doesn't use absolute paths #15

Open 229c9cf0 opened 2 years ago

229c9cf0 commented 2 years ago

I have several files with the same name spread across the graph (index / inbox files in various folders / sub-hierarchies, e.g. work/-INBOX-, projects/-INBOX-, ... and a global -INBOX- for quick notes to process later.)

Because the change log link doesn't include the full path, most of these notes get lost / aren't properly tracked by the change log.

Notes should be linked by the full path instead. (There's even an Obsidian option, but I'm not sure if it's accessible or if there's an API call to generate a link according to the current setting. Didn't see anything on the file descriptor itself.)

I locally edited the JS resulting from https://github.com/badrbouslikhin/obsidian-vault-changelog/blob/main/main.ts#L91 to

const path = recentlyEditedFile.path;                                                       
const link = path.substring( 0, path.length - (1+recentlyEditedFile.extension.length) );    
changelogContent += "- " + humanTime + " \u00B7 [[" + link + "]]\n";                        

and that works for me, for now. But others will probably also run into this.

badrbouslikhin commented 1 year ago

Apologize for the delay in responding to this issue!

Thanks for reaching out. This is a valid remark, can you please submit a PR?