Skip to content

feat(topics): Improve the hreflang generation

Build Variables:

  • Use Contentful Preview API

Step 1: What is changing in this MR?

  1. Update the Topics Service to return both the payload and the available languages of a page
  2. Implement the combination of middleware, validate, and asyncData component methods.
    • The middleware method fetches the data as it is the first in the lifecycle to run. It is done in this method to persist the data in the context and avoid calling the same data again in the validate and asyncData methods
    • The validate method verifies the available languages of a page, if a language is unavailable, the route won't be generated during the routes generation.
    • The asyncData was refactored to read the data from the context and execute the component's logic.
  3. Create a new localizedMeta function that filters the languages that are not available for a page to avoid having 404 localized pages in the metadata
Production Review app
https://about.gitlab.com/topics/devops https://3833-duplicates-and-incorrect-hreflang-implementation-it-it-pt.about.gitlab-review.app/topics/devops

Related #3833 (closed)

Edited by John Arias Castillo

Merge request reports

Loading