Set a canonical URL for a note published with Obsidian publish

Use case or problem

I publish many notes on notes.dsebastien.net. Some of those point to my Obsidian vault’s version of articles I have published on dsebastien.net (main website). To avoid 404s on my Obsidian publish website, I’ve like to also publish my articles there. But to avoid issues with search engines, the articles should point to the main URL that search engines should know about (i.e., my main website).

Proposed solution

Provide a way (e.g., through specific metadata on notes) to specify a canonical URL for specific notes.

Current workaround (optional)

One workaround I can imagine is creating a map of note-names - canonical URL in publish.js, and using code to inject the canonical URL when needed. But this seems complicated to implement for most users.