Skip to content

Commit

Permalink
feat: add image object data
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Oct 5, 2023
1 parent d239534 commit 5ca3b57
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/components/employee.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import LinkedinLogo from 'phosphor-svelte/lib/LinkedinLogo';
import Image from '$components/image.svelte';
import { JsonLd } from 'svelte-meta-tags';
import type { Picture } from 'vite-imagetools';
export let givenName: string;
export let familyName: string;
Expand All @@ -16,9 +17,8 @@
};
export let socialMedia: socialMedia[] = [];
// TODO: Use Picture type from components/image.svelte
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export let image: any;
export let image: Picture;
export let photographerName: string | undefined = undefined;
const name = `${givenName} ${familyName}`;
</script>
Expand All @@ -44,6 +44,20 @@
}}
/>

<JsonLd
schema={{
'@context': 'https://schema.org',
'@type': 'ImageObject',
contentUrl: image.img.src,
license: 'https://creativecommons.org/licenses/by/4.0/',
creditText: 'Bjerk AS',
creator: {
'@type': 'Person',
name: photographerName ?? 'Bjerk AS'
}
}}
/>

<div class="employee">
<Image src={image} class="profile-image" alt="" />
<div class="section">
Expand Down
9 changes: 9 additions & 0 deletions src/components/employees.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{ type: 'linkedin', url: 'https://www.linkedin.com/in/thomasbrustad/' },
{ type: 'github', url: 'https://github.com/HanBrustad' }
]}
photographerName="Steffen Normark"
/>

<Employee
Expand All @@ -35,6 +36,7 @@
{ type: 'linkedin', url: 'https://www.linkedin.com/in/simenandre/' },
{ type: 'github', url: 'https://github.com/simenandre' }
]}
photographerName="Steffen Normark"
/>

<Employee
Expand All @@ -54,6 +56,7 @@
url: 'https://github.com/copetterson'
}
]}
photographerName="Tom-Egil Jensen"
/>

<Employee
Expand All @@ -67,6 +70,7 @@
{ type: 'linkedin', url: 'https://www.linkedin.com/in/braaar/' },
{ type: 'github', url: 'https://github.com/braaar' }
]}
photographerName="Steffen Normark"
/>

<Employee
Expand All @@ -80,6 +84,7 @@
{ type: 'linkedin', url: 'https://www.linkedin.com/in/moripen/' },
{ type: 'github', url: 'https://github.com/moripen' }
]}
photographerName="Steffen Normark"
/>

<Employee
Expand All @@ -93,6 +98,7 @@
{ type: 'linkedin', url: 'https://www.linkedin.com/in/simon-rugland/' },
{ type: 'github', url: 'https://github.com/simonrugland' }
]}
photographerName="Fabian Roberto Gomez"
/>

<Employee
Expand All @@ -112,6 +118,7 @@
url: 'https://github.com/xillians'
}
]}
photographerName="Steffen Normark"
/>

<Employee
Expand All @@ -125,6 +132,7 @@
{ type: 'linkedin', url: 'https://www.linkedin.com/in/annachristinalyra/' },
{ type: 'github', url: 'https://github.com/ChristinaLyra' }
]}
photographerName="Steffen Normark"
/>

<Employee
Expand All @@ -144,4 +152,5 @@
url: 'https://github.com/seacurrent'
}
]}
photographerName="Sebastian Andersen"
/>

0 comments on commit 5ca3b57

Please sign in to comment.