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
39
40
41
42
43
44
45
46
47
48
49
50
|
// Copyright (c) 2023 Nicolas Paul All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package crocc is a simple Markdown-based static site generator.
package main /* import "go.nc0.fr/crocc" */
import (
"flag"
"log"
)
var (
outputdir = flag.String("out", "dst", "output directory")
url = flag.String("url", "http://localhost", "site URL")
sitemap = flag.Bool("sitemap", false, "generate sitemap.xml")
generateHidden = flag.Bool("hidden", false, "generate hidden pages")
verbose = flag.Bool("v", false, "verbose output")
version = flag.Bool("version", false, "print version and exit")
)
const usage string = `crocc is a simple Markdown-based static site generator.
It is designed to be simple and fast, and to be used with a static web server.
Author: Nicolas Paul <n@nc0.fr> (https://nc0.fr)
License: BSD 3-Clause
Repository: https://github.com/n1c00o/crocc
Usage:
crocc [options] [input directory]
Options:`
const Version string = "1.0.0"
func init() {
flag.Usage = func() {
log.Println(usage)
flag.PrintDefaults()
}
}
func main() {
flag.Parse()
if *version {
log.Printf("crocc v%s\n", Version)
return
}
}
|