biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.03k stars 228 forks source link

SEO Friendly gallery #417

Closed melcarthus closed 11 months ago

melcarthus commented 1 year ago

SEMRUSH is indicating that resources aka images, are used as page links <a>. tags. This confuses crawlers because only links to pages should be used inside <a> tags according to SEMRUSH. As this package is already using datasets for everthing else, why not make it so that we can use other elements instead of only an <a> tag. It would be nice if we could use data-src for example, on a div/button etc to be used for the popup initiator instead of an <a> tag.

Explain why the feature is useful SEO Tools like Semrush trigger notices that <a> tags with resources inside instead of page-links, confuse crawlers as it expects links to pages not resources. Therefor it can impact ranking/seo because there are 'errors' inside the internal link architecture of a website.

Have you seen it somewhere else? I have not seen this anywhere else, virtually every (good) gallery js repo uses <a> tags as the main link to larger images/video's/html/external content.

Additional context Add any other context or screenshots about the feature request here.

Before

<a href="https://www.dev.site/image.jpg" ....>
</a>

After

<div data-large-image="https://www.dev.site/image.jpg" ....>
</div>
finex commented 11 months ago

Assuming the thumbnail is low quality and the linked image is high quality, what happens when the page is scraped by Google bot? Is the full image indexed or is it skipped because the url is inside a data-* attribute?

melcarthus commented 11 months ago

@finex I will get back to you when I am back at work next week.

gingerchew commented 11 months ago

(I'm pretty sure on this, but don't quote me) If it is inside a data-* attribute, googlebot will most often times ignore it. It isn't considered content unless you mark it with some microdata attributes to it.