Ghost
New
flaxo
/
ghost
public
forked from
ghost/ghost
Source code of Ghost - On Ghost
Star
0
Fork
0
Code
Issues
0
Pull requests
0
359ec0e
34
branches
Go to file
t
Code
ghost
apps
web
src
lib
og-url.ts
add opengraph images and user profile route
0e3d29d
a month ago
17 lines · 353 B
1
/**
Link to the in-repository card route for a tree or blob path.
*/
2
export
function
ogUrl
(
{
3
username
,
4
repo
,
5
ref
,
6
path
,
7
kind
=
"
tree
"
8
}
:
{
9
username
:
string
10
repo
:
string
11
ref
:
string
12
path
:
string
13
kind
?
:
"
14
})
{
15
const
query
=
16
return
`
/
${
username
17
}
,
;
;
;
;
tree
"
|
"
blob
"
;
new
URLSearchParams
(
{
ref
,
path
,
kind
}
)
;
}
/
${
repo
}
/og?
${
query
}
`
;