... | @@ -2,12 +2,30 @@ https://docs.astro.build/en/guides/markdown-content/#mdx-features |
... | @@ -2,12 +2,30 @@ https://docs.astro.build/en/guides/markdown-content/#mdx-features |
|
|
|
|
|
I am currently experimenting with Astro: https://github.com/upsiflu/astro-blog
|
|
I am currently experimenting with Astro: https://github.com/upsiflu/astro-blog
|
|
|
|
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph TD
|
|
|
|
A[CMS] --> B{Data Model (Directus)}
|
|
|
|
B --> |Client Sdk| C{Content with frontmatter mirroring all Data Model fields (mdx files)}
|
|
|
|
B --> |OpenAPI3| D{Type definitions for all fields (zod schema file)}
|
|
|
|
C --> E[Static site]
|
|
|
|
D --> E
|
|
|
|
```
|
|
|
|
|
|
# Integration with Directus
|
|
# Integration with Directus
|
|
|
|
|
|
* [ ] Each published .mdx should be put into the directory `content` resp. `content/blog`.
|
|
### Collections: Directus -> Astro [\[Announcement\]](https://astro.build/blog/introducing-content-collections/) [\[Docs\]](https://docs.astro.build/en/guides/content-collections/)
|
|
* [ ] Astro will build pages from these.
|
|
|
|
|
|
* [x] Each published .mdx is written into the directory `content/<Collection>`.
|
|
|
|
* [ ] All fields are written into the frontmatter.
|
|
|
|
* [ ] Field types downloaded from Directus' AOS API will be converted to [zod](https://github.com/colinhacks/zod) schemas and written into content/config.ts
|
|
|
|
|
|
|
|
### Static site: Local .mdx files -> Html server
|
|
|
|
|
|
|
|
* [x] Astro will build pages from these.
|
|
* [ ] When writing a page in the Directus editor, you can use predefined components.
|
|
* [ ] When writing a page in the Directus editor, you can use predefined components.
|
|
* [ ] Drafts can be specified with the `draft: true` MD(x) frontmatter directive and will be automatically hidden by Astro.
|
|
* [ ] Drafts can be specified with the `draft: true` MD(x) frontmatter directive and will be automatically hidden by Astro. (TODO: Check what the corresponding convention in Directusland is, and if we can translate losslessly)
|
|
|
|
* [ ] If each site has a unique slug, we can realise a flat sitemat for authored content (in addition to a hierarchical sitemap where we can have logbook/x). TODO: Who should generate the slugs? (a) Directus, adding a non-writable field via a `flow` (b) Astro, using some slug library (c) the author, via a writeable field that only allows url-safe characters? I'm leaning towards (a) for consistency and uniqueness guarantees, and to establish directus as single-source-of-truth.
|
|
|
|
|
|
## Customization
|
|
## Customization
|
|
|
|
|
... | @@ -26,8 +44,7 @@ Defining blocks and components in the CMS is preferrable to hardcoding them in . |
... | @@ -26,8 +44,7 @@ Defining blocks and components in the CMS is preferrable to hardcoding them in . |
|
|
|
|
|
#### Template/Ui i18n
|
|
#### Template/Ui i18n
|
|
|
|
|
|
I found https://astro-i18next.yassinedoghri.com/\
|
|
I found https://astro-i18next.yassinedoghri.com/\\\\ which seems amazing for Ui and template localization (time, date, pluralization etc.) but what about blog posts that are available in several languages?
|
|
which seems amazing for Ui and template localization (time, date, pluralization etc.) but what about blog posts that are available in several languages?
|
|
|
|
|
|
|
|
#### Multilingual Content
|
|
#### Multilingual Content
|
|
|
|
|
... | | ... | |