This is a simple app built with React JavaScript library, Prismic headless API content management system and Hagura Jekyll theme.
This app is built for personal experiment. If you would like to run it, follow the steps below. Feedback is always welcome!
Copy the following files to where they should be and edit them with your own configuration.
default/public/index.html
topublic/index.html
default/src/Components/Footer/Footer.js
tosrc/Components/Footer/Footer.js
default/src/Config.js
tosrc/Config.js
default/src/prismic-configuration.js
tosrc/prismic-configuration.js
This custom type is used for home page. Enter this custom type's API ID in src/Config.js
(home_page_api_id
). Here is its JSON:
{
"Main" : {
"uid" : {
"type" : "UID",
"config" : {
"label" : "slug"
}
},
"title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1, heading2, heading3, heading4, heading5, heading6",
"label" : "Title"
}
},
"image" : {
"type" : "Image",
"config" : {
"constraint" : {
"width" : 800,
"height" : 300
},
"thumbnails" : [ ],
"label" : "Image"
}
},
"content" : {
"type" : "StructuredText",
"config" : {
"multi" : "paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, o-list-item",
"label" : "Content"
}
}
}
}
Create a custom type for blog post with the JSON below. Enter its API ID in src/Config.js
(blog_post_api_id
).
{
"Main" : {
"uid" : {
"type" : "UID",
"config" : {
"label" : "slug"
}
},
"title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1, heading2, heading3, heading4, heading5, heading6",
"label" : "Title"
}
},
"image" : {
"type" : "Image",
"config" : {
"constraint" : {
"width" : 800,
"height" : 300
},
"thumbnails" : [ ],
"label" : "Image"
}
},
"description" : {
"type" : "StructuredText",
"config" : {
"single" : "strong, em",
"label" : "Description"
}
},
"content" : {
"type" : "StructuredText",
"config" : {
"multi" : "paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, o-list-item",
"label" : "Content"
}
},
"created_date" : {
"type" : "Timestamp",
"config" : {
"label" : "Created Date"
}
}
}
}
> $ npm install
Build and open your browser to http://localhost:3000.
> $ npm start
> $ npm run build