Changeset 70 in code


Ignore:
Timestamp:
Sep 16, 2023, 4:11:35 PM (21 months ago)
Author:
Izuru Yakumo
Message:

Fix a bug that I caused

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/aya.1

    r69 r70  
    2424Removes the generated
    2525site directory
     26.It serve
     27Serves the .pub
     28directory over
     29HTTP
    2630.It var
    2731Print a list of variables
    2832defined in a given
    29 markdown file
     33markdown file,
     34including empty
     35variables.
    3036.It watch
    3137(Re-)build a site if
    32 any file changed and
    33 serve it over HTTP
     38any file changed.
    3439.El
    3540.Sh HISTORY
    3641.Nm
    37 was originally forked from prologic/zs by Izuru
    38 out of disgust with the latest revision, so he
    39 used a earlier commit as a base, and then
     42was originally forked from
     43prologic/zs by Izuru out of disgust
     44with the latest revision, so he used an
     45earlier commit as a base, and then
    4046eventually reimplemented older features from
    41 zserge's original project.
     47the original project.
    4248.Sh AUTHORS
    4349.Nm
     
    4551.An Izuru Yakumo
    4652.Aq Lk https://geidontei.chaotic.ninja/usr/yakumo_izuru/
     53.Sh BUGS
     54Report them to this mailing list
     55.Mt devel@chaotic.ninja
  • trunk/cmd/aya/main.go

    r69 r70  
    1 // $TheSupernovaDuo: cmd/aya/main.go,v 0.6.0 2023/9/13 07:50:00 yakumo_izuru Exp $
     1// $TheSupernovaDuo: cmd/aya/main.go,v 0.6.1 2023/9/16 11:43:00 yakumo_izuru Exp $
    22package main
    33
     
    363363}
    364364
    365 // Serve the public directory over HTTP and watch for changes
     365// Serve the public directory over HTTP
    366366func serve() {
    367         http.Handle("/", http.FileServer(http.Dir(PUBDIR)))
     367        root := http.Dir(PUBDIR)
     368        http.Handle("/", http.FileServer(root))
     369        log.Printf("Serving the %s directory over http://localhost:8000. Interrupt with ^C.\n", PUBDIR)
    368370        log.Fatal(http.ListenAndServe(":8000", nil))
    369371}
     
    379381// Print usage notes
    380382func printUsage() {
    381         fmt.Printf("%v <command> [args]\n", os.Args[0])
     383        fmt.Printf("Usage: %s <command> [args]\n", os.Args[0])
     384        fmt.Printf("Where <command> is one of\n")
    382385        fmt.Printf("\n")
    383         fmt.Printf("Where <command> is:\n")
    384         fmt.Printf("\tbuild\tGenerate site\n")
    385         fmt.Printf("\tclean\tRemoves the generated site directory\n")
    386         fmt.Printf("\tvar\tQuery variable(s) from a markdown file\n")
    387         fmt.Printf("\tversion\tPrint program version and exit\n")
    388         fmt.Printf("\twatch\t(Re)generate site while looking for changes (it also serves on HTTP)\n")
    389         fmt.Printf("\n")
    390         fmt.Printf("Other commands may be dynamically added by plugins found in %v\n", AYADIR)
     386        fmt.Printf("\tbuild\t(Re-)builds site or a specific file\n")
     387        fmt.Printf("\tclean\trm -rf %s\n", PUBDIR)
     388        fmt.Printf("\tserve\tServes the %s directory over HTTP\n", PUBDIR)
     389        fmt.Printf("\tvar\tPrint a list of variables defined in a given file, or values of certain variables\n")
     390        fmt.Printf("\twatch\t(Re-)builds site and looks for changes\n")
    391391        os.Exit(0)
    392392}
     
    414414        case "help":
    415415                printUsage()
     416        case "serve":
     417                serve()
    416418        case "var":
    417419                if len(args) == 0 {
     
    439441        case "watch":
    440442                buildAll(true)
    441                 serve()
    442443        default:
    443444                if s, err := run(globals(), cmd, args...); err != nil {
  • trunk/doc.go

    r69 r70  
     1package aya
    12// Package aya is [...]
    23
     
    1819
    1920// Ayaya~
    20 package aya
Note: See TracChangeset for help on using the changeset viewer.