Jesse Laprade

wg

A static website generator written in Fennel.

Table of Contents

Document conventions

Requirements

This section describes two different sets of requirements:

Requirements for installing and running wg

Requirements for buildings wg from source

Quick start

  1. Download the wg.lua file using one of the following commands:
    • curl https://git.m455.casa/m455/wg/raw/branch/main/dists/wg.lua -o wg
    • wget https://git.m455.casa/m455/wg/raw/branch/main/dists/wg.lua -O wg
  2. Move the wg to a directory on your $PATH
  3. Run wg help

Downloading wg

This section will guide you through downloading wg in your current directory.

Downloading the source code

The source code for wg is publicly available in a Git repository. Source code is useful if you want inspect a program’s behaviour before using it. The source code for wg contains a wg.lua file, which is the file you will need for installing wg on your system.

To download the source code
  1. git clone https://git.m455.casa/m455/wg

Installing wg

This section will guide you through downloading and installing wg either globally or locally.

This section consists of the following subsections:

Installing wg globally

This section will guide you through installing wg globally. This method will install wg into /usr/local/bin, which requires you to have root access to your machine.

Tip: If you don’t have root access to your machine, check out the Installing wg locally section.

To install wg globally
  1. cd wg
  2. sudo make install

Installing wg locally

This section will guide you through installing wg locally. This method will install wg into ~/.local/bin.

To install wg locally
  1. cd wg
  2. make install-local

Installing wg to a custom location

This section will guide you through installing wg to a custom location.

To install wg to a custom location
  1. cd wg
  2. make DESTDIR=~/path/to/custom/location install

Note: If you choose to install wg to a custom location, you will need to remember where you installed wg if you decide to uninstall it later.

Uninstalling wg

This section will guide you through uninstalling wg either globally or locally.

This section consists of the following subsections:

Uninstalling wg globally

This section will guide you through uninstalling wg globally. This method will remove wg from /usr/local/bin, which requires you to have root access to your machine.

To uninstall wg globally
  1. cd wg
  2. make uninstall

Uninstalling wg locally

This section will guide you through uninstalling wg locally. This method will remove wg from ~/.local/bin.

To uninstall wg locally
  1. cd wg
  2. make uninstall-local

Uninstalling wg from a custom location

This section will guide you through uninstalling wg from a custom location.

To uninstall wg from a custom location
  1. cd wg
  2. make DESTDIR=~/path/to/custom/location uninstall

Building wg from source

This section will guide you through compiling the files that make up wg into a single Lua script.

Building a Lua script

Fennel allows you to build a single Lua script from several source files. The Makefile in this repository will create a wg.lua script in the root directory of the repository.

To build a Lua script
  1. make compile

Commands

Usage

Default files and directories explained

This section explains each of the default files and directories that are created after running wg init.

The layout directory

The header file

The contents in the header.md file will be used as a header for any HTML files that were generated from the convert directory.

The contents in the footer.md file will be used as a footer for any HTML files that were generated from the convert directory.

The convert directory

The build directory

Note: This is the directory you will want to use as your website.