all repos — vite @ 54a85a9389fb5a2b778631f0822a5f783a231d5d

a fast (this time, actually) and minimal static site generator

main.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
package main

import (
	"fmt"
	"os"
)

func main() {
	args := os.Args

	helpStr := `usage: vite [options]

A simple and minimal static site generator.

options:
    init PATH       create vite project at PATH
    build           builds the current project
    new PATH        create a new markdown post
        `

	// TODO: make arg parsing less shit

	if len(args) <= 1 {
		fmt.Println(helpStr)
	}

	switch args[1] {
	case "init":
		initPath := args[2]
		viteInit(initPath)
	case "build":
		viteBuild()
	case "new":
		newPath := args[2]
		viteNew(newPath)
	}

}