Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 42 commits into from

Conversation

RiccardoMasutti
Copy link
Contributor

@RiccardoMasutti RiccardoMasutti commented Nov 27, 2019

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
Copy link
Contributor

m52go commented Dec 3, 2019

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.

@RiccardoMasutti
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants