Skip to content

Commit

Permalink
also doesn't work over useConfig()
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Aug 8, 2024
1 parent 456b740 commit 46e664e
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions examples/full/pages/images/+Page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export { Page };

import { Head } from "vike-solid/Head";
import logoOld from "../../assets/logo.svg";
import logoNew from "../../assets/logo-new.svg";
import { Counter } from "../../components/Counter";
import { useConfig } from "vike-solid/useConfig";

function Page() {
return (
Expand All @@ -26,22 +26,26 @@ function Page() {
}

function Image({ src, author }: { src: string; author: string }) {
const config = useConfig();

config({
Head: (
<script
type="application/ld+json"
innerHTML={JSON.stringify({
"@context": "https://schema.org/",
contentUrl: { src },
creator: {
"@type": "Person",
name: author,
},
})}
></script>
),
});
return (
<>
<img src={src} height={48} style={{ "vertical-align": "middle", "margin-left": "10px" }} />
<Head>
<script
type="application/ld+json"
innerHTML={JSON.stringify({
"@context": "https://schema.org/",
contentUrl: { src },
creator: {
"@type": "Person",
name: author,
},
})}
></script>
</Head>
</>
);
}

0 comments on commit 46e664e

Please sign in to comment.