Feature: Shared Astro `base` and Keystatic `path`config (and data format)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Start by tracing the Keystatic collection configuration and Astro's defineCollection loader entry point described in the issue, then inspect how glob receives the base path and file pattern. The work is done when one shared collection config supplies the storage path and content format to Astro without duplicating those values.
Written by the indexing model from the issue text.
Description
In Astro 5 the new content collection loaders become the new default.
See https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections for how to migrate
Similar to https://github.com/Thinkmill/keystatic/issues/336 it would be great to have native support in Keystatic to make it easier to manage the Astro and Keystatic configs.
In this case, the shared information is where the data is stored and what format the data has.
My current solution is this:
In my keystatic config, export the path, for example:
export const contentBaseSubprojects = '/src/content/subprojects'
export const keystaticSubprojectsConfig = collection({
label: 'Teilprojekte',
slugField: 'title',
path: `${contentBaseSubprojects}/*`,
format: { contentField: 'content' },
schema: {
…
In my astro content config, use the same path:
export const astroSubprojectsDefinition = defineCollection({
loader: loader(contentBaseSubprojects, 'mdx'),
schema: ({ image }) =>
…
Ideally, I could so something like…
export const astroSubprojectsDefinition = defineCollection({
loader: astroKeystaticLoader(keystaticSubprojectsConfig),
schema: ({ image }) =>
…
…which would return something like…
return glob({
base: PATH, // PATH = keystatic.collection.path (without the `/*`)
pattern: `**\/[^_]*.${FORMAT}`, // FORMAT = keystatic.collection.format
})
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 159
- Avg merge
- 21h 41m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Thinkmill/keystatic
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
All issues in Thinkmill/keystatic
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·