Last active
August 2, 2018 19:38
-
-
Save arutnik/f44dcdfbe237aaa9f71a35f7630b298f to your computer and use it in GitHub Desktop.
SEO-SPA: Hiding with CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'app-root', | |
template: ` | |
<span class="hidden">This text is important for a | |
crawler to see, but I can't have it on screen | |
because I need to put my human users first and | |
they get to see a rich visual experience instead | |
of this text. So I hide it with CSS. Remember that | |
this will penalize this text's importance, but it's | |
better than not having it visible to crawlers at all. | |
</span> | |
<my-awesome-canvas-component ></my-awesome-canvas-component> | |
`, | |
styles: ['.hidden { display: none; }'] | |
}) | |
export class AppComponent { | |
/* . . . */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment