Just a documentation update

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

git-svn-id: file:///srv/svn/repo/aya/trunk@78 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
yakumo.izuru
2023-12-10 23:57:40 +00:00
parent cdccb2a932
commit ce6aacf82a
4 changed files with 8 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.8 2023-12-04 15:43:44+0000, yakumo_izuru Exp $
// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.9 2023-12-09 23:30:07+0000, yakumo_izuru Exp $
package main
import (
@@ -199,7 +199,7 @@ func buildMarkdown(path string, w io.Writer, vars Vars) error {
return buildHTML(filepath.Join(AYADIR, v["layout"]), w, v)
}
// Renders text file expanding all variable macros inside it
// Renders hypertext file expanding all variable macros inside it
func buildHTML(path string, w io.Writer, vars Vars) error {
v, body, err := getVars(path, vars)
if err != nil {
@@ -402,7 +402,7 @@ func main() {
case "help":
aya.PrintUsage()
case "serve":
aya.HttpServe(PUBDIR)
aya.HttpServe(PUBDIR, 8000)
case "var":
if len(args) == 0 {
fmt.Println("var: filename expected")

View File

@@ -29,10 +29,11 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Println(r.RemoteAddr, r.Method, rw.StatusCode, r.URL)
}
func HttpServe(Dir string) {
// This function is called by the `aya serve` subcommand
func HttpServe(Dir string, Port int) {
handler := &Handler{http.FileServer(http.Dir(Dir))}
http.Handle("/", handler)
addr := fmt.Sprintf(":%d", 8000)
addr := fmt.Sprintf(":%d", Port)
log.Printf("Listening on %s\n", addr)
log.Fatal(http.ListenAndServe(addr, nil))
}

View File

@@ -4,6 +4,7 @@ import (
"fmt"
)
// This function is called by the `aya help` subcommand
func PrintUsage() {
fmt.Printf("aya/%v\n", FullVersion())
fmt.Println("Homepage: https://aya.chaotic.ninja")

View File

@@ -8,7 +8,7 @@ import (
var (
// Set to current tag
Version = "v0.6.8"
Version = "v0.6.9"
Time = time.Now()
)