generate hreflang in nextjs spa aem integration | Community
Skip to main content
emilux
Level 2
December 18, 2023
Solved

generate hreflang in nextjs spa aem integration

  • December 18, 2023
  • 2 replies
  • 1805 views

Hi, firstly i let you know that i'm new to AEM ecosystem so i haven't already explored all the possibility AEM can offer.

I'm currently on a projet that use AEM SPA in an NextJS environnement my pages are rendered using @61380/aem-react-editable-components on nextjs SSR, using fetchModel that get all my page component models (i think its the way it should work).

 

Everything work well i can access my pages and view all my components this is great ! but now what i need to do for the SEO is to render hreflang tags in my page head, using nextjs i can easely add some tag the head for this purpose but now what i need to do is to get the current page loaded on NextJS SSR translated varients. How can i achieve that ? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Shashi_Mulugu

@emilux if all your locale pages also managed in AEM via MSM... then in your page model json.. you should pass hreflang and it's related locale urls.. and then you should read these values in your react/next js app.

2 replies

Shashi_Mulugu
Community Advisor
Shashi_MuluguCommunity AdvisorAccepted solution
Community Advisor
December 22, 2023

@emilux if all your locale pages also managed in AEM via MSM... then in your page model json.. you should pass hreflang and it's related locale urls.. and then you should read these values in your react/next js app.

kautuk_sahni
Community Manager
Community Manager
January 3, 2024

@emilux Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni