Skip to content

Commit

Permalink
feat: Add Prismic custom types
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Mar 10, 2020
1 parent 7f6eb09 commit 64ca180
Show file tree
Hide file tree
Showing 9 changed files with 1,081 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Prismic Custom Types

https://user-guides.prismic.io/en/articles/380227-introduction-to-custom-type-building

See JSON Editor :)
26 changes: 26 additions & 0 deletions custom_types/author.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"Main" : {
"name" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Name"
}
},
"bio" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Bio"
}
},
"picture" : {
"type" : "Image",
"config" : {
"constraint" : { },
"thumbnails" : [ ],
"label" : "Picture"
}
}
}
}
79 changes: 79 additions & 0 deletions custom_types/blog_home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"SEO & Social" : {
"meta_title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1",
"label" : "Meta title",
"placeholder" : "Meta title"
}
},
"meta_description" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Meta description",
"placeholder" : "Meta description"
}
},
"canonical_url" : {
"type" : "StructuredText",
"config" : {
"label" : "Canonical URL",
"placeholder" : "Canonical URL"
}
},
"body1" : {
"type" : "Slices",
"fieldset" : "Slice zone",
"config" : {
"choices" : {
"twitter_card" : {
"type" : "Slice",
"fieldset" : "Twitter card",
"description" : "Fields you need to customize the Twitter Card",
"icon" : "adjust",
"display" : "list",
"non-repeat" : {
"card_title" : {
"type" : "Text",
"config" : {
"label" : "Title",
"placeholder" : "Title for Twitter"
}
},
"card_description" : {
"type" : "Text",
"config" : {
"label" : "Description",
"placeholder" : "Description for Twitter"
}
},
"card_image" : {
"type" : "Image",
"config" : {
"constraint" : {
"width" : 1200,
"height" : 630
},
"thumbnails" : [ ],
"label" : "Image"
}
}
},
"repeat" : { }
},
"facebook__open_graph_" : {
"type" : "Slice",
"fieldset" : "Facebook (Open Graph)",
"description" : "Fields to customize OG cards",
"icon" : "thumb_up",
"display" : "list",
"non-repeat" : { },
"repeat" : { }
}
}
}
}
}
}
119 changes: 119 additions & 0 deletions custom_types/blog_post.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"Main" : {
"title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1",
"label" : "Title"
}
},
"image" : {
"type" : "Image",
"config" : {
"constraint" : { },
"thumbnails" : [ ],
"label" : "Image"
}
},
"rich_content" : {
"type" : "StructuredText",
"config" : {
"multi" : "paragraph, heading2, strong, em, hyperlink, image",
"allowTargetBlank" : true,
"label" : "Rich content"
}
}
},
"SEO & Social" : {
"uid" : {
"type" : "UID",
"config" : {
"label" : "UID"
}
},
"meta_title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1",
"label" : "Meta title",
"placeholder" : "Meta title"
}
},
"meta_description" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Meta description",
"placeholder" : "Meta description"
}
},
"canonical_url" : {
"type" : "StructuredText",
"config" : {
"label" : "Canonical URL",
"placeholder" : "Canonical URL"
}
},
"author" : {
"type" : "Link",
"config" : {
"select" : "document",
"customtypes" : [ "author" ],
"label" : "Author",
"placeholder" : "Johnny McJohn"
}
},
"body1" : {
"type" : "Slices",
"fieldset" : "Slice zone",
"config" : {
"choices" : {
"twitter_card" : {
"type" : "Slice",
"fieldset" : "Twitter card",
"description" : "Fields you need to customize the Twitter Card",
"icon" : "adjust",
"display" : "list",
"non-repeat" : {
"card_title" : {
"type" : "Text",
"config" : {
"label" : "Title",
"placeholder" : "Title for Twitter"
}
},
"card_description" : {
"type" : "Text",
"config" : {
"label" : "Description",
"placeholder" : "Description for Twitter"
}
},
"card_image" : {
"type" : "Image",
"config" : {
"constraint" : {
"width" : 1200,
"height" : 630
},
"thumbnails" : [ ],
"label" : "Image"
}
}
},
"repeat" : { }
},
"facebook__open_graph_" : {
"type" : "Slice",
"fieldset" : "Facebook (Open Graph)",
"description" : "Fields to customize OG cards",
"icon" : "thumb_up",
"display" : "list",
"non-repeat" : { },
"repeat" : { }
}
}
}
}
}
}
Loading

0 comments on commit 64ca180

Please sign in to comment.