Skip to content

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

Open
@brillout

Description

@brillout

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions