Skip to content

Commit 5c7897d

Browse files
committed
adjust layouts
1 parent c38e93a commit 5c7897d

6 files changed

Lines changed: 46 additions & 14 deletions

File tree

‎apps/codingcatdev/src/content/course/micro-bit-for-a-10-year-old/lesson/micro-bit-intro.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
cloudinary_convert: false
33
cover: htts://media.codingcat.dev/image/upload/v1620241182/main-codingcatdev-photo/gmjigd84bzqxklcbiljt.png
44
excerpt: micro:bit Introduction
5-
framework:
6-
- makecode
5+
framework:
6+
- makecode
77
language:
8-
- javascript
8+
- javascript
99
published: published
1010
slug: micro-bit-intro
1111
start: June 1, 2022
1212
title: micro:bit Intro
1313
weight: 1
1414
---
1515

16-
## **What is a micro:bit**
16+
## What is a micro:bit
1717

1818
It is a pocket-sized computer 70 times smaller and 18 times faster than the original BBC Micro computers used in schools.
1919

@@ -61,4 +61,4 @@ All you need to do is plug a usb A into your computer, then place the micro USB
6161

6262
With the latest update you can select which language you would like to learn and start a tutorial, for younger kids I would recommend Blocks. Since we focus a lot on web solutions at CodingCatDev I would recommend using the JavaScript tutorial as well.
6363

64-
![https://res.cloudinary.com/ajonp/image/upload/f_auto,q_auto/ajonp-ajonp-com/uploads/wnbfqzdhc5anpf1w74a0.png](https://res.cloudinary.com/ajonp/image/upload/f_auto,q_auto/ajonp-ajonp-com/uploads/wnbfqzdhc5anpf1w74a0.png)
64+
![https://res.cloudinary.com/ajonp/image/upload/f_auto,q_auto/ajonp-ajonp-com/uploads/wnbfqzdhc5anpf1w74a0.png](https://res.cloudinary.com/ajonp/image/upload/f_auto,q_auto/ajonp-ajonp-com/uploads/wnbfqzdhc5anpf1w74a0.png)

‎apps/codingcatdev/src/lib/components/content/CloudinaryImage.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
export let src: string;
3-
export let alt: string;
4-
export let classes: string;
3+
export let alt: string = 'Missing Alt';
4+
export let classes: string = '';
55
66
import { lazyload, HtmlImageLayer } from '@cloudinary/html';
77
import { CloudinaryImage } from '@cloudinary/url-gen';

‎apps/codingcatdev/src/routes/(content-single)/(non-course)/Content.svelte‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
import 'prism-themes/themes/prism-shades-of-purple.min.css';
33
44
import Video from '$lib/components/content/Video.svelte';
5-
import type { Content } from '$lib/types';
5+
import type { Content, ContentType } from '$lib/types';
6+
import { pluralize } from '$lib/utils';
7+
import CloudinaryImage from '$lib/components/content/CloudinaryImage.svelte';
68
export let data: {
79
content: Content;
10+
contentType: ContentType;
811
};
12+
$: title = pluralize({ type: data.contentType } as Content);
913
</script>
1014

1115
{#if data?.content}
1216
<div class="flex justify-center">
1317
<section class="flex flex-col xl:flex-row gap-8 justify-center p-1 xl:p-8 w-full">
1418
<div class="flex flex-col gap-2 md:gap-8 max-w-7xl w-full">
19+
<ol class="bcu-breadcrumb">
20+
<li class="bcu-crumb capitalize"><a href={`/${title}`}>{title}</a></li>
21+
<li class="bcu-crumb-separator" aria-hidden>&rsaquo;</li>
22+
<li>{data.content.title}</li>
23+
</ol>
1524
{#if data?.content?.youtube}
1625
<Video
1726
sources={[
@@ -21,7 +30,10 @@
2130
}
2231
]}
2332
/>
33+
{:else if data?.content?.cover}
34+
<CloudinaryImage src={data.content.cover} alt={data.content.title} />
2435
{/if}
36+
2537
<section class="flex-grow w-full markdown flex flex-col gap-2 md:gap-8">
2638
{@html data.content.html}
2739
</section>

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/Course.svelte‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
import Video from '$lib/components/content/Video.svelte';
44
import type { Course } from '$lib/types';
55
import LessonCards from './LessonCards.svelte';
6+
import CloudinaryImage from '$lib/components/content/CloudinaryImage.svelte';
67
export let data: {
78
course: Course;
89
};
910
</script>
1011

1112
{#if data?.course}
12-
<div class="flex flex-col justify-center !text-token p-1 xl:p-8">
13-
<section class="justify-center flex flex-col gap-2 md:gap-8">
13+
<div class="flex flex-col justify-center !text-token p-1 xl:p-8 w-full items-center">
14+
<section class="justify-center flex flex-col gap-2 md:gap-8 max-w-7xl">
15+
<ol class="bcu-breadcrumb">
16+
<li class="bcu-crumb"><a href="/courses">Courses</a></li>
17+
<li class="bcu-crumb-separator" aria-hidden>&rsaquo;</li>
18+
<li>{data.course.title}</li>
19+
</ol>
1420
<div class="flex flex-col gap-2 md:gap-8">
1521
{#if data?.course?.youtube}
1622
<Video
@@ -21,8 +27,10 @@
2127
}
2228
]}
2329
/>
30+
{:else if data?.course?.cover}
31+
<CloudinaryImage src={data.course.cover} alt={data.course.title} />
2432
{/if}
25-
33+
<h1>{data.course.title}</h1>
2634
<section class="flex-grow w-full markdown flex flex-col gap-2 md:gap-8">
2735
{@html data.course.html}
2836
</section>

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/LessonCards.svelte‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
export let courseSlug: string;
66
</script>
77

8-
<section class="flex gap-2 md:gap-8">
8+
<section
9+
class="grid grid-cols-[repeat(1,minmax(0,_1fr))] md:grid-cols-[repeat(2,minmax(0,_1fr))] lg:md:grid-cols-[repeat(3,minmax(0,_1fr))] xl:grid-cols-[repeat(4,minmax(0,_1fr))] gap-2 md:gap-8"
10+
>
911
{#each lesson as l}
1012
<a href={`/course/${courseSlug}/lesson/${l.slug}`} class="link-primary">
11-
<div class="bcu-card">
13+
<div class="bcu-card h-full">
1214
<header class="bcu-card-header capitalize pb-2 text-xl font-bold">{l.title}</header>
1315
</div>
1416
</a>

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/lesson/[lessonSlug]/Lesson.svelte‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<script lang="ts">
22
import 'prism-themes/themes/prism-shades-of-purple.min.css';
33
import Video from '$lib/components/content/Video.svelte';
4-
import type { Lesson } from '$lib/types';
4+
import type { Lesson, Course } from '$lib/types';
55
export let data: {
6+
course: Course;
67
content: Lesson;
78
};
89
console.log(data?.content);
@@ -12,6 +13,15 @@
1213
<div class="flex justify-center">
1314
<section class="flex flex-col xl:flex-row gap-8 justify-center p-1 xl:p-8 w-full">
1415
<div class="flex flex-col gap-2 md:gap-8 max-w-7xl w-full">
16+
<ol class="bcu-breadcrumb">
17+
<li class="bcu-crumb"><a href="/courses">Courses</a></li>
18+
<li class="bcu-crumb-separator" aria-hidden>&rsaquo;</li>
19+
<li class="bcu-crumb">
20+
<a href={`/course/${data.course.slug}`}>{data.course.title}</a>
21+
</li>
22+
<li class="bcu-crumb-separator" aria-hidden>&rsaquo;</li>
23+
<li>{data.content.title}</li>
24+
</ol>
1525
{#if data?.content?.youtube}
1626
<Video
1727
sources={[

0 commit comments

Comments
 (0)