Skip to content

Commit

Permalink
change to ximage
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrubinger committed Nov 11, 2022
1 parent 754783d commit 5152e63
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export let renderparams;
let { title, image, variants, ratings, ratings_count } = renderparams;
let { title, ximage: image, variants, ratings, ratings_count } = renderparams;
if (title == '') title = '<title>';
function validImage(url) {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/og/editor/inputs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export let data;
export let loading = false;
export let autoRefresh = false;
console.log(data)
let url;
$: {
let usp = new URLSearchParams(data);
Expand All @@ -28,7 +28,7 @@
</label>
<label>
Image:
<input class="cancel-drag" type="text" bind:value={data.image} placeholder="url to an image" />
<input class="cancel-drag" type="text" bind:value={data.ximage} placeholder="url to an image" />
</label>
<div class="rating">
<label>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/og/extract-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export function extractSearchParams(searchParams) {
let renderparams = {
title: searchParams.get('title') ?? undefined,
image: searchParams.get('image') ?? undefined,
ximage: searchParams.get('ximage') ?? undefined,
variants: searchParams.get('variants') === 'true' ? true : false,
ratings: searchParams.get('ratings') ?? undefined,
ratings_count: searchParams.get('ratings_count') ?? undefined,
Expand Down
9 changes: 7 additions & 2 deletions src/routes/single/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<script>
let image = "https://geizhals-og-image.vercel.app/og?title=Nintendo+Switch+schwarz%2Fgrau+%282019%29+dfef&ximage=https%3A%2F%2Fgzhls.at%2Fi%2F54%2F42%2F2135442-n0.jpg&key=123456"
</script>

<svelte:head>
<title>metatag test</title>
Expand All @@ -11,7 +16,7 @@
<meta property="og:description" content="this is a test for metatag" />
<meta
property="og:image"
content="https://geizhals-og-image.vercel.app/og?title=Google%20Pixel%207%20Pro%20256GB%20Snow&ratings=4&ratings_count=24&variants=2&key=123456&ximage=https%3A%2F%2Fgzhls.at%2Fi%2F69%2F78%2F2826978-n0.jpg"
content="{image}"
/>

<!-- Twitter -->
Expand All @@ -21,6 +26,6 @@
<meta property="twitter:description" content="this is a test for metatag" />
<meta
property="twitter:image"
content="https://geizhals-og-image.vercel.app/og?title=Google%20Pixel%207%20Pro%20256GB%20Snow&ratings=4&ratings_count=24&variants=2&key=123456&ximage=https%3A%2F%2Fgzhls.at%2Fi%2F69%2F78%2F2826978-n0.jpg"
content="{image}"
/></svelte:head
>

1 comment on commit 5152e63

@vercel
Copy link

@vercel vercel bot commented on 5152e63 Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.