]> Nishi Git Mirror - aya.git/commitdiff
何をしていたか忘れてしまった v1.0.2
authorIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Tue, 26 Mar 2024 02:18:06 +0000 (23:18 -0300)
committerIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Tue, 26 Mar 2024 02:18:06 +0000 (23:18 -0300)
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
README.md
aya.1
cmd/aya/buildall.go
cmd/aya/main.go
cmd/aya/raw.go
doc.go
serve.go
usage.go

index 97b7c51bc93f46bc093ae651df3296ef0b431cf5..a126c81e86522b156a404f8c6501a764f1d2405a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ Build it manually assuming you have Go (>=1.17) installed:
 
        $ 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 @@ echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml
 ```
 
 ## 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.
+The software is distributed under the [MIT/X11](LICENSE) 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          |
 
 ---
 
diff --git a/aya.1 b/aya.1
index da2dc167861ffaa6453a05cc8e735abd37222e7c..224edc31ce3a6ae05bd862cbf79ee8395fc477bc 100644 (file)
--- a/aya.1
+++ b/aya.1
@@ -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 @@ Does it need one?
 .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 @@ any file changed.
 .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
index e426d8eb0fcc1947660fdced3b04386fbdc3ce2b..b39b3f742c26718363670cfa51a9bece1479b8b5 100644 (file)
@@ -38,7 +38,7 @@ func buildAll(watch bool) {
                                         run(vars, "prehook")
                                         modified = true
                                 }
-                                fmt.Println("build:", path)
+                                fmt.Println("GEN", path)
                                 return build(path, nil, vars)
                         }
                         return nil
index 7a1b352295682670a4c15d2e08498a85e793575c..e517e473b3c855f1d9d9ec1ada500d1d285a10b3 100644 (file)
@@ -3,6 +3,7 @@ package main
 
 import (
        "fmt"
+       "log"
        "os"
        "strings"
 
@@ -39,15 +40,13 @@ func main() {
                        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 @@ func main() {
                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 @@ func main() {
                        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)
                }
index 83e12f3bf60de8c974de8fc0f3e1214811f72421..376db91d7cae2c5f08faa315e8840313e6c70e77 100644 (file)
@@ -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 (
diff --git a/doc.go b/doc.go
index f895c0ef455073e5764cfbcd4dacff2f01c65632..de6c6bc2025d8fa14b23c69b4fbda3cad03da412 100644 (file)
--- a/doc.go
+++ b/doc.go
@@ -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
index 655793af8998d4a8075f49ab3568dbf50f3611dc..fc2398440f14414ea5f1ea9dd26cc6ba07ffbca1 100644 (file)
--- a/serve.go
+++ b/serve.go
@@ -33,7 +33,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 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))
 }
index de29f009e36484fe15e2fc3d89c77b3bee027a2d..0d0f160d65c54bcbcb88f3cdc27bba2b6ad6dd6c 100644 (file)
--- a/usage.go
+++ b/usage.go
@@ -8,7 +8,7 @@ import (
 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")