Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set SEO attributes in aurelia

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?

like image 940
Egor Malkevich Avatar asked Apr 09 '16 09:04

Egor Malkevich


1 Answers

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

like image 64
dpix Avatar answered Oct 24 '22 12:10

dpix