Skip to content

What's the purpose of @page_title in the title tag? #36

Closed Answered by derrickreimer
pkayokay asked this question in Q&A
Discussion options

You must be logged in to vote

The <.inertia_title> server-side component (which is populated with the page_title assign variable by convention) is a simple component that:

  1. Ensures the page title is populated in the server-rendered response (which is important for SEO if this is a public-facing page)
  2. Includes the inertia attribute on the title tag (<title inertia>Your Title</title>), so that the client-side can change the title as it needs to (via the <Head> component).

You are correct that the client-side also needs to know what the page title should be, so that it can be kept up to date any time the page changes (and for internal navigation, this needs to happen using just the information provided via Inertia page …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pkayokay
Comment options

Answer selected by pkayokay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants