Skip to content

Add improvements in json ld definition for webpage - #56

Open
anita-chouhan wants to merge 7 commits into
devfrom
mod/json-ld-definition-webpage
Open

Add improvements in json ld definition for webpage#56
anita-chouhan wants to merge 7 commits into
devfrom
mod/json-ld-definition-webpage

Conversation

@anita-chouhan

@anita-chouhan anita-chouhan commented Jan 9, 2023

Copy link
Copy Markdown
Contributor

Comment thread templates/_schemas/definitions/creativeWork.twig Outdated
.creator((props.creators ?? [])|map(org => organization(org))|default(null))
.copyrightHolder((props.authors.organizations ?? [])|map(org => organization(org))|default(null))
.copyrightYear(props.dateCreated|date('Y'))
.id(siteUrl|default(null))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this correct? All webpage id values will end up being the same. Previously this was being set to props.url ~ '#webpage'.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On reference URL, it was updated intentionally to siteUrl so I did here as well but I think keeping it props.url ~ '#webpage' would be better. Reverted now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the reason for one being better than the other?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keeping it siteUrl will make it the same for all web pages and the Id should be unique for each webpage.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@pl-mnm Can you chime in here? The older code in the boilerplate has the webpage ID set to props.url ~ '#webpage' but the newer versions of our JSON-LD code, like in Blume, have the ID set to siteUrl.

https://github.com/miranj/blume-fresh/blob/6dfa86f17ec475f8e033cb3a299a8caa1929f664/templates/_schemas/definitions/webpage.twig#L10

  • What is the ID supposed to be?
  • What should we retain in the boilerplate?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tbh I'm not sure I understood all these subtleties. This is something @souvikdg and I had come up with and I think he'll be better placed to tell us what's required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rungta The correct version is what we are using in the boilerplate (props.url ~ '#webpage'), I confirmed with Souvik.

@anita-chouhan
anita-chouhan requested a review from rungta January 11, 2023 13:17
Comment thread templates/_schemas/definitions/person.twig Outdated
@anita-chouhan
anita-chouhan requested a review from rungta January 12, 2023 13:28
Comment thread templates/_schemas/definitions/person.twig Outdated
@anita-chouhan
anita-chouhan requested a review from rungta January 13, 2023 09:28
@anita-chouhan

Copy link
Copy Markdown
Contributor Author

@rungta Kindly review.

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.

3 participants