Skip to content

Commit

Permalink
add category and position to the "series" Astro collection
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleguido committed Oct 11, 2024
1 parent ce8e0c1 commit 54076d2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,23 @@ export const BrowserWsStatuses: string[] = [
BrowserWsStatusConnected,
BrowserWsStatusClosed,
]

export const SeriesCategoryTutorials = "tutorials"
export const SeriesCategoryExplorations = "explorations"
export const SeriesCategoryLLMs = "llms"

export const SeriesCategories: string[] = [
SeriesCategoryTutorials,
SeriesCategoryExplorations,
SeriesCategoryLLMs,
]

export const SeriesPositionLeadingColumn = "leading-column"
export const SeriesPositionCentralColumn = "central-column"
export const SeriesPositionTrailingColumn = "trailing-column"

export const SeriesPositions: string[] = [
SeriesPositionLeadingColumn,
SeriesPositionCentralColumn,
SeriesPositionTrailingColumn,
]
9 changes: 8 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { z, defineCollection, reference } from "astro:content"
import { Requirements, Features } from "../constants"
import {
Requirements,
Features,
SeriesCategories,
SeriesPositions,
} from "../constants"

const notebooks = defineCollection({
type: "content", // v2.5.0 and later
Expand Down Expand Up @@ -60,6 +65,8 @@ const series = defineCollection({
schema: z.object({
title: z.string(),
excerpt: z.string(),
category: z.array(z.enum(SeriesCategories as any)).optional(),
position: z.string(z.enum(SeriesPositions as any)).optional(),
notebooks: z.array(reference("notebooks")),
}),
})
Expand Down
5 changes: 5 additions & 0 deletions src/content/series/entities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
title: Explore and Visualise your Data
excerpt: "Use Impresso notebook templates as starting points for your analysis."
notebooks:
- impresso-py-maps
- impresso-py-network
- generic-entity-api
category:
- explorations
position: central-column
---

0 comments on commit 54076d2

Please sign in to comment.