-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathblockContent.ts
82 lines (81 loc) · 2.18 KB
/
blockContent.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
import { defineArrayMember, defineType } from "sanity";
export default defineType({
name: "blockContent",
title: "Post Body",
type: "array",
description: "Write your post content here",
of: [
defineArrayMember({
title: "Block",
type: "block",
styles: [
{ title: "Normal", value: "normal" },
{ title: "H2", value: "h2" },
{ title: "H3", value: "h3" },
{ title: "H4", value: "h4" },
{ title: "Quote", value: "blockquote" },
],
marks: {
decorators: [
{ title: "Strong", value: "strong" },
{ title: "Emphasis", value: "em" },
{ title: "Code", value: "code" },
],
},
}),
defineArrayMember({
type: "image",
options: {
hotspot: true,
metadata: ["lqip", "blurhash", "palette"],
},
fields: [
{
name: "caption",
title: "Image caption",
type: "string",
description: "Text displayed below the image.",
},
{
name: "alt",
title: "Alt text",
type: "string",
description: "Important for SEO and accessiblity.",
},
],
}),
defineArrayMember({
type: "code",
options: {
language: "typescript",
withFilename: true,
languageAlternatives: [
{ title: "Bash", value: "bash" },
{ title: "JavaScript", value: "js" },
{ title: "TypeScript", value: "ts" },
{ title: "TSX", value: "tsx" },
{ title: "JSX", value: "jsx" },
{ title: "CSS", value: "css" },
{ title: "Groq", value: "graphql" },
{ title: "HTML", value: "html" },
{ title: "Json", value: "json" },
{ title: "Markdown", value: "md" },
{ title: "Python", value: "py" },
{ title: "SCSS", value: "scss" },
{ title: "SQL", value: "sql" },
{ title: "Yaml", value: "yaml" },
{ title: "Java", value: "java" },
],
},
}),
defineArrayMember({
type: "youtube",
}),
defineArrayMember({
type: "customTable",
}),
defineArrayMember({
type: "quiz",
}),
],
});