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

feat: video discovery #301

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

rayblair06
Copy link
Contributor

πŸ”— Linked issue

#299

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

  • Added discoverVideo functionality to discover <video> tags in pre-rendered content.
  • Extended functionality of extractSitemapMetaFromHtml to extract attributes from <video> to provide required values for video sitemap(s).
  • Added tests to cover new extractSitemapMetaFromHtml functionality.

Example: screenshots below show the HTML and what the expected sitemap results would be.

Screenshot 2024-06-28 at 22 49 55

Screenshot 2024-06-28 at 22 49 40

Considerations

  • discoverVideos is enabled by default to be consistent with discoverImages option.
  • Required video sitemap tags (thumbnail_loc, title, description, content_loc) will return empty string in the event there are no value provided for that attribute. Google recommended these tags are 'required'.
  • src/runtime/nitro/plugins/nuxt-content.ts will search only top-level <video src="...>. I'll be honest I wasn't totally sure of this functionality I simply mimicked discoverImage. Happy to provide additional changes.

@harlan-zw
Copy link
Collaborator

harlan-zw commented Jun 29, 2024

Well that was quick! The code looks good.

I'll merge for now but I won't be available to do a release until Monday.

If you have time to update docs it would be appreciated πŸ™ https://github.com/harlan-zw/nuxt-seo/blob/main/docs/content/2.sitemap/2.guides/2.images-videos.md

Thanks for the great work

@harlan-zw harlan-zw merged commit 630cae1 into nuxt-modules:main Jun 29, 2024
1 check passed
@rayblair06
Copy link
Contributor Author

Sounds great @harlan-zw! I'll send over a PR to update the docs.

@harlan-zw
Copy link
Collaborator

Sounds great @harlan-zw! I'll send over a PR to update the docs.

Already done πŸ˜› Any edits welcome though

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