Skip to content

Commit c18f682

Browse files
committed
component cleanup
1 parent 1bbf7f3 commit c18f682

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/components/ListTutorials.astro

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ if (!currentProduct) {
1919
}
2020
2121
const productTitle = currentProduct.data.product.title;
22-
const videoText = "🎥 Video";
23-
const tutorialText = "📝 Tutorial";
2422
2523
const docs = await getCollection("docs", (entry) => {
2624
return (
@@ -57,13 +55,9 @@ const timeAgo = (date?: Date) => {
5755
<tbody>
5856
{
5957
tutorials.map(async (tutorial) => {
60-
const title =
61-
tutorial.collection === "docs" ? tutorial.data.title : tutorial.id;
58+
const title = tutorial.data.title;
6259

63-
const href =
64-
tutorial.collection === "docs"
65-
? `/${tutorial.id}/`
66-
: tutorial.data.link;
60+
const href = `/${tutorial.id}/`;
6761

6862
const anchor = await process(`<a href=${href}>${title}</a>`, [
6963
rehypeExternalLinks,
@@ -75,7 +69,7 @@ const timeAgo = (date?: Date) => {
7569
<Fragment set:html={anchor} />
7670
</td>
7771
<td>{timeAgo(tutorial.data.updated)}</td>
78-
<td>{tutorial.collection === "docs" ? tutorialText : videoText}</td>
72+
<td>📝 Tutorial</td>
7973
<td>{tutorial.data.difficulty}</td>
8074
</tr>
8175
);

0 commit comments

Comments
 (0)