Skip to content

Instantly share code, notes, and snippets.

View lamenath's full-sized avatar
:octocat:
Focusing

Nathanael Lamelliere lamenath

:octocat:
Focusing
View GitHub Profile
@lamenath
lamenath / gist:11bc3bef269fec22533ad1d0197f4109
Created July 28, 2021 08:40
FAQ Page with multiple tabs, and repeatable sections under each tab
{
"Main" : {
"title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1",
"label" : "Title",
"placeholder" : "Title"
}
},
@lamenath
lamenath / csv-to-if.js
Last active May 15, 2021 21:24
CSV to Prismic IF endpoint mock
const csv = require('csv-parser')
const fs = require('fs')
const results = [];
const catalog = {
"results_size": 50,
"results": []
};
fs.createReadStream('source-if.csv')
.pipe(csv())
.on('data', (data) => results.push(data))
@lamenath
lamenath / product.json
Created May 14, 2021 13:52
Prismic Custom type for Product Storytelling Enrichment
{
"Main" : {
"product_name" : {
"type" : "Text",
"config" : {
"label" : "Product name",
"placeholder" : "Product name"
}
},
"uid" : {
@lamenath
lamenath / csv-to-json.js
Last active July 20, 2021 09:13
This takes a list of products in a CSV file as an input and generates one Prismic JSON import file for each raw
const csv = require('csv-parser')
const fs = require('fs')
const results = [];
fs.createReadStream('source.csv')
.pipe(csv())
.on('data', (data) => results.push(data))
.on('end', () => {
results.forEach(function (result, i) {
console.log(result);
@lamenath
lamenath / label.json
Created March 26, 2020 14:09
Prismic - custom inline label on Rich Text (custom type JSON)
{
"Main": {
"text": {
"type": "StructuredText",
"config": {
"labels" : ["EventListener"],
"multi": "paragraph, hyperlink",
"label": "Text",
"placeholder": "Text"
}
@lamenath
lamenath / graphql-fetch-content-from-inline-cta.graphql
Created March 7, 2019 15:13
Prismic GraphQL query example for fetching fields from a linked doc within a Slice
{
allSuccessStorys {
edges {
node {
body {
... on SuccessStoryBodyCta_block {
primary {
cta {
... on Inline_cta {
title
@lamenath
lamenath / zv.json
Created December 13, 2018 10:06
zv.json
{
"results_size": 2,
"results": [
{
"id": "1",
"title": "ROBE ROUMY LUREX",
"description": "Robe bleu marine femme Zadig&Voltaire, en soie imprimée, mi longue, détails lurex.",
"image_url": "https://cdn.zadig-et-voltaire.com/media/catalog/product/cache/0/small_image/1000x1500/c96a280f94e22e3ee3823dd0a1a87606/W/G/WGCS0412F_MARINE_3_1.JPG",
"last_update": 1509364426938,
@lamenath
lamenath / 2-levels-nav.json
Created March 30, 2017 10:19
2 levels navigation using Slices
{
"Menu" : {
"uid" : {
"type" : "UID",
"config" : {
"placeholder" : "unique-menu-id"
}
},
"body" : {
"fieldset" : "Navigation",
@lamenath
lamenath / page.json
Created September 30, 2016 07:56
Repeatable Page Custom Type for Sample Website
{
"Main" : {
"uid" : {
"type" : "UID",
"config" : {
"placeholder" : "meaningful-unique-identifier...",
"label" : "Unique ID"
}
},
"body" : {
@lamenath
lamenath / homepage.json
Created September 30, 2016 07:45
Sample Website Homepage Custom Type
{
"Main" : {
"uid" : {
"type" : "UID",
"config" : {
"placeholder" : "meaningful-unique-identifier...",
"label" : "Unique ID"
}
},
"title" : {