Back
Grubby generates static sites from bare Git repositories
SiTech AI Team2 min read

Grubby generates static sites from bare Git repositories

Grubby is a Ruby static site generator for bare Git repositories. It uses Kramdown, supports hook-based updates, and creates a main index plus a site for each repository.

Static sites from bare Git repositories

Grubby is a static site generator for Git repositories written in Ruby. It is forked and heavily inspired by RepoRat. Grubby generates a website for each bare Git repository and maintains a main repository index.

The project requires Git, Ruby 3.0 or later, and Kramdown. It is designed to work as an opinionated solution with little configuration. Kramdown is the default Markdown parser, although it can be replaced, with no guarantee that alternative parsers will be bug-free.

Configuration and output

Grubby assumes that bare Git repository directories end with the .git extension. Its core repository index generation may not work properly without that naming convention. The main configuration file is _config.yml, which is used to set the core domain and paths.

By default, the repository index is placed at the root of the main directory and named index.html. Its output name can be changed in _config.yml. Users who want to alter the appearance or navigation of generated sites can edit style.css, _header.html, and _footer.html.

Generating sites with Git hooks

The usage guide assumes shared hosting through NearlyFreeSpeech.NET, although the process is described as similar on a personal VPS. Its example stores bare repositories under /home/public/git.sitename.org. Grubby itself is cloned into a private directory, and the process is run from inside a bare repository.

A post-update hook is created in the repository's hooks directory and made executable. The script unsets GIT_DIR, runs git update-server-info, clones the current repository into a temporary directory, copies its description file, and runs the Ruby generator against the temporary checkout. The temporary directory is then removed.

Running the hook generates the individual repository website in its corresponding directory and refreshes index.html at the root. The same call can also be placed in a post-receive hook. A global post-update hook can be used to run the process without including it in every repository.

Current limitations

Grubby does not create separate pages for individual commits, branches, or other individual repository changes. Its generated output is focused on repository websites and the main repository index.

SSiTech

SiTech — AI-powered web development

We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.