Skip to content

[ New Inline Format ] Introduce Inline Time Format for improved SEO and accessibility#67751

Open
sarthaknagoshe2002 wants to merge 6 commits intoWordPress:trunkfrom
sarthaknagoshe2002:fix/issue-54488
Open

[ New Inline Format ] Introduce Inline Time Format for improved SEO and accessibility#67751
sarthaknagoshe2002 wants to merge 6 commits intoWordPress:trunkfrom
sarthaknagoshe2002:fix/issue-54488

Conversation

@sarthaknagoshe2002
Copy link
Copy Markdown
Contributor

Partial Fix for : #54488

What?

This PR introduces a Time Inline Format to display time or date information with machine-readable formatting using the <time> element.

Why?

The <time> element with the datetime attribute improves machine-readability, providing better SEO and more accurate metadata for search engines.
While similar functionality exists in core blocks like Post Date or Latest Comments, these options are tied to specific content. This new feature allows inline time representation without creating additional content types.

How?

  • Enables inline application of <time> formatting within text, like in a Paragraph block.
  • Cleans & adds the selected value in the datetime attribute.

Testing Instructions

  1. Add text in a Paragraph block.
  2. Apply the Time Inline Format to a portion of the text and configure the datetime attribute.
  3. Verify the inline time is applied with accurate attributes.
  4. Confirm output improves metadata and accessibility in SEO-related tools.

Screenshots or screencast

Inline.time.format.mov

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 9, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ellatrix ellatrix added the [Type] Enhancement A suggestion for improvement. label Dec 10, 2024
@ellatrix ellatrix added the [Package] Format library /packages/format-library label Dec 10, 2024
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

@sarthaknagoshe2002 Thanks for the PR!

The important point here is that generating the datetime attribute from a selected string can be difficult:

  • The user won't necessarily enter the correct date and time according to the ISO format.
  • The text won't necessarily be in English. For example, 14:00 UTC +5:30 15th December 2024 will become 2024年12月15日 14時(UTC+5:30) in Japanese.

Given that, I think it would be better for the user to explicitly select the date and time, like so:

268183239-538af810-542a-4bb9-8118-3625f8bca94b

@sarthaknagoshe2002
Copy link
Copy Markdown
Contributor Author

The important point here is that generating the datetime attribute from a selected string can be difficult:

  • The user won't necessarily enter the correct date and time according to the ISO format.
  • The text won't necessarily be in English. For example, 14:00 UTC +5:30 15th December 2024 will become 2024年12月15日 14時(UTC+5:30) in Japanese.

Given that, I think it would be better for the user to explicitly select the date and time, like so:

@t-hamano Noted, on it!

@sarthaknagoshe2002
Copy link
Copy Markdown
Contributor Author

@t-hamano I’ve implemented the picker as advised. Could you please take a look?

@sarthaknagoshe2002
Copy link
Copy Markdown
Contributor Author

Hey @ellatrix & @t-hamano, could you please review the changes made after your feedback?

Also, this PR now has conflicts, and I’m facing a permission issue that’s preventing me from resolving them. Could someone help with that as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Format library /packages/format-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants