keystatic.config.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { config, fields, collection } from '@keystatic/core';
  2. export default config({
  3. storage: {
  4. kind: 'local',
  5. },
  6. collections: {
  7. posts: collection({
  8. label: 'Posts',
  9. slugField: 'title',
  10. path: 'src/content/posts/*',
  11. format: { contentField: 'content' },
  12. schema: {
  13. title: fields.slug({ name: { label: 'Title' } }),
  14. link: fields.url({ label: "Link" }),
  15. content: fields.markdoc({
  16. label: 'Content',
  17. }),
  18. },
  19. }),
  20. projects: collection({
  21. label: 'Projects',
  22. slugField: 'title',
  23. path: 'src/content/projects/*',
  24. format: { contentField: 'content' },
  25. schema: {
  26. title: fields.slug({ name: { label: 'Title' } }),
  27. demo: fields.url({ label: "Demo" }),
  28. source: fields.url({ label: "Source" }),
  29. content: fields.markdoc({
  30. label: 'Content',
  31. }),
  32. },
  33. }),
  34. about: collection({
  35. label: 'About',
  36. slugField: 'name',
  37. path: 'src/content/about/*',
  38. format: { contentField: 'content' },
  39. schema: {
  40. name: fields.slug({ name: { label: "Name" } }),
  41. location: fields.text({ label: "Location" }),
  42. content: fields.markdoc({
  43. label: 'Content',
  44. }),
  45. },
  46. }),
  47. contact: collection({
  48. label: 'Contact',
  49. slugField: 'title',
  50. path: 'src/content/contact/*',
  51. format: { contentField: 'content' },
  52. schema: {
  53. title: fields.slug({ name: { label: 'Title' } }),
  54. email: fields.text({ label: "E-Mail" }),
  55. content: fields.markdoc({
  56. label: 'Content',
  57. }),
  58. },
  59. }),
  60. },
  61. });