Barn

April 8, 2026 · View on GitHub

NPM NPM

Online Demo

A resume/CV static site generator — parse your information from YAML files plus Pug templates, and output a deployable static website. Think of it as a resume-focused Hexo. Deploy effortlessly to GitHub Pages or any static hosting service.

Getting Started

Prerequisites

Installation

npm install -g barn-cli
# or
yarn global add barn-cli

Workflow

  1. Initialize a project

    barn init
    cd barn-starter
    

    This clones the barn-starter template and removes the .git directory so you can start fresh.

  2. Configure

    Edit config.yml to set your preferred theme, deploy repository, custom domain (CNAME), and other options.

  3. Fill in your information

    Edit YAML files under themes/<your-theme>/content/ with your personal details (profile, education, work experience, skills, etc.). Each YAML file corresponds to a page — for example, index.yml for the Chinese version and en.yml for the English version.

  4. Preview locally

    barn server
    

    This starts an HTTP dev server (default port 3579) with live reload. Any file changes are detected automatically — the pages regenerate and refresh in your browser in real time. Repeat steps 2–3 until you are satisfied.

  5. Deploy

    barn deploy
    

    This generates the final static site into dist/, then pushes it to the remote repository configured in config.yml. Turn on GitHub Pages for your repo (instructions) and your resume will be live.

Commands

CommandAliasDescription
barn initbarn iClone the barn-starter template to bootstrap a new project.
barn generatebarn gRender Pug templates with YAML data, minify HTML/CSS, and output the static site to dist/.
barn serverbarn sGenerate the site, start a dev server with live reload, and open it in the browser. Use -p <port> to specify a custom port.
barn deploybarn dGenerate the site and deploy to a git-based hosting service (e.g., GitHub Pages).
barn -vShow the version.
barn -hShow the help manual.

Themes

ThemeDescription
defaultTwo-column layout with a gray sidebar.
latexLaTeX-style academic resume — single-column, serif fonts, horizontal rules, print-friendly.

To switch themes, change the theme field in config.yml. You can also place additional themes in the themes/ directory.

Contributions of new themes are welcome! See below for guidelines.

Creating a Custom Theme

  1. Create a repository named following the pattern barn-theme-XXXX.
  2. Place Pug templates in the root directory (./), CSS files in ./css/, and images in ./image/.
  3. Provide starter YAML files in ./content/ so users know what data fields to fill in.
  4. Include a README with documentation and usage instructions.
  5. Submit a PR to this project to have your theme listed above. If your theme requires a template engine other than Pug, please note that in the PR.

Debug

Prefix any command with DEBUG=barn-cli to enable verbose logging:

DEBUG=barn-cli barn server

Contributors

License

MIT