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

add support for WP install with Site Address (URL) in WP Settings differing from the WP admin / rest api endpoint url #26

Open
CalebBarnes opened this issue Jan 21, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@CalebBarnes
Copy link
Owner

In WP, it is possible to set the site address as the headless frontend url! This updates all of the site links to use the actual Next.js frontend url instead of the cms links.

Image

This would be super nice being able to click "View post" and it would open the frontend instead of the backend page.

But this also changes the post links in the WP REST API.

So far in our sitemap generation, we have just been using an ENV NEXT_SITE_URL and just swapping out the NEXT_PUBLIC_WP_URL with this NEXT_SITE_URL one. If the correct frontend url is added in WP we could just use the real site url.

To implement this, we would need to explore all of the possible side effects, like what happens when linking directly to a media asset like an mp4 video, etc.

We would also need to make sure getPageData is resolving these url paths correctly. Right now when we are resolving the page routes as relative paths we are just stripping out the NEXT_PUBLIC_WP_URL from the page link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant