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

feat: dynamically set preview titles to name of page + rollkit #228

Closed
Tracked by #200
jcstein opened this issue Aug 17, 2023 · 5 comments · Fixed by #236
Closed
Tracked by #200

feat: dynamically set preview titles to name of page + rollkit #228

jcstein opened this issue Aug 17, 2023 · 5 comments · Fixed by #236
Assignees
Labels
enhancement New feature or request style

Comments

@jcstein
Copy link
Member

jcstein commented Aug 17, 2023

The titles should show up as they do in the titles of the pages on the web browser. As an example:

https://rollkit.dev/tutorials/gm-world = "GM World rollup"

currently, the og preview title is "Rollkit"

is it possible to use this format: "GM World rollup | Rollkit" without displaying "Rollkit | Rollkit" on the home page? and to have the same format for the og description?

@jcstein
Copy link
Member Author

jcstein commented Aug 22, 2023

i think that you'll know the answer to this. do you know if i made an error in the config that is causing this @brc-dd?

@brc-dd
Copy link
Contributor

brc-dd commented Aug 22, 2023

Ah, not sure if I understood your issue properly, but you probably need to set titleTemplate: ':title' in your home page frontmatter to render just Rollkit there. For og:title, if you want it dynamic, you need to inject it via transformPageData or transformHead hooks instead of having a static entry in head (in .vitepress/config file).

@jcstein
Copy link
Member Author

jcstein commented Aug 22, 2023

for homepage, tried titleTemplate: ':title' but it renders Rollkit | Rollkit still

more important issue here is the og:title - do you have an example you could point me to? thanks for the help here

@brc-dd
Copy link
Contributor

brc-dd commented Aug 22, 2023

https://stackblitz.com/edit/vite-estrl8?file=docs/index.md,docs/.vitepress/config.ts

@jcstein
Copy link
Member Author

jcstein commented Aug 22, 2023

omg

thank you!

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

Successfully merging a pull request may close this issue.

2 participants