trimox / angular-mdc-web

Angular wrapper for Material Design (Web) Components
https://trimox.github.io/angular-mdc-web
MIT License
517 stars 86 forks source link

Icon font names are getting indexed by search engines #1851

Open zunamo opened 5 years ago

zunamo commented 5 years ago

Material icon font names are getting indexed by search engines.

The issue is described here: https://github.com/google/material-design-icons/issues/498

This template in my app: <mdc-icon>format_list_bulleted</mdc-icon> <span>Compare</span>

Is getting translated in this manner in google search results: chrome_0Rk7FtcWAL

In one of the answers in the link above, it is suggested to use material icon codepoints. Would it be possible to add a way to automatically translate mdc-icon font text to a code point?

Suggestion: <mdc-icon useCodePoint>search</mdc-icon> or <mdc-icon toCodePoint="search"></mdc-icon>

Or a different solution that would solve this issue would also be great. Thanks in advance!

zunamo commented 5 years ago

This is another option to solve this problem: https://stackoverflow.com/questions/37281861/how-to-use-google-material-icons-as-class-instead-of-i-tag

I am thinking of going with this now:

HTML: <mdc-icon attr.data-icon="search"></mdc-icon>

CSS: mdc-icon::after { content: attr(data-icon); }

Could you let me know if this is something you are thinking of implementing? If not, I will just change all my mdc-icons to work in this manner.

trimox commented 5 years ago

@zunamo Thank you for bringing this to my attention. I'm preparing to publish our v1.0.0 release, but afterwards I'd like to investigate this for ya.