@@ -6,9 +6,8 @@ import { process } from "~/util/rehype";
66import rehypeExternalLinks from " ~/plugins/rehype/external-links" ;
77
88type DocsEntry = CollectionEntry <" docs" >;
9- type VideoEntry = CollectionEntry <" videos" >;
109
11- const tutorials: Array <DocsEntry | VideoEntry > = [];
10+ const tutorials: Array <DocsEntry > = [];
1211
1312const currentSection = Astro .params .slug ?.split (" /" )[0 ];
1413const currentProduct = await getEntry (" products" , currentSection ! );
@@ -20,8 +19,6 @@ if (!currentProduct) {
2019}
2120
2221const productTitle = currentProduct .data .product .title ;
23- const videoText = " 🎥 Video"
24- const tutorialText = " 📝 Tutorial"
2522
2623const docs = await getCollection (" docs" , (entry ) => {
2724 return (
@@ -38,14 +35,6 @@ const docs = await getCollection("docs", (entry) => {
3835
3936tutorials .push (... docs );
4037
41- const videos = await getCollection (" videos" , (entry ) => {
42- return entry .data .products .some (
43- (v : string ) => v .toUpperCase () === productTitle .toUpperCase (),
44- );
45- });
46-
47- tutorials .push (... videos );
48-
4938tutorials .sort ((a , b ) => Number (b .data .updated ) - Number (a .data .updated ));
5039
5140const timeAgo = (date ? : Date ) => {
@@ -66,13 +55,9 @@ const timeAgo = (date?: Date) => {
6655 <tbody >
6756 {
6857 tutorials .map (async (tutorial ) => {
69- const title =
70- tutorial .collection === " docs" ? tutorial .data .title : tutorial .id ;
58+ const title = tutorial .data .title ;
7159
72- const href =
73- tutorial .collection === " docs"
74- ? ` /${tutorial .id }/ `
75- : tutorial .data .link ;
60+ const href = ` /${tutorial .id }/ ` ;
7661
7762 const anchor = await process (` <a href=${href }>${title }</a> ` , [
7863 rehypeExternalLinks ,
@@ -84,7 +69,7 @@ const timeAgo = (date?: Date) => {
8469 <Fragment set :html = { anchor } />
8570 </td >
8671 <td >{ timeAgo (tutorial .data .updated )} </td >
87- <td >{ tutorial . collection === " docs " ? tutorialText : videoText } </td >
72+ <td >📝 Tutorial </td >
8873 <td >{ tutorial .data .difficulty } </td >
8974 </tr >
9075 );
0 commit comments