Source: luiyongsheng.medium.com

Laravel InertiaJS SEO workaround
I noticed an issue(#45) raise on Github regarding server-side rendering and SEO.According to the official documentation of InertiaJS, server-side rendering is not supported at the moment. vue-meta will handle metadata at frontend while butscher/meta-tags is for the backend. In my use case, I wanted to add metadata at my legal pages(privacy policy, terms of service, etc).

If you use to let users navigate around at the frontend, you will notice that on the first load, all metadata including title and description are rendered properly by browser; but when you try to click on other to navigate, the remain unchanged.

Run your npm script and you are all set!Of course, there are a bunch of better ways to manage and serve the static string content, this article is only explaining my way to workaround the SEO issue.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners