Skip to content

Commit

Permalink
Merge pull request #72 from brown-ccv/feat-control-cms
Browse files Browse the repository at this point in the history
feat: remove core files, add featured for pubs
  • Loading branch information
hetd54 authored Jul 18, 2024
2 parents 610722d + 489e0c9 commit 1cc7382
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 50 deletions.
60 changes: 12 additions & 48 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 Expand Up @@ -110,7 +121,7 @@ collections:
label: PDF
widget: file
- name: data
label: Data
label: Documentation Data
create: true
folder: src/content/data
media_folder: files
Expand All @@ -129,53 +140,6 @@ collections:
label: Category
widget: select
options: [ 'Study Design', 'Questionnaire', 'Changes to Questionnaire', 'Codebook', 'Appendices' ]
- name: graphs
label: Graphs & Figures
create: true
folder: src/content/graphs
fields:
- name: title
label: Title
widget: string
- name: year
i18n: duplicate
label: Year
widget: datetime
date_format: dd.MM.yyyy
time_format: false
format: yyyy
- name: image
i18n: duplicate
label: Image
widget: image
- name: history
label: Oral History
create: true
folder: src/content/history
fields:
- name: title
label: Title
widget: string
- name: category
label: Category
widget: select
options: [ 'Border Crossing and Working', 'Everyday Life and Return', 'Those Who Stay' ]
- name: interviewee
i18n: duplicate
label: Who conducted the Interview?
- name: year
i18n: duplicate
label: Year
widget: datetime
date_format: MM.yyyy
time_format: false
format: MM.yyyy
- name: description
label: Short Description
widget: text
- name: story
label: Full Story
widget: markdown
- name: news
label: News
identifier_field: pubDate
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 1cc7382

Please sign in to comment.