Mobile app version of vmapp.org
Login or Join
Holmes151

: How do search engine crawlers deal with imported HTML using link rel import tags? Consider the HTML5 tag named link. Is this relevant to web-crawlers? <head> <link rel="import" href="/path/to/imports/stuff.html"&

@Holmes151

Posted in: #Html #Html5 #Import #Links

Consider the HTML5 tag named link. Is this relevant to web-crawlers?

<head>
<link rel="import" href="/path/to/imports/stuff.html">
</head>


Say there are images in this linked import, will those appear under the parent's URL or the linked content's URL?

I would ultimately like to have them included in the parent's URL.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Holmes151

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Generally when you use link rel="import" for <body> elements you will use some way of calling for those elements to be displayed. One method that I'm aware of its using JavaScript with something like:


Source

<head>
<link rel="import" href="import.html">
</head>
<body>
<div id="container"></div>
<script>
var link = document.querySelector('link[rel="import"]');

// Clone the <template> in the import.
var template = link.import.querySelector('template');
var clone = document.importNode(template.content, true);

document.querySelector('#container').appendChild(clone);
</script>
</body>



Using the above method would insert the content into the <div id="container"></div>. Google understands most simple JavaScripts that load resources through using the DOM and because you are embedding the image on the parent page Google will assoicate that page with that image... However one thing you might want to do to prevent Google indexing import html files is using a noindex and a block using robots.txt

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme