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

YSP-592: AI: Content endpoint uses it's title for each node render #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dblanken-yale
Copy link
Contributor

YSP-592: AI: Content endpoint uses it's title for each node render

When meta blocks render, they attempt to use the request object to get the title of the route. In the case of visiting a page, this works as intended, but in the case of our AI content endpoint, it resolves to that endpoint, resulting in the title always being 'Content Feed', since that is the title of that endpoint.

This temporarily sets the route's title to the node's title so that the render can successfully occur using the correct title.

Description of work

  • During the render loop, it replaces the route's title temporarily with the node's title so that meta blocks can pick it up

Functional testing steps:

  • Visit /api/ai/v1/content
  • Verify a search for "Content Feed" yields no results

When meta blocks render, they attempt to use the request object to get
the title of the route.  In the case of visiting a page, this works as
intended, but in the case of our AI content endpoint, it resolves to
that endpoint, resulting in the title always being 'Content Feed', since
that is the title of that endpoint.

This temporarily sets the route's title to the node's title so that the
render can successfully occur using the correct title.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant