Modify head of client side web page

Hello,

I am currently looking on how to add a canonical link in the head of a web page in Frappe from the client side.

Using js I can do it, but it is useless for Google SEO.

Using server-side web page it is also possible, but it adds complexity, cache issue and so on so I would prefer avoiding it.

Using the global head in website settings would lead to gives the exact same link to all pages, that’s not the point either.

Do you have an idea ?