-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
200 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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"; | ||
|
||
function Page() { | ||
return ( | ||
<> | ||
<p> | ||
Page showcasing an <code><Image></code> component that adds/teleports structured data ( | ||
<code><script type="application/ld+json"></code>) to <code><head></code>, see HTML. | ||
</p> | ||
<div> | ||
New logo: <Image src={logoNew} author="brillout" /> | ||
</div> | ||
<br /> | ||
<div> | ||
Old logo: <Image src={logoOld} author="Romuald Brillout" /> | ||
</div> | ||
<br /> | ||
<Counter /> | ||
</> | ||
); | ||
} | ||
|
||
function Image({ src, author }: { src: string; author: string }) { | ||
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> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export { Config }; | ||
|
||
// Same as ./Config-server.ts but importing useConfig-client.js | ||
|
||
import { useConfig } from "../../hooks/useConfig/useConfig-client.js"; | ||
import type { ConfigFromHook } from "../../types/Config.js"; | ||
|
||
/** | ||
* Set configurations inside React components. | ||
* | ||
* https://vike.dev/useConfig | ||
*/ | ||
function Config(props: ConfigFromHook): null { | ||
const config = useConfig(); | ||
config(props); | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export { Config }; | ||
|
||
// Same as ./Config-client.ts but importing useConfig-server.js | ||
|
||
import { useConfig } from "../../hooks/useConfig/useConfig-server.js"; | ||
import type { ConfigFromHook } from "../../types/Config.js"; | ||
|
||
/** | ||
* Set configurations inside React components. | ||
* | ||
* https://vike.dev/useConfig | ||
*/ | ||
function Config(props: ConfigFromHook): null { | ||
const config = useConfig(); | ||
config(props); | ||
return null; | ||
} |
Oops, something went wrong.