#product schema in qwik

4 messages · Page 1 of 1 (latest)

celest vortex
#

Hi everyone I have an ecommerce website that I want to embed product schema. Any one with ideas how to go about this #1046929728948408370

urban fox
#

you mean json-ld?

#

this snippet from @oblique bolt should bring you on the right track.

import { component$ } from '@builder.io/qwik';
import type { WithContext } from 'schema-dts';

export const JsonLd = component$<{
  schema: WithContext<any>;
}>((props) => {
  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={JSON.stringify(props.schema, null, 2)}
    ></script>
  );
});
celest vortex
#

Thank you