How to sync only notes and attachments?

What I’m trying to do

I’m trying to sync all .md and .canvas files, and preferably all the files those notes link to to my phone - but exclude all the other (usually large) files in my vault.

Things I have tried

I’m currently hosting Nextcloud to sync, but it can only sync all files in a folder, cannot two-way sync individual files either, and often messes up .md formatting if I open something inside the Nextcloud app.

I think I’d pay for Obsidian Sync if it could sync only my notes and not all of the other files in the folders.

I’m not an Obsidian Sync user :innocent: , but from the doc, it seems like Obsidian Sync provides Selective syncing.
(Apparently, you can also exclude entire folders from syncing)