This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
... | |
storyblokImageUpload(fileblob, filename, success, failure) { | |
this.api.client.post( | |
`/spaces/${this.spaceId}/assets`, | |
{ filename: filename }, | |
{ headers: { Authorization: this.options.oauthToken } }, // uses the option with the name `oauthToken` which needs to be configured in the schema definition of the field you're using the plugin in. | |
).then((response) => { | |
let request = new XMLHttpRequest() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install sanitize-html | |
const sanitizeHtml = require('sanitize-html'); | |
// npm install storyblok-js-client | |
const StoryblokClient = require('storyblok-js-client') | |
// Storyblok is now available as variable which contains the richTextResolver functionality | |
const Storyblok = new StoryblokClient({}) | |
function createMarkup(storyblokHTML) { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const StoryblokClient require('storyblok-js-client') | |
const createDOMPurify = require('dompurify') | |
const { JSDOM } = require('jsdom') | |
// Storyblok is now available as variable which contains the richTextResolver functionality | |
const Storyblok = new StoryblokClient({}) | |
// For Node this needs to use the jhttps://github.com/cure53/DOMPurify#okay-makes-sense-lets-move-on | |
const jsDomWindow = new JSDOM('').window; | |
const DOMPurify = createDOMPurify(jsDomWindow); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import StoryblokClient from 'storyblok-js-client' | |
// Storyblok is now available as variable which contains the richTextResolver functionality | |
const Storyblok = new StoryblokClient({}) | |
function createMarkup(storyblokHTML) { | |
return { | |
__html: Storyblok.richTextResolver.render(storyblokHTML), | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Storyblok = require('storyblok-js-client') // npm install storyblok-js-client | |
const MAPI_TOKEN = "your_oauth_token" | |
const spaceId = 73358 // your configured space id folder | |
const yourFolderId = 5663791 // your parent folder | |
let StoryblokClient = new Storyblok({ | |
oauthToken: MAPI_TOKEN | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blok = array("_editable" => "<!--#storyblok#{\"name\": \"column\", \"space\": \"48408\", \"uid\": \"7c44c5d8-0adb-4c01-a797-12d9b300b99b\", \"id\": \"307934\"}-->"); | |
/** | |
* Manually parse the Storyblok HTML editable comments. Use your templating language to output | |
* keys = values as html attributes without quotes or with single quotes. | |
* | |
* @param array $blok This is your component object | |
* @param boolean $raw Decide if function should return raw array or inline string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const axios = require('axios') | |
// Using Links API | |
generate: { | |
routes: function (callback) { | |
const token = `YOUR_TOKEN` | |
const version = 'published' | |
let cache_version = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 2, | |
"builds": [ | |
{ | |
"src": "nuxt.config.js", | |
"use": "@nuxtjs/now-builder", | |
"config": {} | |
} | |
], | |
"routes": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.......................................................................................................... | |
.......................................................................................................... | |
...............................*.......................................................................... | |
............................Y@@@@Y.....................................E@@@@E............................. | |
...........................E@@WR@@@...................................E@@WW@@@*........................... | |
.........................E@@@GGGG@@W.................................:@@WGGGW@@Y.......................... | |
........................Y@@WGGGGGR@@E................................@@QGGGGGW@@G......................... | |
.......................E@@WGGGGGGGW@@:..........*YEYEEEE*...........@@@GGGGGGGG@@@........................ | |
......................R@@GGGGGGGGGGQ@@...EEG@@@@@@@@@@@@@@@@@REY:..Y@@GGGGGGGGGGQ@@....................... | |
.....................G@@GGGGGGGGGGGG@@@@@@WWWWGGGGGGGGGGGGGRW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<section class="util__container"> | |
<h1>Cache Cleared</h1> | |
<br> | |
<p>Old Cache Version: {{oldCacheVersion}}</p> | |
<p>New Cache Version: {{newCacheVersion}}</p> | |
</section> | |
</template> | |
<script> |