vuepress / vuepress-theme-blog

Default blog theme for VuePress.
https://vuepress-theme-blog.billyyyyy3320.com/
MIT License
211 stars 129 forks source link

feat: add microdatas #64

Closed Kocal closed 4 years ago

Kocal commented 4 years ago

Summary

This PR adds some microdatas on post and posts list. Microdatas are useful for search engines/web crawlers and can improve your position on search engines or the user experience.

Here are some screenshots on the Google's Structured data Testing tool:

Homepage (before): Capture d’écran de 2020-02-04 21-08-12

Homepage (after): Capture d’écran de 2020-02-04 21-07-06

Post (before): Capture d’écran de 2020-02-04 21-39-49

Post (after): Capture d’écran de 2020-02-04 21-35-31

What kind of change does this PR introduce? (check at least one)

If changing the UI of default theme, please provide the before/after screenshot:

No UI changes.

Does this PR introduce a breaking change? (check one)

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

You have tested in the following browsers: (Providing a detailed version will be better.)

If adding a new feature, the PR's description includes:

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Nope.

billyyyyy3320 commented 4 years ago

Nice! I'll review it ASAP.

Kocal commented 4 years ago

Why not adding publisher property to author, too?

I wasn't really sure of how to use the microdata properly, but sure we can add it.

Is dateModified really required since we're currently only displaying published date?

You're right, it's not displayed but I thought it can be intersting to still have the info somewhere. Maybe we should display it?

billyyyyy3320 commented 4 years ago

IMO, we can provide an option whether to display last modified date, but it'll be another PR or issue, so leave dateModified to it.

Kocal commented 4 years ago

I've added "publisher" micro-data: Capture d’écran de 2020-02-11 20-52-00

billyyyyy3320 commented 4 years ago

Cool, could you remove dateModified for now, and I'll merge it.

Kocal commented 4 years ago

Done