Introduction
Welcome to gg, the framework for building static website.
- Build using Deno, so 100% TypeScript
- No custom templating language, just JSX, but no React
- Write markup close to HTML, CSS at your fingertips, and use built-in web standards like HTTP caching
- Chooses between SSR or SSG per page out of the box
- Built for serverless, easy deployment to Vercel
Where to use gg
gg shines for websites that are mostly static and contain dynamic content. You can choose any data source to get the content for your pages. A headless CMS, a database, local or remote files, everything is possible if you can access it in Deno.
Dynamic pages are built into gg. This allows you to compile content on run-time based on identifiers in the URL. You can create an arbitrary amount of sites by just implementing one page! gg uses server-side-compiling here, so you can be sure that your pages will always show the most up-to-date content without needing to rebuild anything!
In the modern web, speed matters. That's why as much of your website as possible is compiled into static files already at build time. Pages that rely on external data are generated at run-time using server-side-compiling. To also ensure maximum performance here, gg enforces HTTP cache headers, meaning the site is cached at the edge after the first request. Subsequent requests are served as fast as static files!
Not only speed matters but also size. The compiler at the heart of gg is built with minimalism in mind. Class names are mangled, unused CSS is not shipped to the client and if your page doesn't need it, there won't be a line of JavaScript.
Probably some pages on your website might need some dynamic elements after all. But gg also has you covered here. It comes with basic APIs that allow simple state management bound to DOM elements on your page that will be updated on the client. The JavaScript used here is again minimized to the last byte.
The following use-cases are great for gg:
- Blogs
- Wikis
- Documentation sites
- Landing pages
Where to not use gg
It's important to choose the right tool for the job at hand. gg is not build to be the sledgehammer that you should hit every nail with, no matter the size. So let's clear when gg maybe is not the right choice for your project.
gg can handle client-side state. The APIs are thought out to be quite complete, meaning you can in theory do everything you'd like. But gg does not work like e.g. React, meaning the code and the markup you write is not shipped to the client as is. It's being precisely transformed at build time into a format that allows gg to ship way less JavaScript than most other frameworks are able to. As a result, using complex client-side state can become quite cumbersome. If that's a requirement for your website, you might want to look for more client-focused frameworks instead.
Instead of being heavy on the client, gg tries to ship as little code as possible. That also means that gg does not support any kind of client-side-routing. It's just basic HTML pages and plain anchor tags. To still ensure fast page transitions you can tell gg to preload specific links on your website. Note that having no client-side-routing also implies that you can't share or persist state between pages at the moment.
What's next
- Getting started: Learn how to install gg and setup your first project.
- Guide: Learn how gg works and what you can do with it.
- State-management tutorial: Follow along and hands-on build an example page, where we will learn all about how state management works in gg.
Next → Getting started