Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

add schema.org events to head #3385

Merged
merged 64 commits into from
Aug 1, 2023
Merged

add schema.org events to head #3385

merged 64 commits into from
Aug 1, 2023

Conversation

paaragon
Copy link
Contributor

Changes

Fixes #3252

Implementation details

Add an application/ld+json script in the head of events/index.html page o add the events information.

How to read this PR

Run the page in dev mode and look for the script created within the HTML head tag. The correctness of the content can be tested with this page: https://search.google.com/test/rich-results?hl=es

Copy link
Contributor

@y4izus y4izus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on the issue, we are using the useSchemaOrg composable, could you use it here, please?

@paaragon
Copy link
Contributor Author

With the last update, google finds 20 valid elements (the correct amount):

https://search.google.com/test/rich-results/result/r%2Fevents?id=z99Wo6f5cTegIPkGur1EGA&hl=es

image

Copy link
Collaborator

@eddybrando eddybrando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @paaragon, this is very good progress!

I added some specific comments, but also, generally, I believe that there is an issue with the current approach.

We shouldn't add the list of events to every page but only to the pages where they are listed. And also, for individual event pages, we should add the data for the individual event.

composables/useQiskitSchemaOrg.ts Outdated Show resolved Hide resolved
layouts/default-max.vue Outdated Show resolved Hide resolved
layouts/default.vue Outdated Show resolved Hide resolved
nuxt.config.ts Show resolved Hide resolved
@paaragon
Copy link
Contributor Author

Thanks a lot @paaragon, this is very good progress!

I added some specific comments, but also, generally, I believe that there is an issue with the current approach.

We shouldn't add the list of events to every page but only to the pages where they are listed. And also, for individual event pages, we should add the data for the individual event.

You are right, the events list should be referenced only on the event/index page (I have changed it).

I will also add the schema on fall-fest, seminar-series and summer school (2022 and 2023)

@paaragon
Copy link
Contributor Author

There are some issues after updating the branch. I'm not sure what they are related to, but might be due to the Nuxt update.

In any case, when looking at the dependencies, I realised that we're using the package nuxt-schema-org. According to them:

The package @vueuse/schema-org has been superseded by @unhead/schema-org which offers the same simple API.

Source: https://nuxt.com/modules/schema-org#new-package

I think that as part of this PR we should replace the package. Maybe that would also bring us closer to the issue after Nuxt's update, which is that useEventListSchemaOrg is not found.

The issue wasn't about the package but with some bug in the code.

If you look at unhead's documentation on how to integrate with nuxt, it says to use the nuxt-schema-org package

@eddybrando
Copy link
Collaborator

If you look at unhead's documentation on how to integrate with nuxt, it says to use the nuxt-schema-org package

But on that page if you click on the GitHub icon on top, you land in the new repo https://github.com/harlan-zw/unhead-schema-org, which is @unhead/schema-org.

I believe they just haven't updated their documentation. But, to be fair, it's unclear either way.

I've opened an issue on their repo to ask about that: harlan-zw/nuxt-schema-org#24

Copy link
Collaborator

@eddybrando eddybrando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @paaragon! I added a couple of comments 🙂

pages/events/index.vue Outdated Show resolved Hide resolved
utils/event-schemaorg.ts Outdated Show resolved Hide resolved
@eddybrando eddybrando requested a review from y4izus July 28, 2023 09:29
@eddybrando eddybrando self-requested a review July 31, 2023 15:17
layouts/default-max.vue Outdated Show resolved Hide resolved
Copy link
Collaborator

@eddybrando eddybrando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @paaragon! I just checked the rich results in the tool linked as well and it looks great.

@y4izus y4izus merged commit 76b2080 into main Aug 1, 2023
5 checks passed
@y4izus y4izus deleted the feat-event-schemaorg branch August 1, 2023 14:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Event type to Schema
3 participants