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

Generate SEO block fields #2614

Merged
merged 24 commits into from
Feb 17, 2025

Conversation

thomasdax98
Copy link
Member

@thomasdax98 thomasdax98 commented Oct 8, 2024

Description

Add content generation for SEO tags in SeoBlock

The SeoBlock can now generate the HTML title, meta description and OpenGraph title and description using the ContentGenerationService. An explanation for how to enable this feature can be found in the documentation: https://docs.comet-dxp.com/docs/features-modules/content-generation/#seo-block-generating-seo-tags

Further adds

  • tests for useSeoTagGeneration
  • docs

Challenges

There are four different SEO tags we want to generate. It should be possible to generate (and regenerate) them independently.

We can either generate all four tags at once or each individually.

Pro / Con

Individually:

Pro:

  • independent (re)generation possible

Con:

  • the same page content is sent to the LLM four times

All at once:

Pro:

  • only send the page content to the LLM once -> saves tokens

Con:

  • independent (re)generation is hard

I opted for an hybrid approach: Generate all SEO tags at once but only fill out one. Cache the response for the other tags and get them from the cache when needed. I also deduplicate mutations. If the field value and cached value is identical, I trigger a new generation.

This requires more complicated logic that I extracted to the useSeoTagGeneration() hook.

Screenshots/screencasts

Bildschirmaufnahme.2025-02-10.um.16.10.52.mov

Changeset

  • I have verified if my change requires a changeset

Related tasks and documents

https://vivid-planet.atlassian.net/browse/COM-899

@auto-assign auto-assign bot requested a review from johnnyomair October 8, 2024 14:26
@thomasdax98 thomasdax98 marked this pull request as draft October 8, 2024 14:27
@thomasdax98 thomasdax98 changed the title RFC: Generate SeoBlock fields Draft: Generate SeoBlock fields Jan 10, 2025
@thomasdax98 thomasdax98 changed the base branch from main to extract-text-content January 10, 2025 12:43
@thomasdax98 thomasdax98 force-pushed the generate-seo-block-data branch from a9d8b8c to 36703fc Compare January 10, 2025 12:44
@thomasdax98 thomasdax98 force-pushed the generate-seo-block-data branch 2 times, most recently from aa49a3d to af7b6fc Compare February 10, 2025 14:36
@vivid-planet vivid-planet deleted a comment from sonarqubecloud bot Feb 10, 2025
@thomasdax98 thomasdax98 marked this pull request as ready for review February 10, 2025 15:25
@auto-assign auto-assign bot requested a review from johnnyomair February 10, 2025 15:25
@thomasdax98 thomasdax98 changed the title Draft: Generate SeoBlock fields Generate SeoBlock fields Feb 10, 2025
Base automatically changed from extract-text-content to feature/seo-tag-generation February 10, 2025 15:43
@thomasdax98 thomasdax98 force-pushed the generate-seo-block-data branch from 4dcf95a to d114944 Compare February 10, 2025 15:46
@thomasdax98 thomasdax98 force-pushed the generate-seo-block-data branch from d114944 to 5a932d8 Compare February 10, 2025 15:47
@thomasdax98 thomasdax98 marked this pull request as draft February 17, 2025 13:05
@thomasdax98 thomasdax98 marked this pull request as ready for review February 17, 2025 13:17
@johnnyomair johnnyomair changed the title Generate SeoBlock fields Generate SEO block fields Feb 17, 2025
@thomasdax98 thomasdax98 merged commit 2998c74 into feature/seo-tag-generation Feb 17, 2025
3 checks passed
@thomasdax98 thomasdax98 deleted the generate-seo-block-data branch February 17, 2025 15:07
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