Ad

How To Set SEO Attributes In Aurelia

- 1 answer

Here is the main problem I'm having. I want to set social share buttons to an Aurelia application page.

In general, I have to set three meta tags objects:

head title
[property="og:image"]
[property="og:description"]

What is the best way to handle this in Aurelia? Is it possible to do this using the Route object?

Ad

Answer

I got around this by just writing a service that modifies the head content directly using the DOM API. There is no way to nicely bind to the head content as a view.

Here is a gist of my implementation https://gist.github.com/dpix/6f508727b9d03d692d0659eb1776ad85

Ad
source: stackoverflow.com
Ad