-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/TeaByte/NakhlahJS
- Loading branch information
Showing
14 changed files
with
79 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,16 @@ import { PageProps } from "$fresh/server.ts"; | |
import { Course, CourseGroup } from "../../utils/types.ts"; | ||
import { cache } from "../../utils/course-cache.ts"; | ||
|
||
import CourseCard from "../../components/CourseCard.tsx"; | ||
import Footer from "../../components/Footer.tsx"; | ||
|
||
import IconChevronDown from "https://deno.land/x/[email protected]/tsx/chevron-down.tsx"; | ||
import ProgressCheck from "@/islands/ProgressCheck.tsx"; | ||
|
||
interface Props { | ||
courses: CourseGroup; | ||
} | ||
export const handler: Handlers<Props> = { | ||
async GET(_req, ctx) { | ||
GET(_req, ctx) { | ||
let foundCourseGroup: CourseGroup | Course | undefined = undefined; | ||
const toFind = decodeURIComponent(ctx.params.slug); | ||
foundCourseGroup = cache.courses.find((c) => { | ||
|
@@ -28,7 +29,7 @@ export const handler: Handlers<Props> = { | |
}; | ||
|
||
export default function CoursePage(props: PageProps<Props>) { | ||
const {courses:foundCourseGroup} = props.data; | ||
const { courses: foundCourseGroup } = props.data; | ||
return ( | ||
<> | ||
<Head> | ||
|
@@ -44,9 +45,19 @@ export default function CoursePage(props: PageProps<Props>) { | |
</h2> | ||
<IconChevronDown /> | ||
</div> | ||
<div class="flex flex-col mt-2 pr-3"> | ||
{foundCourseGroup.courses.map((innerCourse) => ( | ||
<CourseCard key={innerCourse.slug} course={innerCourse} /> | ||
<div class="flex flex-col mt-2 pr-3 gap-3"> | ||
{foundCourseGroup.courses.map((course) => ( | ||
<a | ||
title={course.title} | ||
href={`/${course.slug}`} | ||
class="gray-200 hover:opacity-75 list-none" | ||
style={{ order: course.order }} | ||
> | ||
<h3 class="text-gray-500 font-bold flex gap-1 items-center rounded-btn"> | ||
<ProgressCheck slug={course.slug} /> | ||
{course.title} | ||
</h3> | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
google-site-verification: google29ae9dd15993e53e.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
{ | ||
"theme_color": "#8936FF", | ||
"background_color": "#2EC6FE", | ||
"icons": [ | ||
{ | ||
"purpose": "maskable", | ||
"sizes": "512x512", | ||
"src": "icon512_maskable.png", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"purpose": "any", | ||
"sizes": "512x512", | ||
"src": "icon512_rounded.png", | ||
"type": "image/png" | ||
} | ||
], | ||
"orientation": "any", | ||
"display": "standalone", | ||
"dir": "auto", | ||
"lang": "ar", | ||
"short_name": "nakhlahjs", | ||
"name": "", | ||
"start_url": "/", | ||
"form_factor": "narrow" | ||
} | ||
"theme_color": "#1f202a", | ||
"background_color": "#282a36", | ||
"icons": [ | ||
{ | ||
"purpose": "maskable", | ||
"sizes": "512x512", | ||
"src": "icon512_maskable.png", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"purpose": "any", | ||
"sizes": "512x512", | ||
"src": "icon512_rounded.png", | ||
"type": "image/png" | ||
} | ||
], | ||
"orientation": "any", | ||
"display": "standalone", | ||
"dir": "auto", | ||
"lang": "ar", | ||
"short_name": "تطبيق نخلة", | ||
"name": "تطبيق نخلة", | ||
"start_url": "/", | ||
"form_factor": "narrow", | ||
"id": "nakhlahjs1.0", | ||
"description": "اكتساب مهارات جافاسكربت بسهولة وفعالية", | ||
"categories": [ | ||
"education" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { join } from "$std/path/mod.ts"; | ||
import { readJson } from "https://deno.land/[email protected]/fs/read_json.ts"; | ||
import { extract } from "https://deno.land/[email protected]/encoding/front_matter.ts"; | ||
|
||
import { cache as CourceCache } from "@/utils/course-cache.ts"; | ||
import { Course, CourseAttributes, CourseGroup } from "../utils/types.ts"; | ||
|
||
export let CoursesCount = 0; | ||
|
@@ -105,7 +105,7 @@ export async function getCourses( | |
cache.courses = merged; | ||
|
||
const endTime = performance.now(); | ||
// console.log(`Caching data took ${(endTime - startTime) / 1000} seconds`); | ||
console.log(`Caching data took ${(endTime - startTime) / 1000} seconds`); | ||
return cache; | ||
} | ||
|
||
|
@@ -114,7 +114,7 @@ export async function getFlatSlugs() { | |
// console.log("Using cache"); | ||
return FlatSlugsCache; | ||
} | ||
const { courses } = await getCourses(); | ||
const courses = CourceCache.courses; | ||
const slugs = courses.map((c) => { | ||
if ("courses" in c) { | ||
c.courses.sort((a, b) => a.order - b.order); | ||
|