git-instaweb - Linux


Overview

git-instaweb is a Git extension that simplifies the process of creating and managing static websites directly from a Git repository. It enables developers to build, deploy, and host their websites without the need for additional tools or hosting platforms.

Syntax

git-instaweb [command] [options]

Options/Flags

  • -b, –branch: Specify the branch to use for deployment. Defaults to the current branch.
  • -c, –config: Specify a custom configuration file. Defaults to .instaweb.yml in the repository root.
  • -d, –destination: Set the destination directory for the built website. Defaults to dist.
  • -f, –force: Force rebuild, even if no changes have been detected.
  • -g, –github-pages: Deploy the website to GitHub Pages as a user or organization page.
  • -h, –help: Display help information.
  • -p, –preview: Preview the built website locally using a web server.
  • -s, –source: Specify the source directory for the website. Defaults to the repository root.
  • -t, –template: Specify the HTML template to use for the website. Defaults to index.html.
  • -v, –verbose: Enable verbose output.
  • -y, –yes: Automatically answer "yes" to any confirmation prompts.

Examples

Basic Deployment

Deploy the website to the dist directory:

git-instaweb

Custom Destination Directory

Deploy the website to a custom directory named my-site:

git-instaweb -d my-site

GitHub Pages Deployment

Deploy the website to GitHub Pages as a user page:

git-instaweb -g --github-username your-username

Previewing the Website

Preview the built website locally:

git-instaweb -p

Common Issues

  • Failed build: Ensure that the necessary dependencies are installed, such as Node.js and the Webpack CLI.
  • Deployment errors: Check the configuration file and ensure that the specified destination is accessible.
  • Website not loading: Make sure that the web server is running and the correct port is specified in the configuration file.

Integration

  • GitHub Actions: Automate website deployment using GitHub Actions.
  • Travis CI: Build and deploy static websites on Travis CI.

Related Commands

  • git: The core Git command.
  • hugo: A popular static site generator.
  • jekyll: Another static site generator.