-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathastro.config.ts
95 lines (93 loc) · 2.91 KB
/
astro.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Full Astro Configuration API Documentation:
// https://docs.astro.build/reference/configuration-reference
// @ts-check
import { defineConfig } from 'astro/config';
import NetlifyCMS from 'astro-netlify-cms';
export default defineConfig({
integrations: [
// Enable Netlify CMS integration.
NetlifyCMS({
previewStyles: [
'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&family=IBM+Plex+Sans:wght@400;700&display=swap',
'/src/styles/blog.css',
],
config: {
// Use Netlify’s “Git Gateway” authentication and target our default branch
backend: {
name: 'git-gateway',
branch: 'latest',
},
// Configure where our media assets are stored & served from
media_folder: 'public/assets/blog',
public_folder: '/assets/blog',
// Configure the content collections
collections: [
{
name: 'posts',
label: 'Posts',
label_singular: 'Post',
folder: 'src/pages/posts',
create: true,
delete: true,
fields: [
{
name: 'title',
widget: 'string',
label: 'Post Title',
},
{
name: 'publishDate',
widget: 'datetime',
format: 'DD MMM YYYY',
date_format: 'DD MMM YYYY',
time_format: false,
label: 'Publish Date',
},
{
name: 'author',
widget: 'string',
label: 'Author Name',
},
{
name: 'authorURL',
widget: 'string',
label: 'Author URL',
},
{
name: 'description',
widget: 'string',
label: 'Post Description',
},
{
name: 'body',
widget: 'markdown',
label: 'Post Body',
},
{
name: 'heroImage',
widget: 'image',
label: 'Hero Image',
required: false,
},
{
name: 'alt',
widget: 'string',
label: 'Hero Image Alt Text',
required: false,
},
// This is hidden here assuming a non-technical user will not need to
// see or edit the `setup` front matter. You could also use a `code`
// widget if you wanted direct access to editing the `setup` for each post.
// {
// name: 'setup',
// widget: 'hidden',
// default: `import Layout from '../../layouts/BlogPost.astro';
// ${FrontMatterSetup}`,
// },
],
},
],
},
}),
],
});