Skip to content

[Feature] Introduce Native Static Site Generation (SSG) via 'gutter export' CLI #7

Description

@HaHiepThanh

📋 Context & Problem Description

Gutter CLI currently supports hot SSR (dynamic compilation/execution) and CSR. However, for content-centric pages like blogs, documentations, and landing pages, dynamic SSR adds unnecessary CPU overhead on the server. Developers currently have to write custom scripts to crawl and export HTML files.

💡 Proposed Solution & Implementation Plan

Add an SSG command to Gutter CLI:

gutter export

Implementation Steps:

  1. Route Declaration: Introduce a configuration option in gutter.Config or a CLI config file to list static routes to export (e.g. []string{"/", "/about", "/blog"}).
  2. Crawler/Render Walk: When gutter export runs, build the host app and invoke RenderToHTML for each route.
  3. Export Directory Structure: Save the returned HTML to corresponding paths in the ./dist directory (e.g. / -> dist/index.html, /about -> dist/about/index.html).
  4. Asset Bundle: Copy all WASM and static assets into the export directory.

🎯 Impact & Benefits

  • Serverless Deployments: Enables Gutter apps to be deployed directly to static hosts like Cloudflare Pages, Vercel, Netlify, and GitHub Pages.
  • Instant TTFB: Zero server-side rendering latency at request time.

🏷️ Suggested Labels

feature, cli, ssr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions