changeset 83:d8c30f64e301 draft

何をしていたか忘れてしまった Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author yakumo.izuru
date Tue, 26 Mar 2024 02:18:06 +0000
parents 1b27391363d1
children 70a33aa93055
files README.md aya.1 cmd/aya/buildall.go cmd/aya/main.go cmd/aya/raw.go doc.go serve.go usage.go
diffstat 8 files changed, 76 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Tue Mar 26 02:14:25 2024 +0000
+++ b/README.md	Tue Mar 26 02:18:06 2024 +0000
@@ -19,7 +19,7 @@
 
 	$ go install marisa.chaotic.ninja/aya/cmd/aya@latest (1)
 	--- or ---
-	$ git clone https://git.chaotic.ninja/yakumo.izuru/aya
+	$ git clone https://git.chaotic.ninja/yakumo_izuru/aya
 	$ cd aya
 	$ make
 	# make install
@@ -88,36 +88,35 @@
 ```
 
 ## Hooks
-
 There are two special plugin names that are executed every time the build
 happens - `prehook` and `posthook`. You can define some global actions here like
-content generation, or additional commands, like LESS to CSS conversion:
-
-	# .aya/post
-
-	#!/bin/sh
-	lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css
-	rm -f $AYA_OUTDIR/styles.css
+content generation, or additional commands, like LESS to CSS conversion
 
 Note, you can also place `.gcss` files for [gcss](https://github.com/yosssi/gcss) to process instead
 
 ## Command line usage
-
-`aya build` re-builds your site.
-
-`aya build <file>` re-builds one file and prints resulting content to stdout.
-
-`aya serve` serves your site over HTTP.
-
-`aya var <filename> [var1 var2...]` prints a list of variables defined in the
-header of a given markdown file, or the values of certain variables (even if
-it's an empty string).
-
-`aya watch` rebuilds your site every time you modify any file. 
+Read `aya(1)`
 
 ## License
+The software is distributed under the [MIT/X11](LICENSE) license.
 
-The software is distributed under the MIT/X11 license.
+## Sites using Aya!
+(I know, I made the majority of them, but they still count)
+
+| Title                  | Author                                           | Link                                  |
+|------------------------|--------------------------------------------------|---------------------------------------|
+| Aya (project homepage) | Izuru Yakumo                                     | https://aya.chaotic.ninja             |
+| Chaotic Ninja          | Izuru Yakumo, Mima-sama                          | https://chaotic.ninja                 |
+| Geidontei              | Izuru Yakumo                                     | https://geidontei.chaotic.ninja       |
+| ChaoticIRC Network     | Izuru Yakumo                                     | https://im.chaotic.ninja              |
+| Kanako                 | Izuru Yakumo                                     | https://kanako.chaotic.ninja          |
+| Kill-9 The Revival     | Various authors                                  | https://kill-9.chaotic.ninja          |
+| PXIMG(7)               | Izuru Yakumo                                     | https://pximg.chaotic.ninja           |
+| Shinmyoumaru           | Mima-sama                                        | https://shinmyoumaru.chaotic.ninja    |
+| Suika                  | Izuru Yakumo                                     | https://suika.chaotic.ninja           |
+| TechnicalMarisa        | Izuru Yakumo                                     | https://technicalmarisa.chaotic.ninja |
+| Tengu Space            | [DeviousTengu](https://fedi.tengu.space/devious) | https://tengu.space                   |
+| WindowMaker Shrine     | Izuru Yakumo                                     | https://themes.chaotic.ninja          |
 
 ---
 
--- a/aya.1	Tue Mar 26 02:14:25 2024 +0000
+++ b/aya.1	Tue Mar 26 02:18:06 2024 +0000
@@ -3,7 +3,14 @@
 .Os
 .Sh NAME
 .Nm aya
-.Nd A really fast static site generator
+.Nd The fastest static site generator
+.Sh SYNOPSIS
+.Nm
+.Op build
+.Op clean
+.Op serve
+.Op var Ar file Ar variable
+.Op watch
 .Sh DESCRIPTION
 Does it need one?
 .Sh FEATURES
@@ -14,6 +21,7 @@
 .It Works well for blogs and generic static websites (landing pages etc)
 .It Easy to learn
 .It Fast (of course)
+.It Only 4 external dependencies!
 .El
 .Sh USAGE
 .Bl -tag -width 11n -compact
@@ -39,17 +47,41 @@
 .El
 .Sh HISTORY
 .Nm
-was originally forked from
-prologic/zs by Izuru out of disgust
-with the latest revision, so he used an
-earlier commit as a base, and then
-eventually reimplemented older features from
-the original project.
+was forked from
+.Lk https://git.mills.io/prologic/zs
+due to disgust with how the project
+turned out to be.
+Later on, features from the original
+program were reimplemented and
+it took a different path from both.
+.Sh ENVIRONMENT
+.Bl -tag -width 11n
+.It Ev AYADIR
+Directory where
+extensions, layouts and
+hooks placed in to be used
+by the program
+.It Ev PUBDIR
+Directory where generated files are
+located
+.It Ev AYA_*
+Internal variables regarding a
+Markdown document in question,
+see
+.Dq aya var <file>
+.El
+.Sh EXIT STATUS
+.Ex -std
 .Sh AUTHORS
 .Nm
 is maintained by
 .An Izuru Yakumo
-.Aq Lk https://geidontei.chaotic.ninja/usr/yakumo_izuru/
+.Aq Mt yakumo.izuru@chaotic.ninja
+.Pp
+.Nm zs
+was made by
+.An Serge Zaitsev
+.Aq Mt hello@zserge.com
 .Sh BUGS
-Report them to this mailing list
-.Mt devel@chaotic.ninja
+If you find any, please report them to
+.Aq Mt aya-dev@chaotic.ninja
--- a/cmd/aya/buildall.go	Tue Mar 26 02:14:25 2024 +0000
+++ b/cmd/aya/buildall.go	Tue Mar 26 02:18:06 2024 +0000
@@ -38,7 +38,7 @@
                                         run(vars, "prehook")
                                         modified = true
                                 }
-                                fmt.Println("build:", path)
+                                fmt.Println("GEN", path)
                                 return build(path, nil, vars)
                         }
                         return nil
--- a/cmd/aya/main.go	Tue Mar 26 02:14:25 2024 +0000
+++ b/cmd/aya/main.go	Tue Mar 26 02:18:06 2024 +0000
@@ -3,6 +3,7 @@
 
 import (
 	"fmt"
+	"log"
 	"os"
 	"strings"
 
@@ -39,15 +40,13 @@
 			buildAll(false)
 		} else if len(args) == 1 {
 			if err := build(args[0], os.Stdout, globals()); err != nil {
-				fmt.Println("ERROR: " + err.Error())
-				os.Exit(1)
+				log.Fatal("[build]" + err.Error())
 			}
 		} else {
-			fmt.Println("ERROR: too many arguments")
-			os.Exit(1)
+			log.Fatal("[build] Too many arguments")
 		}
 	case "clean":
-		fmt.Println("Removing generated site directory")
+		fmt.Println("[clean] Removing generated site directory")
 		os.RemoveAll(PUBDIR)
 	case "help":
 		aya.PrintUsage()
@@ -55,12 +54,11 @@
 		aya.HttpServe(PUBDIR, 8000)
 	case "var":
 		if len(args) == 0 {
-			fmt.Println("var: filename expected")
-			os.Exit(1)
+			log.Fatal("[var] Filename expected")
 		} else {
 			s := ""
 			if vars, _, err := getVars(args[0], Vars{}); err != nil {
-				fmt.Println("var: " + err.Error())
+				log.Fatal("[var]" + err.Error())
 			} else {
 				if len(args) > 1 {
 					for _, a := range args[1:] {
@@ -75,13 +73,13 @@
 			fmt.Println(strings.TrimSpace(s))
 		}
 	case "version":
-		fmt.Printf("%v\n", aya.PrintVersion())
+		aya.PrintVersion()
 		os.Exit(0)
 	case "watch":
 		buildAll(true)
 	default:
 		if s, err := run(globals(), cmd, args...); err != nil {
-			fmt.Println(err)
+			log.Fatal(err)
 		} else {
 			fmt.Println(s)
 		}
--- a/cmd/aya/raw.go	Tue Mar 26 02:14:25 2024 +0000
+++ b/cmd/aya/raw.go	Tue Mar 26 02:18:06 2024 +0000
@@ -1,4 +1,5 @@
 // Copy files as-is from source to destination
+// If there are heavy files, the generation process can slow down
 package main
 
 import (
--- a/doc.go	Tue Mar 26 02:14:25 2024 +0000
+++ b/doc.go	Tue Mar 26 02:18:06 2024 +0000
@@ -4,14 +4,6 @@
 // Requires zero configuration to get started
 // Named after Aya Shameimaru from Touhou Project
 
-// Current subcommands available:
-// build -- Generate the site, result can be found at .pub
-// build [file] -- Only generate the argument passed to standard output
-// serve -- Spawn an HTTP server in localhost port 8000, serving the .pub directory
-// var [file] -- Query variables from a markdown file
-// version -- Print version and exit
-// watch -- (Re)generate site while looking for changes
-
 // Aya is licensed under the MIT license
 // This is a hard fork of git.mills.io/prologic/zs, which in turn is a fork of zserge's zs
 // This one (re)incorporates the features removed in the former from the latter
--- a/serve.go	Tue Mar 26 02:14:25 2024 +0000
+++ b/serve.go	Tue Mar 26 02:18:06 2024 +0000
@@ -33,7 +33,7 @@
 func HttpServe(Dir string, Port int) {
 	handler := &Handler{http.FileServer(http.Dir(Dir))}
 	http.Handle("/", handler)
-	addr := fmt.Sprintf(":%d", Port)
-	log.Printf("Listening on %s\n", addr)
+	addr := fmt.Sprintf("127.0.0.1:%d", Port)
+	log.Printf("[aya.HttpServe] Listening on %s\n", addr)
 	log.Fatal(http.ListenAndServe(addr, nil))
 }
--- a/usage.go	Tue Mar 26 02:14:25 2024 +0000
+++ b/usage.go	Tue Mar 26 02:18:06 2024 +0000
@@ -8,7 +8,7 @@
 func PrintUsage() {
 	fmt.Printf("aya/%v\n", PrintFullVersion())
 	fmt.Println("Homepage: https://aya.chaotic.ninja")
-	fmt.Println("Repository: https://git.chaotic.ninja/yakumo.izuru/aya")
+	fmt.Println("Repository: https://git.chaotic.ninja/usr/yakumo_izuru/aya")
 	fmt.Println("==")
 	fmt.Println("build [file] · (Re)build a site or a file in particular")
 	fmt.Println("clean · Remove the generated .pub directory")