mirror of https://github.com/Lissy93/dashy.git
🚸 Makes GitHub cards hyperlinks (fixes #1531)
This commit is contained in:
parent
931915f366
commit
fa6d1925b7
|
@ -1,9 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="readme-stats">
|
<div class="readme-stats">
|
||||||
<img class="stats-card" v-if="!hideProfileCard" :src="profileCard" alt="Profile Card" />
|
<a v-if="!hideProfileCard" :href="profileCardLink" target="_blank">
|
||||||
<img class="stats-card" v-if="!hideLanguagesCard" :src="topLanguagesCard" alt="Languages" />
|
<img class="stats-card" :src="profileCard" alt="Profile Card" />
|
||||||
|
</a>
|
||||||
|
<a v-if="!hideLanguagesCard" :href="profileCardLink" target="_blank">
|
||||||
|
<img class="stats-card" :src="topLanguagesCard" alt="Languages" />
|
||||||
|
</a>
|
||||||
<template v-if="repos">
|
<template v-if="repos">
|
||||||
<img class="stats-card" v-for="(repo, i) in repoCards" :key="i" :src="repo" :alt="repo" />
|
<a v-for="(repo, i) in repoCards" :key="i" :href="repo.cardHref" target="_blank">
|
||||||
|
<img class="stats-card" :src="repo.cardSrc" :alt="repo" />
|
||||||
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -61,6 +67,9 @@ export default {
|
||||||
profileCard() {
|
profileCard() {
|
||||||
return `${widgetApiEndpoints.readMeStats}?username=${this.username}${this.cardConfig}`;
|
return `${widgetApiEndpoints.readMeStats}?username=${this.username}${this.cardConfig}`;
|
||||||
},
|
},
|
||||||
|
profileCardLink() {
|
||||||
|
return `https://github.com/${this.username}`;
|
||||||
|
},
|
||||||
topLanguagesCard() {
|
topLanguagesCard() {
|
||||||
return `${widgetApiEndpoints.readMeStats}/top-langs/?username=${this.username}`
|
return `${widgetApiEndpoints.readMeStats}/top-langs/?username=${this.username}`
|
||||||
+ `${this.cardConfig}&langs_count=12`;
|
+ `${this.cardConfig}&langs_count=12`;
|
||||||
|
@ -70,8 +79,11 @@ export default {
|
||||||
this.repos.forEach((repo) => {
|
this.repos.forEach((repo) => {
|
||||||
const username = repo.split('/')[0];
|
const username = repo.split('/')[0];
|
||||||
const repoName = repo.split('/')[1];
|
const repoName = repo.split('/')[1];
|
||||||
cards.push(`${widgetApiEndpoints.readMeStats}/pin/?username=${username}&repo=${repoName}`
|
cards.push({
|
||||||
+ `${this.cardConfig}&show_owner=true`);
|
cardSrc: `${widgetApiEndpoints.readMeStats}/pin/?username=${username}`
|
||||||
|
+ `&repo=${repoName}${this.cardConfig}&show_owner=true`,
|
||||||
|
cardHref: `https://github.com/${username}/${repoName}`,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return cards;
|
return cards;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue