Dishit Dhanesha
25 Mar 2022
Overview
Static web development, which traditionally means playing around with HTML and CSS. We’ll naturally call any website built with HTML and CSS a static website as no form of dynamic action is going on. Here to make this process much easier and faster static site generators are introduced. Static Site Generators are a new, hybrid approach to web development that allows you to build a powerful, website locally on your computer but pre-builds the site into static files for deployment.
These Static Site Generators follow Jamstack Architecture. Jamstack, a comparatively new and latest term that is a modern web development architecture, and Gridsome is a framework following Jamstack Architecture, it is a Vue-powered static site generator for building blazing fast static websites. Now you might think that why Jamstack and Gridsome terms are being so popular in a short span of time. So here comes in the picture its advantages over the architectures and frameworks we are using currently and we will discuss the same in this article with its implementation.
So Let’s Hop On It.
Introduction to Jamstack.
Introduction to Gridsome.
Architecture of Gridsome.
Working of Gridsome.
Gridsome generates static HTML that hydrates into a Vue.js SPA once loaded in the browser. This means you can build both static websites & dynamic apps with Gridsome.
Gridsome builds one .html file and one .json file for every page. After the first page load, it only uses the .json files to prefetch and load data for the next pages. It also builds a .js bundle for each page that needs it (code splitting).
Installation Process
1. Install Gridsome CLI tool
-Using YARN:yarn global add @gridsome/cli
-Using NPM:npm install --global @gridsome/cli
2. Create a Gridsome project
gridsome create my-gridsome-site to create a new project
cd my-gridsome-site to move into project directory
gridsome develop to start local dev server at http://localhost:8080
Happy coding 🎉🙌
3. Next steps
Create .vue components in the src/pages directory to create page routes.
Use gridsome build to generate static files in a /dist folder
Benefits of Using Gridsome.
Gridsome is fast by default. Gridsome generates static PWAs. Only critical HTML, CSS, and JavaScript get loaded first. The next pages are then prefetched so users can click around incredibly fast without page reloads, even when offline. Simple, safe deployment, no servers, no databases, Only files. Deploy your entire site to a CDN and forget about it. SEO-friendly Gridsome sites load as static HTML before they hydrate into fully Vue. js-powered SPAs.
Divya Nautiyal
Wed Dec 27 2023
Jhansi Pothuru
Tue Dec 26 2023
Divya Nautiyal
Thu Dec 21 2023
Jhansi Pothuru
Tue Dec 19 2023
Partner with Reveation Labs today and let’s turn your business goals into tangible success. Get in touch with us to discover how we can help you.