0
0
Vueframework~5 mins

Static site generation with Nuxt in Vue - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Static Site Generation (SSG) in Nuxt?
Static Site Generation means Nuxt pre-builds all pages as static HTML files during build time. This makes the site fast and easy to host.
Click to reveal answer
beginner
How do you enable Static Site Generation in a Nuxt project?
Set target: 'static' in nuxt.config.js. Then run npm run generate or yarn generate to build static files.
Click to reveal answer
beginner
What command do you run to generate a static site in Nuxt?
Run npm run generate or yarn generate. This creates static HTML files in the dist/ folder.
Click to reveal answer
intermediate
How does Nuxt handle dynamic routes during static generation?
You use the generate.routes property in nuxt.config.js to specify dynamic paths so Nuxt can pre-render them.
Click to reveal answer
beginner
Why is Static Site Generation good for performance and SEO?
Because pages are pre-built as static HTML, they load very fast and search engines can easily read the content without running JavaScript.
Click to reveal answer
Which Nuxt config option sets the project to generate a static site?
Amode: 'universal'
Bssr: true
Ctarget: 'static'
Dbuild: 'static'
What command builds the static files in Nuxt?
Anuxt generate
Bnuxt build
Cnuxt start
Dnuxt serve
How do you tell Nuxt which dynamic routes to pre-render?
AUse <code>asyncData</code> only
BAdd routes in <code>generate.routes</code> in <code>nuxt.config.js</code>
CSet <code>ssr: false</code>
DUse <code>router.push()</code> in components
What is a benefit of static sites generated by Nuxt?
APages cannot be cached
BPages require a Node.js server to run
CPages are generated on every user request
DPages load instantly without server delays
Which of these is NOT true about Nuxt static generation?
AIt requires a backend server to render pages on demand
BIt improves SEO by serving pre-rendered HTML
CIt creates files you can host on any static server
DIt can pre-render dynamic routes if configured
Explain how to set up and generate a static site using Nuxt.
Think about config options and the build command.
You got /3 concepts.
    Describe why static site generation improves website performance and SEO.
    Consider how static files differ from server-rendered pages.
    You got /3 concepts.