Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AstroJS] Keystatic doesn't show files from Content Collection #519

Open
teinett opened this issue Aug 11, 2023 · 6 comments
Open

[AstroJS] Keystatic doesn't show files from Content Collection #519

teinett opened this issue Aug 11, 2023 · 6 comments
Labels
framework:astro Related to the Astro framework. roadmap Something we're planning to solve

Comments

@teinett
Copy link
Contributor

teinett commented Aug 11, 2023

I have AstroJS project, and I added Keystatic.

I have several pages in src/content folder, and it works in Astro:

2023-08-10 18-07-46

File src/content/config.ts:

import { z, defineCollection } from "astro:content";

const docsCollection = defineCollection({
    type: "content",
    schema: z.object({
        title: z.string(),
    }),
});

export const collections = {
    docs: docsCollection,
};

File keystatic.config.ts:

import { config, fields, collection } from "@keystatic/core";

export default config({
    storage: {
        kind: "local",
    },
    collections: {
        docs: collection({
            label: "Documents",
            slugField: "title",
            path: "src/content/docs/*",
            format: { contentField: "content" },
            schema: {
                title: fields.slug({ name: { label: "Title" } }),
                content: fields.document({
                    label: "Content",
                    formatting: true,
                    dividers: true,
                    links: true,
                    images: true,
                }),
            },
        }),
    },
});

Example of mdoc file: src/content/docs/en/about.mdoc

---
title: "About website"
---

# About website

## Website Feedback

Снимок экрана 2023-08-10 в 18 08 21

I go to my Keystatic admin.

What I see: No results No items matching "" were found.

What I expected to see: the list of my mdoc files form existing AstroJS project.

2023-08-10 18-03-33

Node 18.17.0
MacOS Catalina

"dependencies": {
"@astrojs/markdoc": "^0.4.4",
"@astrojs/node": "^5.3.2",
"@astrojs/react": "^2.2.1",
"@keystatic/astro": "^0.0.8",
"@keystatic/core": "^0.0.114",
"@types/react": "^18.2.18",
"@types/react-dom": "^18.2.7",
"accept-language": "^3.0.18",
"astro": "^2.10.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

@florian-lefebvre
Copy link
Contributor

It doesn't support slugs with several variables yet, see #340

@teinett
Copy link
Contributor Author

teinett commented Aug 12, 2023

It doesn't support slugs with several variables yet, see #340

Thanks for the info.

@JedWatson
Copy link
Member

Confirming what @florian-lefebvre said, and also noting that you're specifically using Astro's convention for different languages (ref https://docs.astro.build/en/recipes/i18n/)

I've been thinking about adding a feature specific to content translation that would show you a language dropdown for each entry in the UI, rather than showing you all the entries in one list and treating en or ru (in your content above) as just another part of the slug.

We'll have a look at it this week and get back to you with when we can add support for this.

@JedWatson JedWatson added the roadmap Something we're planning to solve label Aug 13, 2023
@tiwka19
Copy link

tiwka19 commented Aug 17, 2023

Confirming what @florian-lefebvre said, and also noting that you're specifically using Astro's convention for different languages (ref https://docs.astro.build/en/recipes/i18n/)

I've been thinking about adding a feature specific to content translation that would show you a language dropdown for each entry in the UI, rather than showing you all the entries in one list and treating en or ru (in your content above) as just another part of the slug.

We'll have a look at it this week and get back to you with when we can add support for this.

ADMIN UI still doesn't see the posts, even with path: 'src/content/blog/**' in path

@teinett
Copy link
Contributor Author

teinett commented Jan 27, 2024

@JedWatson Do you already have an estimated time when this feature will be available in production? Can't wait to try your admin on real projects. :)

@jossmac jossmac added the framework:astro Related to the Astro framework. label Apr 12, 2024
@simonswiss
Copy link
Collaborator

Collating this in #1080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework:astro Related to the Astro framework. roadmap Something we're planning to solve
Projects
None yet
Development

No branches or pull requests

6 participants