1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-12 20:09:59 +00:00

fix: github card for user/org

This commit is contained in:
patak 2022-12-21 15:44:59 +01:00
parent deb5cc2428
commit 1e66dba35a

View file

@ -23,7 +23,7 @@ interface Meta {
const meta = $computed(() => {
const { url } = props.card
const path = url.split('https://github.com/')[1]
const user = path.match(/([\w-]+)\//)?.[1]
const user = path.match(/([\w-]+)(\/|$)/)?.[1]
const repo = path.match(/[\w-]+\/([\w-]+)/)?.[1]
const repoPath = `${user}/${repo}`
const inRepoPath = path.split(`${repoPath}/`)?.[1]