first commit

This commit is contained in:
2026-02-18 14:07:18 +01:00
commit c48218e225
20 changed files with 10641 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
node_modules/
dist/
.astro/
.env
.DS_Store

4
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}

11
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

553
CHANGELOG.md Normal file
View File

@@ -0,0 +1,553 @@
# @keystatic/templates-astro
## 0.0.61
### Patch Changes
- Updated dependencies [[`c9aa648`](https://github.com/Thinkmill/keystatic/commit/c9aa648d9809837a96cbe9bbfa620361a12af3b8)]:
- @keystatic/core@0.5.48
- @keystatic/astro@5.0.6
## 0.0.60
### Patch Changes
- Updated dependencies [[`4a2a671`](https://github.com/Thinkmill/keystatic/commit/4a2a6715103fb900c78c4ef4ffeced2bb0d4765a), [`5d98a35`](https://github.com/Thinkmill/keystatic/commit/5d98a35a0b7691b9fb189bcf1072d6c9aee1d8c9)]:
- @keystatic/core@0.5.47
- @keystatic/astro@5.0.6
## 0.0.59
### Patch Changes
- Updated dependencies [[`0ae5599`](https://github.com/Thinkmill/keystatic/commit/0ae55994ce9867788eb92fe9d493b2658e23bd28)]:
- @keystatic/astro@5.0.6
- @keystatic/core@0.5.46
## 0.0.58
### Patch Changes
- Updated dependencies [[`3a4a854`](https://github.com/Thinkmill/keystatic/commit/3a4a8546cb05cd9f4ea734c9aa1e2dafeb9e5d9e)]:
- @keystatic/core@0.5.45
- @keystatic/astro@5.0.5
## 0.0.57
### Patch Changes
- [`9a970dd`](https://github.com/Thinkmill/keystatic/commit/9a970dd727b84a467964e1d1e235c8a6f8e19624) Thanks [@emmatown](https://github.com/emmatown)! - Republish template
## 0.0.56
### Patch Changes
- [#1404](https://github.com/Thinkmill/keystatic/pull/1404) [`e848667`](https://github.com/Thinkmill/keystatic/commit/e848667c8b3b46357b2b62d401e8be252b68e1aa) Thanks [@emmatown](https://github.com/emmatown)! - Update template to React 19
- Updated dependencies [[`9a73371`](https://github.com/Thinkmill/keystatic/commit/9a73371c642da0770536076cb7f4e70a0fe496f6), [`c300a68`](https://github.com/Thinkmill/keystatic/commit/c300a68253a3ea95662aae19fdae880727da899a), [`4c4b0ef`](https://github.com/Thinkmill/keystatic/commit/4c4b0efa8ecfc45053dee992f7ceb8566c520ede), [`e848667`](https://github.com/Thinkmill/keystatic/commit/e848667c8b3b46357b2b62d401e8be252b68e1aa)]:
- @keystatic/core@0.5.44
- @keystatic/astro@5.0.5
## 0.0.55
### Patch Changes
- [#1367](https://github.com/Thinkmill/keystatic/pull/1367) [`a361b0a`](https://github.com/Thinkmill/keystatic/commit/a361b0a551b62e08c25c2506103643046fb7b631) Thanks [@emmatown](https://github.com/emmatown)! - Add npm publishing provenance
- Updated dependencies [[`f006f08`](https://github.com/Thinkmill/keystatic/commit/f006f08f0a112fa56e5fc4e9ae4d9010c2220453), [`1a23c5b`](https://github.com/Thinkmill/keystatic/commit/1a23c5bd3b6595bfa4bf4c4e554717111e6e3a12), [`a361b0a`](https://github.com/Thinkmill/keystatic/commit/a361b0a551b62e08c25c2506103643046fb7b631), [`7a89c00`](https://github.com/Thinkmill/keystatic/commit/7a89c0079fac1a17396d58d9495b9492bb405678)]:
- @keystatic/core@0.5.43
- @keystatic/astro@5.0.4
## 0.0.54
### Patch Changes
- Updated dependencies [[`c65f48b`](https://github.com/Thinkmill/keystatic/commit/c65f48baa26e13f95e1a9bcdd41a203fbc59f545), [`0b0864f`](https://github.com/Thinkmill/keystatic/commit/0b0864f55d2893fecbc4cbdaa88a306f84e6f1dd), [`f6c883a`](https://github.com/Thinkmill/keystatic/commit/f6c883aa8d2da2c484e6e0105d59a85ed1859a63), [`46d9c55`](https://github.com/Thinkmill/keystatic/commit/46d9c55cf17faea7b17568d4850e0b29dc362b52), [`0d69577`](https://github.com/Thinkmill/keystatic/commit/0d69577c4b6dbfdc6f447e3aab7bd8ce7e254f0c)]:
- @keystatic/core@0.5.42
- @keystatic/astro@5.0.3
## 0.0.53
### Patch Changes
- Updated dependencies [[`02a7441`](https://github.com/Thinkmill/keystatic/commit/02a7441ed722bf93f32f236cc90521549a5e0a9f)]:
- @keystatic/core@0.5.41
- @keystatic/astro@5.0.3
## 0.0.52
### Patch Changes
- Updated dependencies [[`6d0a8c3`](https://github.com/Thinkmill/keystatic/commit/6d0a8c3a43d0e641629bc12c582fa6744c699763)]:
- @keystatic/core@0.5.40
- @keystatic/astro@5.0.3
## 0.0.51
### Patch Changes
- Updated dependencies [[`dccad1a`](https://github.com/Thinkmill/keystatic/commit/dccad1ac9913a7d31415150cb12e4f80b192c5a5), [`92fc874`](https://github.com/Thinkmill/keystatic/commit/92fc8747d6fc4dcb48461517754725d16df4b1f6)]:
- @keystatic/core@0.5.39
- @keystatic/astro@5.0.3
## 0.0.50
### Patch Changes
- Updated dependencies [[`f005ab2`](https://github.com/Thinkmill/keystatic/commit/f005ab223888df1d7187759e72bfd0303027b1ff), [`c8d3865`](https://github.com/Thinkmill/keystatic/commit/c8d3865154a35253cfa552abf30b0da497fb1059)]:
- @keystatic/astro@5.0.2
- @keystatic/core@0.5.38
## 0.0.49
### Patch Changes
- Updated dependencies [[`6d7fae2`](https://github.com/Thinkmill/keystatic/commit/6d7fae2c51a3ecd5b543993f145fda1dbea8f0f0), [`6d7fae2`](https://github.com/Thinkmill/keystatic/commit/6d7fae2c51a3ecd5b543993f145fda1dbea8f0f0)]:
- @keystatic/core@0.5.37
- @keystatic/astro@5.0.1
## 0.0.48
### Patch Changes
- Updated dependencies [[`f7f659d`](https://github.com/Thinkmill/keystatic/commit/f7f659ddc3fd22bd446878af6fd0cdb7ee221165), [`1e58af4`](https://github.com/Thinkmill/keystatic/commit/1e58af4a340924d6eaafc3e89b091fe92f2b9937), [`0b4d6df`](https://github.com/Thinkmill/keystatic/commit/0b4d6dfc2cc1329ebeefb734f1a5c9ba6a2983f1)]:
- @keystatic/core@0.5.36
- @keystatic/astro@5.0.0
## 0.0.47
### Patch Changes
- Updated dependencies [[`98bd2da`](https://github.com/Thinkmill/keystatic/commit/98bd2da2d4a09f15a018552f866439a18f066f95)]:
- @keystatic/core@0.5.35
- @keystatic/astro@5.0.0
## 0.0.46
### Patch Changes
- Updated dependencies [[`4fc1e6b`](https://github.com/Thinkmill/keystatic/commit/4fc1e6b324ec6afee5ca0266fedb9eaf9ae8846f)]:
- @keystatic/core@0.5.34
- @keystatic/astro@5.0.0
## 0.0.45
### Patch Changes
- Updated dependencies [[`09ef3b3`](https://github.com/Thinkmill/keystatic/commit/09ef3b3138a26cdbe6ad5b8f61e757a2762833d0), [`336b6da`](https://github.com/Thinkmill/keystatic/commit/336b6daae5adcb225253e17531fb9049aca1c2f5), [`58a49e4`](https://github.com/Thinkmill/keystatic/commit/58a49e40e1362b6700097cf427b7951c07161245), [`1b48613`](https://github.com/Thinkmill/keystatic/commit/1b4861332cd14d0b9296dee95ca2973790c52194)]:
- @keystatic/core@0.5.33
- @keystatic/astro@5.0.0
## 0.0.44
### Patch Changes
- Updated dependencies [[`768595d`](https://github.com/Thinkmill/keystatic/commit/768595d936cd9c1b22a10914db779aa1175c34e1)]:
- @keystatic/core@0.5.32
- @keystatic/astro@5.0.0
## 0.0.43
### Patch Changes
- Updated dependencies [[`0c1ed9b`](https://github.com/Thinkmill/keystatic/commit/0c1ed9b54f3e83a59b9cb24efdf2c19244dd2bd5)]:
- @keystatic/core@0.5.31
- @keystatic/astro@5.0.0
## 0.0.42
### Patch Changes
- Updated dependencies [[`77be9cc`](https://github.com/Thinkmill/keystatic/commit/77be9cc7e0fe024baa83d3cf4a29f1b3c28db445), [`9793fc5`](https://github.com/Thinkmill/keystatic/commit/9793fc517a8198f0e53f29d83186248655e80210), [`251cda5`](https://github.com/Thinkmill/keystatic/commit/251cda5fa688e47e136dd12579a06b8fb4368935), [`fdb6218`](https://github.com/Thinkmill/keystatic/commit/fdb6218a081d1ad4ce9c30f071b6ce13a130681d)]:
- @keystatic/core@0.5.30
- @keystatic/astro@5.0.0
## 0.0.41
### Patch Changes
- Updated dependencies [[`cd289e1`](https://github.com/Thinkmill/keystatic/commit/cd289e1099ff56f6185dce5ace01e0e52adc7010), [`9605f85`](https://github.com/Thinkmill/keystatic/commit/9605f8528b377722a2be516f33ae40d682557ade)]:
- @keystatic/core@0.5.29
- @keystatic/astro@5.0.0
## 0.0.40
### Patch Changes
- Updated dependencies [[`cfc1bdc`](https://github.com/Thinkmill/keystatic/commit/cfc1bdc52695c019fa5dfea6c2de0fd034f27016), [`36ea216`](https://github.com/Thinkmill/keystatic/commit/36ea216c4a473eeab60aff41cb9dfabfb45127b8), [`4125996`](https://github.com/Thinkmill/keystatic/commit/4125996d37a74d743059e66ced24af29e10bf6ab), [`cde7eca`](https://github.com/Thinkmill/keystatic/commit/cde7eca5e71d8bf3d9451035d8e395516167ebff)]:
- @keystatic/core@0.5.28
- @keystatic/astro@5.0.0
## 0.0.39
### Patch Changes
- Updated dependencies [[`f2e3258`](https://github.com/Thinkmill/keystatic/commit/f2e325807002c50a71e70927e9b89b0ba6192368), [`824760e`](https://github.com/Thinkmill/keystatic/commit/824760e3f39cbd5866a8670785126905f9d9e95e)]:
- @keystatic/core@0.5.27
- @keystatic/astro@5.0.0
## 0.0.38
### Patch Changes
- Updated dependencies [[`54f98af`](https://github.com/Thinkmill/keystatic/commit/54f98afee374733e71314e98dfaabd53a74d081f), [`dff4c8c`](https://github.com/Thinkmill/keystatic/commit/dff4c8cb7fe0a17771070f37fbf423c3993c74c7)]:
- @keystatic/core@0.5.26
- @keystatic/astro@5.0.0
## 0.0.37
### Patch Changes
- Updated dependencies [[`4e2449f`](https://github.com/Thinkmill/keystatic/commit/4e2449f18fecee95095a67e695972f8ea37f2d41), [`d3c99d7`](https://github.com/Thinkmill/keystatic/commit/d3c99d7c22f2688ec7c514289b134f9575180b18)]:
- @keystatic/core@0.5.25
- @keystatic/astro@5.0.0
## 0.0.36
### Patch Changes
- Updated dependencies [[`68d02c3`](https://github.com/Thinkmill/keystatic/commit/68d02c313e9e646e41a2eb9912e911755b3a7895), [`1138fe6`](https://github.com/Thinkmill/keystatic/commit/1138fe60ba5d97f5c5ce06be5840d841f4748df7)]:
- @keystatic/core@0.5.24
- @keystatic/astro@5.0.0
## 0.0.35
### Patch Changes
- Updated dependencies [[`41679be`](https://github.com/Thinkmill/keystatic/commit/41679be39197a81453475fc6796489ac7d2d69cf), [`aa1d092`](https://github.com/Thinkmill/keystatic/commit/aa1d0924238419344780e7611eb7fdc797c57be8)]:
- @keystatic/core@0.5.23
- @keystatic/astro@5.0.0
## 0.0.34
### Patch Changes
- Updated dependencies [[`69d429a`](https://github.com/Thinkmill/keystatic/commit/69d429a67b2777fd8cfd236ce6ceaad4d1975e07)]:
- @keystatic/core@0.5.22
- @keystatic/astro@5.0.0
## 0.0.33
### Patch Changes
- Updated dependencies [[`b22630f`](https://github.com/Thinkmill/keystatic/commit/b22630ffb657cd8f1409a1feec925ec051b831dd)]:
- @keystatic/core@0.5.21
- @keystatic/astro@5.0.0
## 0.0.32
### Patch Changes
- Updated dependencies [[`a588cb2`](https://github.com/Thinkmill/keystatic/commit/a588cb2fedf7e9a813d5f7818a94f4f8df2310d5), [`34dee8c`](https://github.com/Thinkmill/keystatic/commit/34dee8cd8829d2a8c3d91949fd96dcee9d9749d0)]:
- @keystatic/core@0.5.20
- @keystatic/astro@5.0.0
## 0.0.31
### Patch Changes
- Updated dependencies [[`a129ea4`](https://github.com/Thinkmill/keystatic/commit/a129ea4ea46a5d9c2ddec8aef4313d98cf13a575), [`73aa1b8`](https://github.com/Thinkmill/keystatic/commit/73aa1b856b7100d1ac033eb16bee5e7f630a2c3e), [`73aa1b8`](https://github.com/Thinkmill/keystatic/commit/73aa1b856b7100d1ac033eb16bee5e7f630a2c3e), [`a1a71c1`](https://github.com/Thinkmill/keystatic/commit/a1a71c1ab2313c4c0a85fdce3f9a802a14580ece)]:
- @keystatic/core@0.5.19
- @keystatic/astro@5.0.0
## 0.0.30
### Patch Changes
- [#1164](https://github.com/Thinkmill/keystatic/pull/1164) [`be255f9`](https://github.com/Thinkmill/keystatic/commit/be255f9446c3e1b1c47cadcdd0e5154d7cffc68a) Thanks [@emmatown](https://github.com/emmatown)! - Switch from deprecated `fields.document` to `fields.markdoc`
- Updated dependencies [[`86bd966`](https://github.com/Thinkmill/keystatic/commit/86bd966ff35981185030ce0850b8041e8a2dc5bb), [`dc7e028`](https://github.com/Thinkmill/keystatic/commit/dc7e0287b1cd1e6b4d09e3b39d390054b60fe130)]:
- @keystatic/core@0.5.18
- @keystatic/astro@5.0.0
## 0.0.29
### Patch Changes
- Updated dependencies [[`42975f4`](https://github.com/Thinkmill/keystatic/commit/42975f45ba071cf3e2659a67e75e86325ce84944), [`8c2abff`](https://github.com/Thinkmill/keystatic/commit/8c2abff7fe38ad3e1687de57f9bc550997619761)]:
- @keystatic/core@0.5.17
- @keystatic/astro@5.0.0
## 0.0.28
### Patch Changes
- Updated dependencies [[`21394c6`](https://github.com/Thinkmill/keystatic/commit/21394c65a8d507d4355cf71641690464c05d7ec8)]:
- @keystatic/core@0.5.16
- @keystatic/astro@5.0.0
## 0.0.27
### Patch Changes
- Updated dependencies [[`d3aa1f2`](https://github.com/Thinkmill/keystatic/commit/d3aa1f2386bd690936662d98724eb385564a26cd), [`aa13ea9`](https://github.com/Thinkmill/keystatic/commit/aa13ea917ce2611266c0008197cfea4c1427724c)]:
- @keystatic/core@0.5.15
- @keystatic/astro@5.0.0
## 0.0.26
### Patch Changes
- Updated dependencies [[`fe63e6a`](https://github.com/Thinkmill/keystatic/commit/fe63e6a77a695d7cafb5aadb12a7eb2e1c914f0b), [`adc0cf6`](https://github.com/Thinkmill/keystatic/commit/adc0cf6282494eb522f6d129a49a7dd9c25c9490), [`5271331`](https://github.com/Thinkmill/keystatic/commit/52713316c9a67058525491e8bba605b69f65c64c), [`7bc3e08`](https://github.com/Thinkmill/keystatic/commit/7bc3e08eb56ebaffd027efff0e1bc875a69df7f2), [`5271331`](https://github.com/Thinkmill/keystatic/commit/52713316c9a67058525491e8bba605b69f65c64c), [`7bc3e08`](https://github.com/Thinkmill/keystatic/commit/7bc3e08eb56ebaffd027efff0e1bc875a69df7f2)]:
- @keystatic/core@0.5.14
- @keystatic/astro@5.0.0
## 0.0.25
### Patch Changes
- Updated dependencies [[`b509e87`](https://github.com/Thinkmill/keystatic/commit/b509e8794b8e4676feb6e1f0982ddb80cc5376df), [`31286c0`](https://github.com/Thinkmill/keystatic/commit/31286c0e3ff0bd591853fdab70f7f797dad316f5)]:
- @keystatic/core@0.5.13
- @keystatic/astro@5.0.0
## 0.0.24
### Patch Changes
- Updated dependencies [a2d56566]
- Updated dependencies [603d85be]
- Updated dependencies [d37a5422]
- Updated dependencies [2c818862]
- Updated dependencies [5f11dcd2]
- Updated dependencies [d860d675]
- Updated dependencies [319c0dba]
- Updated dependencies [ce1696f6]
- Updated dependencies [a703043c]
- Updated dependencies [d20e1ad6]
- Updated dependencies [e819d5f2]
- @keystatic/core@0.5.12
- @keystatic/astro@5.0.0
## 0.0.23
### Patch Changes
- Updated dependencies [dbb9d3cb]
- @keystatic/core@0.5.11
- @keystatic/astro@5.0.0
## 0.0.22
### Patch Changes
- Updated dependencies [e1ebbdae]
- @keystatic/core@0.5.10
- @keystatic/astro@5.0.0
## 0.0.21
### Patch Changes
- Updated dependencies [847b9163]
- @keystatic/core@0.5.9
- @keystatic/astro@5.0.0
## 0.0.20
### Patch Changes
- Updated dependencies [4d1cee00]
- @keystatic/core@0.5.8
- @keystatic/astro@5.0.0
## 0.0.19
### Patch Changes
- Updated dependencies [c519f119]
- @keystatic/core@0.5.7
- @keystatic/astro@5.0.0
## 0.0.18
### Patch Changes
- Updated dependencies [c619ef2e]
- @keystatic/core@0.5.6
- @keystatic/astro@5.0.0
## 0.0.17
### Patch Changes
- Updated dependencies [8ad803c5]
- @keystatic/core@0.5.0
- @keystatic/astro@5.0.0
## 0.0.16
### Patch Changes
- 6a60ab3c: Updates the Astro integration to manage the custom `127.0.0.1` host and enables usage with `output: 'server'`
Keystatic used to require updating your `dev` script. It's now managed by the integration, feel free to simplify it!
```diff
- "dev": "astro dev --host 127.0.0.1"
+ "dev": "astro dev"
```
Moreover, Keystatic now lets you go full SSR! The following Astro config is now supported
```mjs
// astro.config.mjs
export default defineConfig({
output: 'server',
});
```
- Updated dependencies [6a60ab3c]
- Updated dependencies [e3947052]
- Updated dependencies [ee3f2038]
- @keystatic/astro@4.0.0
- @keystatic/core@0.4.0
## 0.0.15
### Patch Changes
- Updated dependencies [0b2432ed]
- Updated dependencies [f4aaa8e3]
- @keystatic/core@0.3.0
- @keystatic/astro@3.0.0
## 0.0.14
### Patch Changes
- d584b3f0: Support astro@4
- Updated dependencies [13206393]
- Updated dependencies [0ca7f47a]
- Updated dependencies [7a98fd68]
- Updated dependencies [56b6b121]
- Updated dependencies [3288c624]
- Updated dependencies [bd28cfd4]
- Updated dependencies [e32ff596]
- Updated dependencies [d584b3f0]
- Updated dependencies [16bd7064]
- Updated dependencies [e1c9e0cf]
- Updated dependencies [267845b1]
- @keystatic/core@0.2.5
- @keystatic/astro@2.0.1
## 0.0.13
### Patch Changes
- Updated dependencies [b768f147]
- Updated dependencies [32d22480]
- @keystatic/astro@2.0.0
- @keystatic/core@0.2.0
## 0.0.12
### Patch Changes
- b16ef684: Replace manually created pages for Keystatic with Astro integration that injects routes
## 0.0.11
### Patch Changes
- f47feaa7: Add support for Astro assets with image directory and publicPath in Keystatic config
- Updated dependencies [a754d573]
- Updated dependencies [e684e5ad]
- @keystatic/astro@1.0.2
## 0.0.10
### Patch Changes
- 36cb6803: Upgrading template to Astro v3
- Updated dependencies [36cb6803]
- @keystatic/astro@1.0.1
## 0.0.9
### Patch Changes
- Updated dependencies [03f0543c]
- Updated dependencies [c24dc631]
- Updated dependencies [6895c566]
- Updated dependencies [7310a672]
- Updated dependencies [c5407cce]
- Updated dependencies [ca6774b8]
- Updated dependencies [1f96ff27]
- Updated dependencies [03f0543c]
- Updated dependencies [7767c69a]
- @keystatic/core@0.1.0
- @keystatic/astro@1.0.0
## 0.0.8
### Patch Changes
- 2127a105: Add --host flag to astro dev command + version updates
- Updated dependencies [5c86514f]
- Updated dependencies [c43d7045]
- Updated dependencies [21395048]
- @keystatic/astro@0.0.9
- @keystatic/core@0.0.116
## 0.0.7
### Patch Changes
- 14c8d90b: Update to @astrojs/markdoc version that fixes a known bug
- Updated dependencies [ad46c9dd]
- Updated dependencies [47102969]
- @keystatic/core@0.0.115
## 0.0.6
### Patch Changes
- Updated dependencies [6b4c476c]
- Updated dependencies [f9f09616]
- @keystatic/core@0.0.114
## 0.0.5
### Patch Changes
- Updated dependencies [07c63bab]
- Updated dependencies [062ccf49]
- @keystatic/core@0.0.113
## 0.0.4
### Patch Changes
- Updated dependencies [efc83c9c]
- @keystatic/core@0.0.112
## 0.0.3
### Patch Changes
- Updated dependencies [bf6a27bb]
- @keystatic/core@0.0.111
## 0.0.2
### Patch Changes
- Updated dependencies [e667fb9c]
- Updated dependencies [aec6359b]
- Updated dependencies [e0c4c37e]
- Updated dependencies [781884f9]
- Updated dependencies [cafe3695]
- @keystatic/core@0.0.110
## 0.0.1
### Patch Changes
- 4fc2c61e: New Astro Keystatic CLI option + template
- Updated dependencies [4e595627]
- Updated dependencies [477b4e96]
- Updated dependencies [b832e495]
- Updated dependencies [b6f4fb12]
- Updated dependencies [68e3be7c]
- @keystatic/core@0.0.109

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Thinkmill Labs Pty Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

19
README.md Normal file
View File

@@ -0,0 +1,19 @@
# Keystatic in Astro
This template shows how you can use Keystatic in an Astro site.
To setup:
```bash
npm install
```
To run:
```
npm run dev
```
Admin UI: [http://127.0.0.1:4321/keystatic](http://127.0.0.1:4321/keystatic)
Homepage: [http://localhost:4321](http://localhost:4321)

9
astro.config.mjs Normal file
View File

@@ -0,0 +1,9 @@
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import markdoc from '@astrojs/markdoc';
import keystatic from '@keystatic/astro';
// https://astro.build/config
export default defineConfig({
integrations: [react(), markdoc(), keystatic()],
});

27
keystatic.config.ts Normal file
View File

@@ -0,0 +1,27 @@
import { config, fields, collection } from '@keystatic/core';
export default config({
storage: {
kind: 'local',
},
collections: {
posts: collection({
label: 'Posts',
slugField: 'title',
path: 'src/content/posts/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: 'Title' } }),
content: fields.markdoc({
label: 'Content',
options: {
image: {
directory: 'src/assets/images/posts',
publicPath: '../../assets/images/posts/',
},
},
}),
},
}),
},
});

25
layout.kdl Normal file
View File

@@ -0,0 +1,25 @@
layout {
tab_template name="ui" {
pane size=1 borderless=true {
plugin location="tab-bar"
}
children
}
ui name="edit" focus=true {
pane {
command "nvim"
}
}
ui name="dev" {
pane {
command "npm"
args "run" "dev"
}
}
ui name="term" {
pane
}
}

9800
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@@ -0,0 +1,28 @@
{
"name": "@keystatic/templates-astro",
"version": "0.0.61",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Thinkmill/keystatic/",
"directory": "templates/astro"
},
"dependencies": {
"@astrojs/markdoc": "^0.12.9",
"@astrojs/react": "^4.2.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"astro": "^5.2.5",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"@keystatic/astro": "^5.0.6",
"@keystatic/core": "^0.5.48"
},
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
}
}

9
public/favicon.svg Normal file
View File

@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
<style>
path { fill: #000; }
@media (prefers-color-scheme: dark) {
path { fill: #FFF; }
}
</style>
</svg>

After

Width:  |  Height:  |  Size: 749 B

11
src/content/config.ts Normal file
View File

@@ -0,0 +1,11 @@
// @ts-ignore
import { defineCollection, z } from 'astro:content';
const posts = defineCollection({
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
}),
});
export const collections = { posts };

View File

@@ -0,0 +1,6 @@
---
title: First post
---
First!
You can edit this page in the [Admin UI](/keystatic/collection/posts/item/first-post), or directly in your IDE at `src/content/posts/first-post.mdoc`.

2
src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

24
src/layouts/Layout.astro Normal file
View File

@@ -0,0 +1,24 @@
---
import '../styles.css'
export interface Props {
title: string;
}
const { title } = Astro.props;
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description">
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
</body>
</html>

29
src/pages/index.astro Normal file
View File

@@ -0,0 +1,29 @@
---
import { getCollection } from 'astro:content';
import Layout from '../layouts/Layout.astro';
const posts = await getCollection('posts');
---
<Layout title="Keystatic & Astro's Content Collections">
<div>
<h1>Keystatic ⚡️ + Astro 🚀</h1>
<p>
This homepage shows how to load data from Astro's content collections.
</p>
<p>
<a href="/keystatic">Click here to visit the Admin UI</a>, or the link
below to view a post in the collection.
</p>
<h2>Posts</h2>
<ul>
{
posts.map(post => (
<li>
<a href={`/posts/${post.slug}`}>{post.data.title}</a>
</li>
))
}
</ul>
</div>
</Layout>

View File

@@ -0,0 +1,22 @@
---
import { getCollection, getEntry } from 'astro:content';
import Layout from '../../layouts/Layout.astro';
const { slug } = Astro.params;
if (!slug) throw new Error('Slug not found');
const post = await getEntry('posts', slug);
if (!post) throw new Error('No post found for this slug');
const { Content } = await post.render();
// Generate static pages
export async function getStaticPaths() {
const posts = await getCollection('posts');
return posts.map(post => ({ params: { slug: post.slug } }));
}
---
<Layout title={post.data.title}>
<h1>{post.data.title}</h1>
<Content />
</Layout>

29
src/styles.css Normal file
View File

@@ -0,0 +1,29 @@
html {
max-width: 70ch;
padding: 3rem 1rem;
margin: auto;
line-height: 1.75;
font-size: 1.25rem;
font-family: sans-serif;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 1rem 0 1rem;
}
p,
ul,
ol {
margin-bottom: 1rem;
color: #1d1d1d;
}
img {
height: auto;
max-width: 100%;
}

7
tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
}