Skip to content

Commit 80b822f

Browse files
Fix the json editor disposal and updated classifieds with ginger
1 parent 0edbc11 commit 80b822f

File tree

5 files changed

+47
-9
lines changed

5 files changed

+47
-9
lines changed

src/components/HomePageSide.astro

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getCollection } from "astro:content";
33
44
const posts = await getCollection("writing");
55
const streams = await getCollection("stream");
6+
const classifieds = await getCollection("classified");
67
const collections = [...posts, ...streams];
78
89
// Get unique tags
@@ -23,6 +24,10 @@ collections.forEach((post) => {
2324
}
2425
});
2526
27+
const latestClassifieds = classifieds
28+
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf())
29+
.slice(0, 2);
30+
2631
const tagList = Array.from(tags)
2732
.sort((a, b) => (counts.get(b) ?? 0) - (counts.get(a) ?? 0))
2833
.slice(0, 10);
@@ -55,7 +60,8 @@ const toPascalCase = (tag: string): string => {
5560
<h4>
5661
🔖 Top 10 <a
5762
class="dark:text-slate-100 hover:underline hover:text-purple-500 visited:text-amber-600 dark:visited:text-purple-300"
58-
href="/blog/tag">Tags</a>
63+
href="/blog/tag">Tags</a
64+
>
5965
</h4>
6066
<ul class="flex flex-wrap gap-2 list-none m-0 p-0 print:hidden">
6167
{
@@ -119,4 +125,26 @@ const toPascalCase = (tag: string): string => {
119125
>
120126
</form>
121127
</div>
128+
<hr class="mt-10 mb-10" />
129+
<div class="prose dark:prose-invert !max-w-none">
130+
<h4>
131+
<a href="/curation/classified" class="hover:text-purple-500"
132+
>Latest Classifieds</a
133+
>
134+
</h4>
135+
<ul>
136+
{
137+
latestClassifieds.map((classified) => (
138+
<li>
139+
<a
140+
class="dark:text-slate-100 hover:underline hover:text-purple-500 visited:text-amber-600 dark:visited:text-purple-300"
141+
href={`/curation/classified/${classified.slug}`}
142+
>
143+
{classified.data.title}
144+
</a>
145+
</li>
146+
))
147+
}
148+
</ul>
149+
</div>
122150
</div>

src/components/JSONEditor.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
3838
// Create highlighter once
3939
async function initHighlighter() {
40+
if (highlighter) {
41+
// If you create a new highlighter, you need to dispose the old one
42+
highlighter.dispose();
43+
}
4044
highlighter = await createHighlighter({
4145
themes: ["github-dark"],
4246
langs: ["graphql"],
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
draft: false
33
expired: false
4-
link: "https://www.linkedin.com/in/marlone-akidiva/"
4+
link: "https://www.marlone.tech/"
55
location: "Nairobi, Kenya or Remote"
66
pubDate: "2024-06-05T18:00:09.000Z"
77
tags: ["looking-for-work"]
@@ -11,8 +11,11 @@ referrer: Personal
1111

1212
I've worked with Marlone for the past 5 years, and he's a fantastic developer. Here's his blurb.
1313

14-
> I am a skilled software engineer with 7+ years of professional experience. I excel in building user-friendly and intuitive designs, implementing functional web applications, and improving customer conversion rates. My expertise lies in JavaScript, Node.js, React.js, and responsive web design, along with skills in TypeScript, CSS, UI design, and UI patterns.
14+
> I am a skilled software engineer with 7+ years of professional experience. I excel in building user-friendly and intuitive designs, implementing functional web applications, and improving customer conversion rates. My expertise lies in JavaScript, Node.js, React.js, and responsive web design, along with skills in TypeScript, CSS, UI design, and UI patterns.
1515
>
1616
> My most notable career achievement has been building the Clear Labs PCR culturing and antigen-based tests platform.
17-
>
17+
>
1818
> The project gained Clear Labs 15 additional customers within the first 3months of release and was able to secure the company a series C funding of $60milliion in an oversubscribed funding round due to the level of interest it generated. The funding was able to be used to help increase the availability of the company's solutions to help labs and clinicians more easily identify and trace all strains of pathogens, like SARS-CoV-2, Salmonella and Listeria.
19+
20+
- [Website](https://www.marlone.tech/)
21+
- [LinkedIn](https://www.linkedin.com/in/marlone-akidiva/)

src/content/config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ const writing = defineCollection({
3030
const log = defineCollection({
3131
// Type-check frontmatter using a schema
3232
schema: z.object({
33-
previousEntry: reference("log").optional(),
34-
nextEntry: reference("log").optional(),
33+
// previousEntry: reference("log").optional(),
34+
// nextEntry: reference("log").optional(),
35+
previousEntry: z.string().optional(),
36+
nextEntry: z.string().optional(),
3537
description: z.string(),
3638
draft: z.boolean().optional(),
3739
heroImage: z
@@ -295,6 +297,7 @@ const curation = defineCollection({
295297
const classified = defineCollection({
296298
schema: z.object({
297299
draft: z.boolean().optional(),
300+
expired: z.boolean().optional(),
298301
referrer: z.string(),
299302
link: z.string(),
300303
location: z.string().optional(),

src/pages/curation/classified/index.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import CurationDetailsPage from "../../../layouts/CurationDetailsPage.astro";
44
import FormattedDate from "../../../components/FormattedDate.astro";
55
import ProseArticle from "../../../components/ProseArticle.astro";
66
7-
const classifieds = (await getCollection("classified")).sort(
8-
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
9-
);
7+
const classifieds = (await getCollection("classified"))
8+
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf())
9+
.filter((classified) => !classified.data.draft || !classified.data.expired);
1010
const entry = await getEntry("curation", "classified");
1111
const { heroImage, heroImageAlt } = entry.data;
1212
---

0 commit comments

Comments
 (0)