This file contains hidden or 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
app.$storyapi.get('cdn/stories/article', { | |
cv: store.state.cacheVersion, | |
resolve_links: '1' | |
}) |
This file contains hidden or 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
async asyncData({app, store}) { | |
let [article, authors] = await Promise.all([ | |
app.$storyapi.get('cdn/stories/article', { | |
cv: store.state.cacheVersion | |
}), | |
app.$storyapi.get('cdn/stories', { | |
starts_with: 'authors/', | |
cv: store.state.cacheVersion | |
}) | |
]) |
This file contains hidden or 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 Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: ` | |
<div>Google snippet preview: | |
<div style="margin:5px 0 15px;padding:10px;color:#000;background:#fff"> | |
<div style="color:blue;text-decoration:underline">{{ model.title }}</div> | |
<div style="color:green">yoursite.com/example</div> | |
<div>{{ model.description }}</div> | |
</div> | |
<div class=uk-form-row> |
This file contains hidden or 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
var Sortable = require('sortablejs') | |
module.exports = { | |
update: function (val) { | |
var self = this | |
this.sortable = Sortable.create(this.el, { | |
animation: 150, | |
handle: '.sortable__handle', | |
onStart: function (e) { |
This file contains hidden or 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 Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div><select class="uk-width-1-1" v-model="model.value"> | |
<option :key="option.value" v-for="option in options">{{ option.name }}</option> | |
</select></div>`, | |
data() { | |
return { | |
options: [] | |
} | |
}, |
This file contains hidden or 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 Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: ` | |
<div class="uk-clearfix"> | |
<input class="uk-hidden" type="file" multiple="multiple" @change="changeFiles($event)" /> | |
<div class="uk-flex uk-margin-small-bottom" v-for="(key, item) in model.files"> | |
<img class="image" :src="item.url.replace('a.storyblok.com', 'img2.storyblok.com/160x90/filters:fill(auto,0)')"> | |
<input type="text" class="uk-form-small uk-flex-item-auto" v-model=item.url> | |
<button @click.prevent="removeFile(key)" class="uk-button uk-button-small uk-margin-small-left"><i class="uk-icon-close"></i></button> |
This file contains hidden or 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
<script> | |
import Util from './libs/Utils' | |
import App from './App.html' | |
import axios from 'axios' | |
import _ from 'lodash' | |
export default { | |
template: Util.template('#searchblok-app', App), | |
name: 'searchblok', | |
props: ['settings'], |
This file contains hidden or 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
// define a new content type "app" | |
{ | |
"_uid": "autogenerated-uid", | |
"additionalAuthors": ["Global Tracking", "Fresh Produce"], // needs to be a multi option field | |
"author": "Supply Chain", // needs to be a single option field | |
"badges": [ | |
"complete", | |
"token", | |
"featured", | |
"hot" |
This file contains hidden or 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
url: function(storylink) { | |
return storylink.cached_url | |
} |
This file contains hidden or 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
app.get('/*', function(req, res) { | |
var path = url.parse(req.url).pathname; | |
path = path == '/' ? 'home' : path | |
Storyblok | |
.get(`stories/global`, { | |
version: req.query._storyblok ? 'draft': 'published' | |
}) | |
.then((response) => { | |
Storyblok |