File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,6 @@ const difficulties = {
8686
8787 const difficulty = tutorial .data .difficulty ;
8888
89- if (! difficulty ) {
90- throw new Error (` ${tutorial .id } is missing difficulty property ` );
91- }
92-
9389 const YOUTUBE_DOMAINS = [" www.youtube.com" , " youtube.com" , " youtu.be" ];
9490 const youtube =
9591 tutorial .collection === " videos" &&
@@ -98,12 +94,14 @@ const difficulties = {
9894 const spotlight =
9995 tutorial .collection === " docs" && tutorial .data .spotlight ;
10096
101- const badges: BadgeType [] = [
102- {
97+ const badges: BadgeType [] = [];
98+
99+ if (difficulty ) {
100+ badges .push ({
103101 text: difficulty ,
104102 variant: difficulties [difficulty ],
105- },
106- ];
103+ });
104+ }
107105
108106 if (youtube ) {
109107 badges .push ({
You can’t perform that action at this time.
0 commit comments