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

Adding a <script> tag to only one page. #2244

Open
brillout opened this issue Mar 3, 2025 · 0 comments
Open

Adding a <script> tag to only one page. #2244

brillout opened this issue Mar 3, 2025 · 0 comments
Labels
enhancement 🚀 New feature or request

Comments

@brillout
Copy link
Member

brillout commented Mar 3, 2025

Description

Adding a <script> tag globally is easy with +Head. But using +Head doesn't work for adding a <script> tag to only one page, because +Head isn't applied upon client-side navigation.

Potential solutions:

  1. New +scripts setting
  2. Support +Head.shared.ts
  3. Also apply +Head upon client-side navigation, while adding a new HTML-only setting +metadata that is meant for bots & browsers.
    • Mixing high-level props (e.g. description) and low-level props (e.g. og.description).
    • Isn't it a DX paper cut that +title doesn't live in +metadata? (Since +metadata is server-only but the title needs to updated upon client-side navigation.)

I like 3. the most so far.

See also: Blankeos/vike-metadata#9.

@brillout brillout added the enhancement 🚀 New feature or request label Mar 3, 2025
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