Skip to content

Commit 41d34c4

Browse files
committed
Add repository cover images and refactor repository card layout
1 parent 804684b commit 41d34c4

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

docs/en/repository/index.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ onMounted(async () => {
2121
name: r.name,
2222
href: r.id,
2323
moduleCount: data.modules.length,
24+
cover: data.cover,
2425
description: data.description || "Browse modules from this repository"
2526
}
2627
} catch {
@@ -64,23 +65,24 @@ The website automatically re-deploys every 6 hours to ensure all repositories ar
6465
<!-- Repository Grid -->
6566
<div :class="$style.repositoryGrid">
6667
<a v-for="repository in repos" :key="repository.href" :href="repository.href" :class="$style.repoCard">
67-
<div :class="$style.repoHeader">
68-
<div :class="$style.repoIcon">
69-
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
70-
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
71-
</svg>
68+
<img v-if="repository.cover" :class="$style.repoCover" :src="repository.cover" />
69+
<div :class="$style.repoContainer">
70+
<div :class="$style.repoHeader">
71+
<div :class="$style.repoIcon">
72+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
73+
</div>
74+
<div :class="$style.repoInfo">
75+
<h3 :class="$style.repoName">{{ repository.name }}</h3>
76+
<p :class="$style.repoDescription">{{ repository.description }}</p>
77+
</div>
78+
<div :class="$style.moduleCount">
79+
<span :class="$style.countNumber">{{ repository.moduleCount }}</span>
80+
<span :class="$style.countLabel">modules</span>
81+
</div>
7282
</div>
73-
<div :class="$style.repoInfo">
74-
<h3 :class="$style.repoName">{{ repository.name }}</h3>
75-
<p :class="$style.repoDescription">{{ repository.description }}</p>
83+
<div :class="$style.repoFooter">
84+
<span :class="$style.exploreText">Tap to explore →</span>
7685
</div>
77-
<div :class="$style.moduleCount">
78-
<span :class="$style.countNumber">{{ repository.moduleCount }}</span>
79-
<span :class="$style.countLabel">modules</span>
80-
</div>
81-
</div>
82-
<div :class="$style.repoFooter">
83-
<span :class="$style.exploreText">Tap to explore →</span>
8486
</div>
8587
</a>
8688
</div>
@@ -155,7 +157,7 @@ The website automatically re-deploys every 6 hours to ensure all repositories ar
155157
background: var(--vp-c-bg-soft);
156158
border: 1px solid var(--vp-c-divider);
157159
border-radius: 16px;
158-
padding: 24px;
160+
/*padding: 24px;*/
159161
text-decoration: none !important;
160162
transition: all 0.3s ease !important;
161163
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
@@ -167,6 +169,17 @@ The website automatically re-deploys every 6 hours to ensure all repositories ar
167169
transform: translateY(-4px);
168170
}
169171

172+
.repoContainer {
173+
display: block;
174+
padding: 24px;
175+
}
176+
177+
.repoCover {
178+
aspect-ratio: 2.048;
179+
object-fit: cover;
180+
border-radius: 16px 16px 0px 0px;
181+
}
182+
170183
.repoHeader {
171184
display: flex;
172185
align-items: flex-start;
@@ -257,7 +270,7 @@ The website automatically re-deploys every 6 hours to ensure all repositories ar
257270
}
258271

259272
.repoCard {
260-
padding: 20px;
273+
/* padding: 20px; */
261274
}
262275

263276
.repoHeader {

0 commit comments

Comments
 (0)