Skip to content

Instantly share code, notes, and snippets.

🏠
For sure working from somewhere 🤘

DominikAngerer DominikAngerer

🏠
For sure working from somewhere 🤘
Block or report user

Report or block DominikAngerer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DominikAngerer
DominikAngerer / richTextField.js
Created Mar 20, 2020
Storyblok RichTextRenderer without token
View richTextField.js
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),
}
}
View index.js
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
})
@DominikAngerer
DominikAngerer / now.json
Created Jun 5, 2019
Nuxt Builder for Now
View now.json
{
"version": 2,
"builds": [
{
"src": "nuxt.config.js",
"use": "@nuxtjs/now-builder",
"config": {}
}
],
"routes": [
View batman.txt
..........................................................................................................
..........................................................................................................
...............................*..........................................................................
............................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
View storyblok-import.js
const axios = require('axios')
const fs = require('fs')
const netrc = require('netrc')
const os = require('os')
const path = require('path')
const host = 'api.storyblok.com'
const args = process.argv
let space = ''
args.forEach((arg) => {
View _clear_cache.vue
<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>
View storyblok-image-upload-function.js
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()
View get-stories-management-api-js-sdk.js
// npm install storyblok-js-client
const StoryblokClient = require('storyblok-js-client')
// Initialize the client with the oauth token so you're
// authenticated for the management API
const Storyblok = new StoryblokClient({
oauthToken: 'YOUR_OAUTH_TOKEN'
})
const spaceId = 'your_space_id'
let page = 1
View plugin-with-data.js
const Fieldtype = {
mixins: [window.Storyblok.plugin],
data() {
return {
ich_bin_eine_state_variable_die_nicht_im_model_beinhaltet_ist: true,
ich_darf_nicht_model_heissen: true
}
},
template: `<div>
<input class="uk-width-1-1" v-model="model.example" />
View demo-plugin.js
const Fieldtype = {
mixins: [window.Storyblok.plugin],
template: `<div>
<markdown-field :uid="uid" :model="model.original" :schema="schema" @changed="update" key="original"></markdown-field>
</div>`,
methods: {
initWith() {
return {
plugin: 'markdown-html',
original: '',
You can’t perform that action at this time.