Skip to content

Commit 821d746

Browse files
committed
initial add back of Courses
1 parent 48222f2 commit 821d746

File tree

14 files changed

+952
-94
lines changed

14 files changed

+952
-94
lines changed

apps/sanity/sanity.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ import tableSchema, { rowType } from "./schemas/custom/table";
4949
import podcastSeries from "./schemas/documents/podcastSeries";
5050
import category from "./schemas/documents/category";
5151
import short from "./schemas/documents/short";
52+
import lesson from "./schemas/documents/lesson";
53+
import course from "./schemas/documents/course";
5254

5355
// ── Shared constants ─────────────────────────────────────────────────
5456
const projectId = process.env.SANITY_STUDIO_PROJECT_ID || "hfh83o0w";
@@ -111,6 +113,8 @@ const schemaTypes = [
111113
podcastSeries,
112114
category,
113115
short,
116+
lesson,
117+
course,
114118
];
115119

116120
// ── Shared document actions ──────────────────────────────────────────
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { GiTeacher } from "react-icons/gi";
2+
import { defineField, defineType } from "sanity";
3+
4+
import contentType from "../partials/content";
5+
import lessonType from "./lesson";
6+
7+
export default defineType({
8+
...contentType,
9+
name: "course",
10+
title: "Course",
11+
icon: GiTeacher,
12+
type: "document",
13+
groups: [
14+
...(contentType.groups || []),
15+
{
16+
name: "sections",
17+
title: "Sections / Lessons",
18+
default: true,
19+
},
20+
],
21+
fields: [
22+
...contentType.fields,
23+
defineField({
24+
name: "stripeProduct",
25+
title: "Stripe Product Id",
26+
type: "string",
27+
}),
28+
defineField({
29+
name: "sections",
30+
title: "Sections",
31+
type: "array",
32+
group: "sections",
33+
of: [
34+
{
35+
name: "section",
36+
title: "Section",
37+
type: "object",
38+
fields: [
39+
defineField({
40+
name: "title",
41+
title: "Title",
42+
type: "string",
43+
}),
44+
defineField({
45+
name: "lesson",
46+
title: "Lessons",
47+
type: "array",
48+
of: [
49+
{
50+
type: "reference",
51+
to: [{ type: lessonType.name }],
52+
},
53+
],
54+
}),
55+
],
56+
},
57+
],
58+
}),
59+
],
60+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { PiStudentBold } from "react-icons/pi";
2+
import { defineField, defineType } from "sanity";
3+
4+
import contentType from "../partials/content";
5+
6+
export default defineType({
7+
...contentType,
8+
name: "lesson",
9+
title: "Lesson",
10+
icon: PiStudentBold,
11+
type: "document",
12+
fields: [
13+
...contentType.fields,
14+
defineField({
15+
name: "locked",
16+
title: "Locked",
17+
type: "boolean",
18+
}),
19+
],
20+
});

apps/web/astro.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,13 @@ export default defineConfig({
100100
"lodash",
101101
"lodash/isObject",
102102
],
103+
// Pre-bundling breaks under Cloudflare Workers SSR (missing deps_ssr chunk); load package as-is
104+
exclude: ["@sanity/preview-url-secret"],
103105
},
104106
ssr: {
107+
optimizeDeps: {
108+
exclude: ["@sanity/preview-url-secret"],
109+
},
105110
external: ["buffer", "path", "fs"].map((i) => `node:${i}`),
106111
},
107112
},

apps/web/src/components/Footer.astro

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ import Container from "./Container.astro";
1313
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
1414
{/* Brand Column */}
1515
<div class="lg:col-span-1 space-y-4">
16-
<a href="/" class="flex items-center gap-2 font-bold text-lg text-[--text]">
16+
<a
17+
href="/"
18+
class="flex items-center gap-2 font-bold text-lg text-[--text]"
19+
>
1720
<span class="text-2xl">🐱</span>
1821
CodingCat<span class="text-primary">.dev</span>
1922
</a>
2023
<p class="text-sm text-[--text-secondary]">
21-
Purrfect Web Development Tutorials — blog posts, podcasts, courses, and videos.
24+
Purrfect Web Development Tutorials — blog posts, podcasts, courses,
25+
and videos.
2226
</p>
2327
{/* Compact newsletter */}
2428
<form class="flex gap-2">
@@ -40,31 +44,95 @@ import Container from "./Container.astro";
4044
<div>
4145
<h4 class="font-semibold text-sm text-[--text] mb-3">Content</h4>
4246
<ul class="space-y-2">
43-
<li><a href="/blog" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Blog</a></li>
44-
<li><a href="/podcasts" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Podcast</a></li>
45-
<li><a href="/authors" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Authors</a></li>
46-
<li><a href="/guests" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Guests</a></li>
47+
<li>
48+
<a
49+
href="/blog"
50+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
51+
>Blog</a>
52+
</li>
53+
<li>
54+
<a
55+
href="/podcasts"
56+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
57+
>Podcast</a>
58+
</li>
59+
<li>
60+
<a
61+
href="/courses"
62+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
63+
>Courses</a>
64+
</li>
65+
<li>
66+
<a
67+
href="/authors"
68+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
69+
>Authors</a>
70+
</li>
71+
<li>
72+
<a
73+
href="/guests"
74+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
75+
>Guests</a>
76+
</li>
4777
</ul>
4878
</div>
4979

5080
{/* Connect Links */}
5181
<div>
5282
<h4 class="font-semibold text-sm text-[--text] mb-3">Connect</h4>
5383
<ul class="space-y-2">
54-
<li><a href="https://youtube.com/@codingcatdev" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors" target="_blank" rel="noopener">YouTube</a></li>
55-
<li><a href="https://twitter.com/codingcatdev" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors" target="_blank" rel="noopener">Twitter / X</a></li>
56-
<li><a href="https://github.com/codingcatdev" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors" target="_blank" rel="noopener">GitHub</a></li>
57-
<li><a href="/rss.xml" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">RSS Feed</a></li>
84+
<li>
85+
<a
86+
href="https://youtube.com/@codingcatdev"
87+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
88+
target="_blank"
89+
rel="noopener">YouTube</a>
90+
</li>
91+
<li>
92+
<a
93+
href="https://twitter.com/codingcatdev"
94+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
95+
target="_blank"
96+
rel="noopener">Twitter / X</a>
97+
</li>
98+
<li>
99+
<a
100+
href="https://github.com/codingcatdev"
101+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
102+
target="_blank"
103+
rel="noopener">GitHub</a>
104+
</li>
105+
<li>
106+
<a
107+
href="/rss.xml"
108+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
109+
>RSS Feed</a>
110+
</li>
58111
</ul>
59112
</div>
60113

61114
{/* Legal Links */}
62115
<div>
63116
<h4 class="font-semibold text-sm text-[--text] mb-3">Legal</h4>
64117
<ul class="space-y-2">
65-
<li><a href="/privacy" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Privacy Policy</a></li>
66-
<li><a href="/terms" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Terms of Service</a></li>
67-
<li><a href="/sponsors" class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors">Sponsors</a></li>
118+
<li>
119+
<a
120+
href="/privacy"
121+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
122+
>Privacy Policy</a>
123+
</li>
124+
<li>
125+
<a
126+
href="/terms"
127+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
128+
>Terms of Service</a>
129+
</li>
130+
<li>
131+
<a
132+
href="/sponsors"
133+
class="text-sm text-[--text-secondary] hover:text-[--text] transition-colors"
134+
>Sponsors</a>
135+
</li>
68136
</ul>
69137
</div>
70138
</div>

0 commit comments

Comments
 (0)