File tree Expand file tree Collapse file tree 5 files changed +71
-11
lines changed
[pid=pid]/[org]/[repo]/[id=number] Expand file tree Collapse file tree 5 files changed +71
-11
lines changed Original file line number Diff line number Diff line change 11import type { MetaTagsProps } from "svelte-meta-tags" ;
22
3- export function load ( { data } ) {
3+ export function load ( { data, url } ) {
44 return {
55 ...data ,
66 pageMetaTags : Object . freeze ( {
7- title : `Detail of ${ data . itemMetadata . org } /${ data . itemMetadata . repo } #${ data . itemMetadata . id } `
7+ title : `Detail of ${ data . itemMetadata . org } /${ data . itemMetadata . repo } #${ data . itemMetadata . id } ` ,
8+ openGraph : {
9+ images : [
10+ {
11+ get url ( ) {
12+ const ogUrl = new URL ( "og" , url . origin ) ;
13+ ogUrl . searchParams . set ( "title" , data . item . info . title ) ;
14+ ogUrl . searchParams . set (
15+ "description" ,
16+ `${ data . itemMetadata . org } /${ data . itemMetadata . repo } #${ data . itemMetadata . id } `
17+ ) ;
18+ return ogUrl . href ;
19+ }
20+ }
21+ ]
22+ }
823 } ) satisfies MetaTagsProps
924 } ;
1025}
Original file line number Diff line number Diff line change 11import type { MetaTagsProps } from "svelte-meta-tags" ;
22
3- export function load ( ) {
3+ export function load ( { url } ) {
44 return {
55 pageMetaTags : Object . freeze ( {
66 title : "v2 • Devlog" ,
77 description : "The development blog of Svelte Changelog" ,
8- twitter : {
9- description : "The development blog of Svelte Changelog"
8+ openGraph : {
9+ images : [
10+ {
11+ get url ( ) {
12+ const ogUrl = new URL ( "og" , url . origin ) ;
13+ ogUrl . searchParams . set ( "title" , "v2 • Devlog" ) ;
14+ return ogUrl . href ;
15+ }
16+ }
17+ ]
1018 }
1119 } ) satisfies MetaTagsProps
1220 } ;
Original file line number Diff line number Diff line change 11import type { MetaTagsProps } from "svelte-meta-tags" ;
22
3- export function load ( { data } ) {
3+ export function load ( { data, url } ) {
44 return {
55 ...data ,
66 pageMetaTags : Object . freeze ( {
7- title : data . currentPackage . pkg . name
7+ title : data . currentPackage . pkg . name ,
8+ openGraph : {
9+ images : [
10+ {
11+ get url ( ) {
12+ const ogUrl = new URL ( "og" , url . origin ) ;
13+ ogUrl . searchParams . set ( "title" , data . currentPackage . pkg . name ) ;
14+ ogUrl . searchParams . set (
15+ "description" ,
16+ `${ data . currentPackage . repoOwner } /${ data . currentPackage . repoName } `
17+ ) ;
18+ return ogUrl . href ;
19+ }
20+ }
21+ ]
22+ }
823 } ) satisfies MetaTagsProps
924 } ;
1025}
Original file line number Diff line number Diff line change 11import type { MetaTagsProps } from "svelte-meta-tags" ;
22
3- export function load ( { data } ) {
3+ export function load ( { data, url } ) {
44 return {
55 ...data ,
66 pageMetaTags : Object . freeze ( {
7- title : "All Packages"
7+ title : "All Packages" ,
8+ openGraph : {
9+ images : [
10+ {
11+ get url ( ) {
12+ const ogUrl = new URL ( "og" , url . origin ) ;
13+ ogUrl . searchParams . set ( "title" , "All packages" ) ;
14+ return ogUrl . href ;
15+ }
16+ }
17+ ]
18+ }
819 } ) satisfies MetaTagsProps
920 } ;
1021}
Original file line number Diff line number Diff line change 11import type { MetaTagsProps } from "svelte-meta-tags" ;
22
3- export function load ( { data, params } ) {
3+ export function load ( { data, params, url } ) {
44 return {
55 ...data ,
66 pageMetaTags : Object . freeze ( {
7- title : `Tracker for ${ params . org } /${ params . repo } `
7+ title : `Tracker for ${ params . org } /${ params . repo } ` ,
8+ openGraph : {
9+ images : [
10+ {
11+ get url ( ) {
12+ const ogUrl = new URL ( "og" , url . origin ) ;
13+ ogUrl . searchParams . set ( "title" , `Tracker • ${ params . org } /${ params . repo } ` ) ;
14+ return ogUrl . href ;
15+ }
16+ }
17+ ]
18+ }
819 } ) satisfies MetaTagsProps
920 } ;
1021}
You can’t perform that action at this time.
0 commit comments