willasm / obsidian-open-weather

Obsidian plugin for OpenWeather API
MIT License
44 stars 2 forks source link

ignores the exclude folder setting #8

Closed htmljenn closed 1 year ago

htmljenn commented 1 year ago

I installed OpenWeather and I'm loving it. But, I can't get it to not expand the template in my templates folder. At first I thought it was because I have sub-folders in my templates folder, but even setting the very explicit folder to ignore, it continues to expand the template when I open it to edit it in Obsidian. I restarted Obsidian before testing.

My templates are in the folder structure:

00 Meta
  04 templates
    04.02 full page

I'd like to be able to have OpenWeather not expand any template in the "04 templates" folder and any sub-folder.

Even better would be the option to turn off the automatic expansion and only do it when a file is created that has the template or when I ask it to expand with a command.

willasm commented 1 year ago

Yes I can replicate this. It is the nested folder which I never accounted for. The setting needs to be set to the full path. For a quick partial fix until I can upload a fix for this is to edit the settings file directly. You can find the settings file in the folder YourVaultsName\.obsidian\plugins\open-weather\data.json Open data.json file in notepad or any text editor and set the following line to...

"excludeFolder": "00 Meta/04 templates",

This will only exclude the "04 Templates", not any sub-folders though so not an ideal solution for your situation.

Turning off auto expansion is not really an option as it is required for live weather updating feature.

Thanks for bringing this to my attention, William

willasm commented 1 year ago

Just uploaded an updated main.js which now also excludes any subfolders. If you can test this I would appreciate it. Download main.js and replace the one in the plugins folder YourVaultsName\.obsidian\plugins\open-weather\ Then in settings select the parent folder. In your case choose 04 templates and any files in 04.02 full page will also be excluded.

You can download as a zip file with this link

Will be adding a new release after I have updated the documewntation.

Hope this works for you, William.

htmljenn commented 1 year ago

AWESOME That works perfectly. I downloaded the main.js file you suggested, restarted, and did some testing, and they don't expand until I use the template, which is exactly what I needed. THANKS!!!

willasm commented 1 year ago

Thank you very much for the feedback. New release with the fix has just been uploaded and should be available soon.

Thanks, William.