Skip to content

Commit

Permalink
fix og:url
Browse files Browse the repository at this point in the history
  • Loading branch information
biltongza committed Nov 19, 2024
1 parent 02b316d commit 8a70d8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
10 changes: 0 additions & 10 deletions frontend/src/lib/__consts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { base } from '$app/paths';
export const StorageBaseUrl = 'https://cdncf.ldam.co.za/portfolio';
export const MaxDimensionNormalDensity = 320;
export const ThumbnailHrefNormalDensity = 'thumbnail2x';
Expand All @@ -7,12 +6,3 @@ export const ThumbnailHrefHighDensity = '640';
export const HighResHref = '2048';
export const HighResMaxDimension = 2048;
export const DateFormat = 'D MMM YYYY';

export const defaultMetadata = {
'og:title': 'Logan Dam - Software Engineer, Photographer',
'og:type': 'website',
'og:description': "Logan Dam's portfolio of photography and code.",
'og:image': 'https://ldam.co.za/favicon-310.png',
'og:url': base,
'og:locale': 'en_ZA'
};
17 changes: 13 additions & 4 deletions frontend/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<script module lang="ts">
import { defaultMetadata } from '$lib/__consts';
<script lang="ts">
import { page } from '$app/stores';
import Footer from '$lib/footer/footer.svelte';
import Header from '$lib/header/header.svelte';
import { usePageMetadata, useTitle } from '$lib/stores.svelte';
</script>
<script lang="ts">
let { children } = $props();
const title = useTitle();
const metadata = usePageMetadata();
let pageTitle = $derived(
`${title.value ? title.value + ' - ' : ''}Logan Dam - Software Engineer, Photographer`
);
let defaultMetadata = $derived({
'og:title': 'Logan Dam - Software Engineer, Photographer',
'og:type': 'website',
'og:description': "Logan Dam's portfolio of photography and code.",
'og:image': 'https://ldam.co.za/favicon-310.png',
'og:locale': 'en_ZA',
'og:url': $page.url.toString()
});
let metas = $derived(
Object.entries({ ...defaultMetadata, ...metadata.value }).map(([key, value]) => ({
key,
Expand Down

0 comments on commit 8a70d8c

Please sign in to comment.