Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX] Improve the README.md #310

Open
Baroshem opened this issue Feb 21, 2023 · 1 comment
Open

[DX] Improve the README.md #310

Baroshem opened this issue Feb 21, 2023 · 1 comment

Comments

@Baroshem
Copy link
Contributor

Baroshem commented Feb 21, 2023

The README.md is far too long for the getting-started user. I understand that it is used as documentation as well but still it is solely missing the getting-started/quick-start section that usually requires users to:

  1. Install the module
  2. Register it (with some required configuration)
  3. Use it in the app.

For the Storyblok module for Nuxt the steps can be combined into:


Install @storyblok/nuxt:

npm install @storyblok/nuxt
# yarn add @storyblok/nuxt

Add following code to modules section of nuxt.config.js and replace the accessToken with API token from Storyblok space.

export default defineNuxtConfig({
  modules: ["@storyblok/nuxt"],
  storyblok: {
    accessToken: "<your-access-token>"
  }
});

The simplest way is by using the useAsyncStoryblok one-liner composable (it's autoimported) and passing as a first parameter a name of your content page from Storyblok (in this case, our content page name is vue, by default you get a content page named home):

<script setup>
  const story = await useAsyncStoryblok("vue");
</script>

<template>
  <StoryblokComponent v-if="story" :blok="story.content" />
</template>

Later on, we can have configuration, api options, etc. But it is crucial to have this getting started at the top so that the users can easily try it out. It should help having less questions and issues about really basic stuff such as this one :)

@Baroshem
Copy link
Contributor Author

@alvarosabu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant