bisq-network / bisq-website

@bisq-network website at https://bisq.network
34 stars 76 forks source link

Add Schema.org JSON-LD Microdata for SEO (Articles) #300

Closed RiccardoMasutti closed 4 years ago

RiccardoMasutti commented 4 years ago

Following #290 and #291

As specified on https://developers.google.com/search/docs/data-types/article

Final result: Two non-carousel results for non-AMP web pages.

Carousel results for non-AMP web pages.

This will boost traffic and SEO for Bisq.network.

@m52go unfortunately, for NewsArticle we cannot use Project as Publisher. Google accepts Organization only. By the way, I specified Bisq Decentralized Autonomous Organization as publisher.name.

It does not mean in any way that Bisq is a "standard" company. From now on it would be ideal to use this scheme for each article we publish and, if possible, add a unique image for each one.

m52go commented 4 years ago

Thanks again @RiccardoMasutti, another solid idea. However I think this one can be implemented better.

It would be way better if the blog post writer didn't have to manually adjust the JSON-LD markup for each post they write.

Putting the following markup in _layouts/post.html solves this:

    {
        "@context": "https://schema.org",
        "@type": "BlogPosting",
        "headline": "{{ page.title }}",
        "description": "{{ page.excerpt }}",
        "image": "https://bisq.network/images/bisq-fav.png",  
        "author": {
            "@type": "Person",
            "name": "{{ page.author }}"
        },  
        "publisher": {
            "@type": "Organization",
            "name": "Bisq",
            "logo": {
                "@type": "ImageObject",
                "url": "https://bisq.network/images/bisq-fav.png"
            }
        },
        "datePublished": "{{ page.date }}",
        "dateModified": "{{ page.date }}",
        "mainEntityOfPage": "{{ site.url }}{{ page.url }}"
    }

The markup above also makes the following changes:

As for images, perhaps we could start adding some. In any case, some posts will have images and some will not, so it would be nice to assign image a value based on whether or not page.image exists...but that's more of a "nice-to-have" feature than a "must-have" feature for now, in my opinion.

RiccardoMasutti commented 4 years ago

Thanks again @RiccardoMasutti, another solid idea. However I think this one can be implemented better.

It would be way better if the blog post writer didn't have to manually adjust the JSON-LD markup for each post they write.

Putting the following markup in _layouts/post.html solves this:

    {
        "@context": "https://schema.org",
        "@type": "BlogPosting",
        "headline": "{{ page.title }}",
        "description": "{{ page.excerpt }}",
        "image": "https://bisq.network/images/bisq-fav.png",  
        "author": {
            "@type": "Person",
            "name": "{{ page.author }}"
        },  
        "publisher": {
            "@type": "Organization",
            "name": "Bisq",
            "logo": {
                "@type": "ImageObject",
                "url": "https://bisq.network/images/bisq-fav.png"
            }
        },
        "datePublished": "{{ page.date }}",
        "dateModified": "{{ page.date }}",
        "mainEntityOfPage": "{{ site.url }}{{ page.url }}"
    }

The markup above also makes the following changes:

  • change @type to BlogPosting (is there a reason you picked NewsArticle instead?)
  • change publisher name to "Bisq" (see this comment)
  • add dateModified and mainEntityOfPage properties, as the testing tool highly recommended them (see mainEntityOfPage documentation at the bottom of this page)

As for images, perhaps we could start adding some. In any case, some posts will have images and some will not, so it would be nice to assign image a value based on whether or not page.image exists...but that's more of a "nice-to-have" feature than a "must-have" feature for now, in my opinion.

That's awesome! Didn't know about ready-to-use variables. I added the markup in _layouts/post.html.

If I had known before I would not have lost 2 hours to add them manually article by article :D

Let me remove again the added content and this PR should be ready to merge

RiccardoMasutti commented 4 years ago

It's easier for me to start a new PR from scratch. Closing this one.