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

Option to Disable Prismic Toolbar and Preview #34

Closed
jeffhunt00 opened this issue Oct 30, 2019 · 6 comments
Closed

Option to Disable Prismic Toolbar and Preview #34

jeffhunt00 opened this issue Oct 30, 2019 · 6 comments

Comments

@jeffhunt00
Copy link

I don't really need to use the Preview feature on the small 1-page I'm building. I also really don't care to use Prismic's Toolbar feature for in-site editing.

It would be great to be able to fully disable these features, such that the associated javascript is not included/downloaded when visitors hit the page. If I hit my page in private browser tab (ie: not signed into Prismic), it seems to download quite a bit of JS that is not required to simply display my content, including jQuery 2.1.1.

I've tried disabling preview in nuxt.config.js, but it doesn't seem to have any effect:

modules: [
['prismic-nuxt', {
endpoint: 'https://XXX.cdn.prismic.io/api/v2',
preview: false,
components: false,
deferLoad: true,
linkResolver: function(doc, ctx) {
return '/'
}
}]
]

@Atinux
Copy link
Contributor

Atinux commented Dec 20, 2019

Hi @jeffhunt00

This will be fixed with the v1

@Atinux
Copy link
Contributor

Atinux commented Jan 6, 2020

V1 is out :)

@Atinux Atinux closed this as completed Jan 6, 2020
@adrianocr
Copy link

Sorry to reopen this but how does one disable the toolbar? I have preview: false in nuxt.config.js but the toolbar is still being rendered

@zjhiphop
Copy link

How's going now? What's the solution here?

@lihbr
Copy link
Collaborator

lihbr commented Jun 24, 2020

Hi @zjhiphop, if you want to disable Prismic Toolbar and Preview provided by this module you should be able to do so by specifying preview: false in your module options, script won't be injected. Let me know how it goes!

@leopoldkristjansson
Copy link

In Nuxt 3, using "@nuxtjs/prismic": "^3.1.0",

You can do the following in nuxt.config.ts

  prismic: {
    endpoint: prismicRepoEndpoint,
    preview: false,
    toolbar: false,
  },

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

6 participants