All Projects → wearewondrous → nuxt-storyblok-queries

wearewondrous / nuxt-storyblok-queries

Licence: MIT License
Nuxt.js module to simplify queries to the Storyblok API

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to nuxt-storyblok-queries

nuxt-modules
AX2's Nuxt modules
Stars: ✭ 30 (+76.47%)
Mutual labels:  module, nuxt, nuxt-module
Auth Module
auth.nuxtjs.org
Stars: ✭ 1,624 (+9452.94%)
Mutual labels:  module, nuxt, nuxt-module
nuxt-ts-module
A tiny module to use Typescript within Nuxt.js application.
Stars: ✭ 21 (+23.53%)
Mutual labels:  module, nuxt, nuxt-module
nuxt-sanity
Easily integrate Sanity in your Nuxt.js project.
Stars: ✭ 14 (-17.65%)
Mutual labels:  nuxt, nuxt-module
k-domains
A simple module to manage multiple subdomains with just one project
Stars: ✭ 41 (+141.18%)
Mutual labels:  nuxt, nuxt-module
supabase
An easy way to integrate Supabase with NuxtJS
Stars: ✭ 39 (+129.41%)
Mutual labels:  nuxt, nuxt-module
nuxtwebsite
A simple Nuxt.js setup to create websites with blog feature using Storyblok as CMS and Netlify to deploy it.
Stars: ✭ 29 (+70.59%)
Mutual labels:  nuxt, storyblok
nuxt-prune-html
🔌⚡ Nuxt module to prune html before sending it to the browser (it removes elements matching CSS selector(s)), useful for boosting performance showing a different HTML for bots/audits by removing all the scripts with dynamic rendering
Stars: ✭ 69 (+305.88%)
Mutual labels:  nuxt, nuxt-module
nuxt-jsonld
A Nuxt.js module to manage JSON-LD in Vue component.
Stars: ✭ 198 (+1064.71%)
Mutual labels:  nuxt, nuxt-module
nuxt-mail
Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.
Stars: ✭ 62 (+264.71%)
Mutual labels:  nuxt, nuxt-module
yamlful
YAML-based HTTP client code generation
Stars: ✭ 77 (+352.94%)
Mutual labels:  nuxt, nuxt-module
global-components
Module to register global components for Nuxt.js
Stars: ✭ 57 (+235.29%)
Mutual labels:  nuxt, nuxt-module
nuxt-humans-txt
🧑🏻👩🏻 "We are people, not machines" - An initiative to know the creators of a website. Contains the information about humans to the web building - A Nuxt Module to statically integrate and generate a humans.txt author file - Based on the HumansTxt Project.
Stars: ✭ 27 (+58.82%)
Mutual labels:  nuxt, nuxt-module
nuxt-stripejs
💳 NuxtJS module for Stripe.js which loads only when required and w/ retry mechanism
Stars: ✭ 17 (+0%)
Mutual labels:  nuxt, nuxt-module
nuxt-facebook-pixel-module
Inject Facebook pixel code
Stars: ✭ 82 (+382.35%)
Mutual labels:  module, nuxt-module
date-fns-module
Modern JavaScript date utility library - date-fns for Nuxt.js
Stars: ✭ 68 (+300%)
Mutual labels:  nuxt, nuxt-module
nuxt-stencil
Easy Stencil.js component library integration with Nuxt.js.
Stars: ✭ 16 (-5.88%)
Mutual labels:  nuxt, nuxt-module
nuxt-babel
Use normal .babelrc file with your Nuxt app
Stars: ✭ 32 (+88.24%)
Mutual labels:  nuxt, nuxt-module
nuxt-speedkit
nuxt-speedkit will help you to improve the lighthouse performance score (100/100) of your website.
Stars: ✭ 401 (+2258.82%)
Mutual labels:  nuxt, nuxt-module
nuxt-ghost
Easy Ghost content API integration with Nuxt.js.
Stars: ✭ 27 (+58.82%)
Mutual labels:  nuxt, nuxt-module

Nuxt Storyblok Queries

NPM CircleCI Standard JS

Nuxt.js module to simplify queries to the Storyblok API

📖 Release Notes

Setup

  1. Add the @wearewondrous/nuxt-storyblok-queries dependency with yarn or npm to your project
  2. Add @wearewondrous/nuxt-storyblok-queries to the modules section of nuxt.config.js
  3. Configure it:
{
  modules: [
    ['@wearewondrous/nuxt-storyblok-queries', {
      // Module options here
    }]
  ]
}

Using top level options

{
  modules: [
    '@wearewondrous/nuxt-storyblok-queries'
  ],
  storyblokQueries: [
    // Module options here
  ]
}

Options

accessToken

  • Default: this.options.storyblok || ''

Access Token for the StoryBlok API. Not needed if you already have installed the Storyblok Nuxt.js module

cacheProvider

  • Default: 'memory'

Cache Provider for the StoryBlok API. Not needed if you already have installed the Storyblok Nuxt.js module

version

  • Default: 'auto'

Version of the Storyblok Content. Use 'draft' together with the preview Access Token.

defaultLanguage

  • Default: ''

Optional. If your Storyblok Site has multiple languages, set defaultLanguage to the key of your Storyblok default language.

Usage

This modules adds a simple API to query your Storyblok Content.

$storyblok.getStory(path, options)

Fetches the story by the given path. The Language gets automatically detected or can be specified in the options parameter.

export default {
  async asyncData({ $storyblok }) {
    const story = await $storyblok.getStory("home")

    return story
  }
}

with Options

export default {
  async asyncData({ $storyblok }) {
    const story = await $storyblok.getStory("home", {
      lang: "de"
    })

    return story
  }
}

$storyblok.getCurrentStory(options)

Fetches the story by the current Route. The Language gets automatically detected but can also be specified in the options parameter.

export default {
  async asyncData({ $storyblok, route }) {
    console.log(route.path) // -> /story
    const story = await $storyblok.getCurrentStory()

    return story
  }
}

with Options

export default {
  async asyncData({ $storyblok, route }) {
    console.log(route.path) // -> /story
    const story = await $storyblok.getCurrentStory({
      lang: "de"
    })

    return story
  }
}

$storyblok.getStoryCollection(path, options)

Fetches all Stories matching the given path. The Language gets automatically detected but can also be specified in the options parameter.

export default {
  async asyncData({ $storyblok, route }) {
    const collection = await $storyblok.getStoryCollection("blog")

    return collection
  }
}

with Options

export default {
  async asyncData({ $storyblok, route }) {
    const collection = await $storyblok.getStoryCollection("blog", {
      lang: "de",
      startpage: true // if true, startpage of collection gets fetched as well
    })

    return collection
  }
}

$storyblok.getSettings(lang, options)

Fetches the settings page of the given language. The path for the settings route can be specified in the options parameter or falls back to /settings.

export default {
  async asyncData({ $storyblok, route }) {
    const settings = await $storyblok.getSettings("de")

    return {
      //...
      settings
    }
  }
}

with Options

export default {
  async asyncData({ $storyblok, route }) {
    const settings = await $storyblok.getSettings("de", {
      path: "global"
    })

    return {
      //...
      settings
    }
  }
}

$storyblok.getCurrentSettings(options)

Fetches the settings page of the current language detected by the current route. The path for the settings route can be specified in the options parameter or falls back to /settings.

export default {
  async asyncData({ $storyblok, route }) {
    const settings = await $storyblok.getCurrentSettings()

    return {
      //...
      settings
    }
  }
}

with Options

export default {
  async asyncData({ $storyblok, route }) {
    const settings = await $storyblok.getCurrentSettings({
      path: "global"
    })

    return {
      //...
      settings
    }
  }
}

$storyblok.getDatasource(path)

Fetches the datasource by the given path.

export default {
  async asyncData({ $storyblok, route }) {
    const datasource = await $storyblok.getDatasource("users")

    return {
      //...
      datasource
    }
  }
}

$storyblok.renderRichText(richTextContent)

Renders the Storyblok richtext field content and returns an HTML string.

<div v-html="$storyblok.renderRichTest(story.content.rich_text)" />

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) WONDROUS LTD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].