Questions tagged [static-site-generation]

Static Site Generators (SSG) are frameworks that build websites from static content. For example, one can build an online blog from a list of text files.

178 questions
3
votes
1 answer

Next13 - conditional user in layout creates hydration error. I'm looking for a solution with SSG

I have a common problem: My header should show "register" for guests or "profile" for users. The header is in the root layout file, the user state is saved in a cookie. In a client component, I am reading the cookie and in useEffect change the…
3
votes
0 answers

Can we generate new page in Next js dynamically without create a new page file

I want to pull everything from an headless CMS, this is possible in gatsby to create new pages, So my question is that is it possible to create new pages in Next js without creating a new page file manually.
3
votes
2 answers

Can the Astro Static Site Generator framework be used to create pages on the fly from data fetched from an API?

A project in our company was built using Astro and Svelte. In this project, API calls have to be made to a CMS to create blog posts dynamically. I would like a way for my clients to write blog posts, update the CMS(GraphCMS) and see that the website…
3
votes
1 answer

How to type the getStaticProps function when using getStaticPaths params?

I working on the following piece of code: It's a blogPost dynamic page: /post/[slug].tsx export const getStaticPaths: GetStaticPaths = async () => { const allSlugs = await getAllSlugs();; return ({ paths: allSlugs.map((slug) => ({ params: {…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
3
votes
2 answers

Gatsby 3 – `gatsby build` fails on 'Building static HTML for pages' with error 'WebpackError: ReferenceError: ... is not defined' (firebase/app)

When running gatsby build, the process fails on Gatsby v3. A bit of context... The firebase modules are being included in a custom hook (code showing this is below). There is a custom webpack config function in gatsby-node that uses the webpack…
3
votes
2 answers

Can part of a website be static site generated and the other be a traditional spa?

So, I've built a website in Nuxt and used ssg. It's great, but for another website 90% of it is all static text and images, but I want a customer login portal where they can see statuses of their products. With my understanding, I don't see how this…
3
votes
1 answer

Is there any static site generator that supports incremental builds?

I want to build a static site with a headless CMS back-end, where the build process will happen only a few pages at a time (whenever the user saves a page in the CMS), but I'm not finding any SSG that will build partial sites, rather than rebuilding…
Martin
  • 111
  • 1
  • 10
3
votes
1 answer

Pelican: include file's contents on main page

Noob Pelican question here: I want to include content on the main page of my pelican site that is not blog-related posts, but which simply reads an rst file and puts the results on the main page. I could put a single post together, but that really…
Rick
  • 1,784
  • 3
  • 15
  • 25
3
votes
0 answers

How to source javascript from node_module for Static Site Generation, in nuxt.config.js?

I am porting an older website into Nuxt. I am relatively new to Nuxt, and am trying to determine how to use nuxt.config.js file properly, for static site generation. I am attempting to source .js files from npm packages. It is unclear to me from…
2
votes
2 answers

How to integrate Quasar UI into Astro SSG

I want to generate static site with Astro generator (https://astro.build/) and I want to use Quasar UI components (https://quasar.dev/) on the site. I found, I can set Vue app entry point in Astro config (astro.config.mjs): import {defineConfig}…
2
votes
0 answers

Proper way of serving images with SSG in Next.js

What's a proper way of serving images when using SSG? Currently, the images are retreived using a custom image loader. This loader creates the URL to my (locally hosted) CMS' api, which allows real-time image optimization using GET parameters. The…
2
votes
1 answer

How can I use Next.js incremental static regeneration (ISR) when deploying on Docker?

I wonder how best to deploy a Next.js app on Docker. The Docker image, once built, should be deployed on two different environments: first on TEST then - using the very same image - on PROD. Each environment has its own database. It doesn't make…
2
votes
1 answer

Not able to generate static site using @sveltejs/adapter-static with bootstrape installed

I created sveltekit app using npm create svelte@latest my-app Then I installed bootstrap using npm install bootstrap and importing bootstrap css and js in root layout like content of src/routes/+layout.svelte