Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
feat: custom map on map page
Browse files Browse the repository at this point in the history
  • Loading branch information
hetd54 committed Jul 15, 2024
1 parent 683d520 commit 6ab2246
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
11 changes: 11 additions & 0 deletions public/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ i18n:
# The locale to be used for fields validation and as a baseline for the entry.
default_locale: en
collections:
- name: map
label: Map
folder: src/content/map
create: false
fields:
- name: title
label: Map Version
widget: text
- name: image
label: MMP Community Map
widget: image
- name: people
label: People
folder: src/content/people
Expand Down
16 changes: 15 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ const people = defineCollection({
bio: z.string(),
}),
})
export const collections = { news: news, data: files, people: people, publications: publications }

const map = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
image: z.string(),
}),
})
export const collections = {
news: news,
data: files,
people: people,
publications: publications,
map: map,
}
4 changes: 4 additions & 0 deletions src/content/map/174.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "174"
image: /public/images/MMP_Map.jpg
---
7 changes: 6 additions & 1 deletion src/pages/map.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
import { ReaderIcon } from "@radix-ui/react-icons"
import Layout from "../layouts/Layout.astro"
import { getCollection } from "astro:content"
const data = await getCollection("map")
const maps = data.map((d) => d.data)
---

<Layout title="Map of MMP Communities" description="Mesoamerican Migration Project">
<div class="flex flex-col gap-6">
<section class="flex flex-col gap-3.5">
<img src="/images/MMP_Map.jpg" />
{maps.map((map) => <img src={map.image} />)}
</section>
<section class="readable">
<a
Expand Down

0 comments on commit 6ab2246

Please sign in to comment.