|
| 1 | +import { EntityCollection } from "@firecms/core"; |
| 2 | + |
| 3 | +export const pagesCollection: EntityCollection = { |
| 4 | + id: "pages", |
| 5 | + path: "pages", |
| 6 | + name: "Pages", |
| 7 | + singularName: "Page", |
| 8 | + icon: "insert_drive_file", |
| 9 | + description: "List of website pages that can be edited here", |
| 10 | + properties: { |
| 11 | + title: { |
| 12 | + dataType: "string", |
| 13 | + name: "Page Title", |
| 14 | + validation: { required: true } |
| 15 | + }, |
| 16 | + slug: { |
| 17 | + dataType: "string", |
| 18 | + name: "URL Slug", |
| 19 | + validation: { |
| 20 | + required: true, |
| 21 | + unique: true, |
| 22 | + matches: /^[a-z0-9]+(?:-[a-z0-9]+)*$/, |
| 23 | + matchesMessage: "Must be lowercase, alphanumeric, and hyphenated" |
| 24 | + } |
| 25 | + }, |
| 26 | + hero_section: { |
| 27 | + dataType: "map", |
| 28 | + name: "Hero Section", |
| 29 | + properties: { |
| 30 | + headline: { |
| 31 | + dataType: "string", |
| 32 | + name: "Headline", |
| 33 | + validation: { required: true } |
| 34 | + }, |
| 35 | + subhead: { |
| 36 | + dataType: "string", |
| 37 | + name: "Subheadline" |
| 38 | + }, |
| 39 | + background_image: { |
| 40 | + dataType: "string", |
| 41 | + name: "Background Image", |
| 42 | + storage: { |
| 43 | + storagePath: "page_hero/images", |
| 44 | + acceptedFiles: ["image/*"], |
| 45 | + } |
| 46 | + }, |
| 47 | + call_to_action: { |
| 48 | + dataType: "string", |
| 49 | + name: "Call to Action" |
| 50 | + }, |
| 51 | + call_to_action_link: { |
| 52 | + dataType: "string", |
| 53 | + name: "CTA Link", |
| 54 | + url: true |
| 55 | + } |
| 56 | + } |
| 57 | + }, |
| 58 | + content: { |
| 59 | + dataType: "array", |
| 60 | + name: "Content", |
| 61 | + oneOf: { |
| 62 | + properties: { |
| 63 | + section: { |
| 64 | + dataType: "map", |
| 65 | + name: "Section", |
| 66 | + properties: { |
| 67 | + title: { |
| 68 | + dataType: "string", |
| 69 | + name: "Section Title", |
| 70 | + validation: { required: true } |
| 71 | + }, |
| 72 | + content: { |
| 73 | + dataType: "string", |
| 74 | + name: "Section Content", |
| 75 | + markdown: true |
| 76 | + }, |
| 77 | + image: { |
| 78 | + dataType: "string", |
| 79 | + name: "Section Image", |
| 80 | + storage: { |
| 81 | + storagePath: "page_sections/images", |
| 82 | + acceptedFiles: ["image/*"] |
| 83 | + } |
| 84 | + }, |
| 85 | + link: { |
| 86 | + dataType: "string", |
| 87 | + name: "Section Link", |
| 88 | + url: true |
| 89 | + } |
| 90 | + } |
| 91 | + }, |
| 92 | + image: { |
| 93 | + dataType: "string", |
| 94 | + name: "Image", |
| 95 | + storage: { |
| 96 | + storagePath: "page_sections/images", |
| 97 | + acceptedFiles: ["image/*"] |
| 98 | + } |
| 99 | + }, |
| 100 | + slider: { |
| 101 | + dataType: "array", |
| 102 | + name: "Slider", |
| 103 | + of: { |
| 104 | + dataType: "map", |
| 105 | + properties: { |
| 106 | + title: { |
| 107 | + dataType: "string", |
| 108 | + name: "Title", |
| 109 | + validation: { required: true } |
| 110 | + }, |
| 111 | + image: { |
| 112 | + dataType: "string", |
| 113 | + storage: { |
| 114 | + storagePath: "page_sections/images", |
| 115 | + acceptedFiles: ["image/*"] |
| 116 | + } |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + }, |
| 121 | + } |
| 122 | + } |
| 123 | + }, |
| 124 | + sidebar: { |
| 125 | + dataType: "map", |
| 126 | + name: "Sidebar", |
| 127 | + properties: { |
| 128 | + title: { |
| 129 | + dataType: "string", |
| 130 | + name: "Sidebar Title", |
| 131 | + validation: { required: false } |
| 132 | + }, |
| 133 | + content: { |
| 134 | + dataType: "string", |
| 135 | + name: "Sidebar Content", |
| 136 | + markdown: true |
| 137 | + } |
| 138 | + } |
| 139 | + }, |
| 140 | + seo_metadata: { |
| 141 | + dataType: "map", |
| 142 | + name: "SEO Metadata", |
| 143 | + properties: { |
| 144 | + meta_title: { |
| 145 | + dataType: "string", |
| 146 | + name: "Meta Title" |
| 147 | + }, |
| 148 | + meta_description: { |
| 149 | + dataType: "string", |
| 150 | + name: "Meta Description" |
| 151 | + }, |
| 152 | + focus_keywords: { |
| 153 | + dataType: "array", |
| 154 | + name: "Focus Keywords", |
| 155 | + of: { |
| 156 | + dataType: "string" |
| 157 | + } |
| 158 | + } |
| 159 | + } |
| 160 | + }, |
| 161 | + footer_override: { |
| 162 | + dataType: "string", |
| 163 | + name: "Footer Override", |
| 164 | + markdown: true |
| 165 | + }, |
| 166 | + publish_date: { |
| 167 | + dataType: "date", |
| 168 | + name: "Publish Date", |
| 169 | + validation: { required: true } |
| 170 | + }, |
| 171 | + last_updated: { |
| 172 | + dataType: "date", |
| 173 | + name: "Last Updated", |
| 174 | + autoValue: "on_update" |
| 175 | + }, |
| 176 | + is_published: { |
| 177 | + dataType: "boolean", |
| 178 | + name: "Is Published", |
| 179 | + columnWidth: 100, |
| 180 | + description: "Should this page be live on the site?" |
| 181 | + }, |
| 182 | + author_uid: { |
| 183 | + dataType: "reference", |
| 184 | + name: "Author", |
| 185 | + path: "users" |
| 186 | + } |
| 187 | + } |
| 188 | +}; |
0 commit comments