Skip to content

fix: use meta.title as default <title> #454

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

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

eric-burel
Copy link
Contributor

Hey folks, long time no see!

After reviewing my sites SEO, I've noticed that the titles were not properly configured. Because TutorialKit also uses the title for navigation, it injects the chapter and part title too.

To sum it up the proposal

  • if meta.title is set, use it in the <title> tag: it will be picked up by search engines. But also visible in the browser window, so we lose the display of the part and chapter.
  • if not set, the <title> tag is just the navigational title part / chapter /lesson

Related but not included in this PR: I suspect trailingSlash: "never" is a reasonable default in the config, otherwise search engines might pick pages as duplicate. Might be worth an investigation.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@AriPerkkio AriPerkkio changed the title use meta.title as default <title> fix: use meta.title as default <title> Jun 17, 2025
Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, this makes sense. The default title is constructed from multiple parts, so it can indeed cause similar titles for all pages.

const title = [lesson.part?.title, lesson.chapter?.title, lesson.data.title].filter(Boolean).join(' / ');

Thanks for the PR! 💯

@AriPerkkio AriPerkkio merged commit 482b0e3 into stackblitz:main Jun 17, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants