Skip to content

Instantly share code, notes, and snippets.

@AVGP
Created September 25, 2018 12:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AVGP/95228a5c3e69769532a090c892a8dd0c to your computer and use it in GitHub Desktop.
Save AVGP/95228a5c3e69769532a090c892a8dd0c to your computer and use it in GitHub Desktop.
Tests for prerendering of structured data
<!doctype html>
<html>
<body>
<h1>Rendered using JavaScript:</h1>
<p></p>
<!-- JavaScript - should be removed by the prerendering -->
<script>
const paragraph = document.querySelector('p');
paragraph.textContent = "Hello, World!";
</script>
<!-- Structured Data - should NOT be removed -->
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": "Plumbus",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "It's the number one tool."
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment