Mercurial > yakumo_izuru > aya
annotate README.md @ 85:64cd79d367b5 draft
とにかく、「aya.PrintVersion」は何か特別なことをするわけではありません
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author | yakumo.izuru |
---|---|
date | Tue, 26 Mar 2024 11:56:38 +0000 |
parents | d8c30f64e301 |
children | 897d57a7ec95 |
rev | line source |
---|---|
55 | 1 # aya |
8 | 2 |
55 | 3 aya is an extremely minimal static site generator written in Go. |
8 | 4 |
64 | 5 Named after [Aya Shameimaru](https://en.touhouwiki.net/wiki/Aya_Shameimaru) from [Touhou 9.5: Shoot the Bullet](https://en.touhouwiki.net/wiki/Shoot_the_Bullet) |
8 | 6 |
7 ## Features | |
8 | |
9 * Zero configuration (no configuration file needed) | |
10 * Cross-platform | |
11 * Highly extensible | |
38 | 12 * Works well for blogs and generic static websites (landing pages etc) |
74 | 13 * Easy to learn (you literally don't need to) |
14 * Fast (goes without saying) | |
8 | 15 |
16 ## Installation | |
17 | |
67 | 18 Build it manually assuming you have Go (>=1.17) installed: |
8 | 19 |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
20 $ go install marisa.chaotic.ninja/aya/cmd/aya@latest (1) |
64 | 21 --- or --- |
83 | 22 $ git clone https://git.chaotic.ninja/yakumo_izuru/aya |
64 | 23 $ cd aya |
24 $ make | |
25 # make install | |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
26 |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
27 (1) If you use this method, the `aya version` subcommand may print the wrong string, |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
28 but it should not be a problem unless you use it on a page. |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
29 |
8 | 30 ## Ideology |
31 | |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
32 Keep your texts in markdown, [amber](https://github.com/eknkc/amber), or html format right in the main directory |
38 | 33 of your blog/site. |
8 | 34 |
35 Keep all service files (extensions, layout pages, deployment scripts etc) | |
55 | 36 in the `.aya` subdirectory. |
8 | 37 |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
38 Define variables in the header of the content files using [YAML](https://www.yaml.io) : |
8 | 39 |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
40 ```markdown |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
41 title: My web site |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
42 keywords: best website, hello, world |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
43 --- |
8 | 44 |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
45 Markdown text goes after a header *separator* |
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
46 ``` |
8 | 47 |
48 Use placeholders for variables and plugins in your markdown or html | |
38 | 49 files, e.g. `{{ title }}` or `{{ command arg1 arg2 }}. |
8 | 50 |
55 | 51 Write extensions in any language you like and put them into the `.aya` |
8 | 52 subdiretory. |
53 | |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
54 Everything the extensions prints to [stdout](https://man.freebsd.org/cgi/man.cgi?fd) becomes the value of the |
8 | 55 placeholder. |
56 | |
80 | 57 Every variable from the content header will be passed via environment variables like `title` becomes `$AYA_TITLE` and so on. |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
58 There are some special variables: |
8 | 59 |
55 | 60 * `$AYA` - a path to the `aya` executable |
80 | 61 * `$AYA_OUTDIR` - a path to the directory with generated files |
62 * `$AYA_FILE` - a path to the currently processed markdown file | |
63 * `$AYA_URL` - a URL for the currently generated page | |
8 | 64 |
38 | 65 ## Example of RSS generation |
66 | |
67 Extensions can be written in any language you know (Bash, Python, Lua, JavaScript, Go, even Assembler). Here's an example of how to scan all markdown blog posts and create RSS items: | |
8 | 68 |
38 | 69 ``` bash |
64 | 70 #!/bin/sh |
71 echo "Generating RSS feed" | |
72 | |
73 echo '<?xml version="1.0" encoding="utf-8"?>' > $AYA_OUTDIR/blog/rss.xml | |
74 echo '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $AYA_OUTDIR/blog/rss.xml | |
75 echo '<channel>' >> $AYA_OUTDIR/blog/rss.xml | |
76 for f in ./blog/*/*.md ; do | |
77 d=$($AYA var $f date) | |
78 if [ ! -z $d ] ; then | |
79 timestamp=`gdate --date "$d" +%s` | |
80 url=`$AYA var $f url` | |
81 title=`$AYA var $f title | tr A-Z a-z` | |
82 descr=`$AYA var $f description` | |
83 echo $timestamp "<item><title>$title</title><link>https://technicalmarisa.chaotic.ninja/blog/$url</link><description>$descr</description><pubDate>$(gdate --date @$timestamp -R)</pubDate><guid>http://technicalmarisa.chaotic.ninja/blog/$url</guid></item>" | |
84 fi | |
85 done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/blog/rss.xml | |
86 echo '</channel>' >> $AYA_OUTDIR/blog/rss.xml | |
87 echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml | |
38 | 88 ``` |
8 | 89 |
90 ## Hooks | |
91 There are two special plugin names that are executed every time the build | |
38 | 92 happens - `prehook` and `posthook`. You can define some global actions here like |
83 | 93 content generation, or additional commands, like LESS to CSS conversion |
8 | 94 |
79
7b122b71fcfa
A good time to finally release a stable version
yakumo.izuru
parents:
74
diff
changeset
|
95 Note, you can also place `.gcss` files for [gcss](https://github.com/yosssi/gcss) to process instead |
64 | 96 |
8 | 97 ## Command line usage |
83 | 98 Read `aya(1)` |
60
cf7277e42ece
Add serve function, update documentation accordingly
yakumo.izuru
parents:
55
diff
changeset
|
99 |
8 | 100 ## License |
83 | 101 The software is distributed under the [MIT/X11](LICENSE) license. |
8 | 102 |
83 | 103 ## Sites using Aya! |
104 (I know, I made the majority of them, but they still count) | |
105 | |
106 | Title | Author | Link | | |
107 |------------------------|--------------------------------------------------|---------------------------------------| | |
108 | Aya (project homepage) | Izuru Yakumo | https://aya.chaotic.ninja | | |
109 | Chaotic Ninja | Izuru Yakumo, Mima-sama | https://chaotic.ninja | | |
110 | Geidontei | Izuru Yakumo | https://geidontei.chaotic.ninja | | |
111 | ChaoticIRC Network | Izuru Yakumo | https://im.chaotic.ninja | | |
112 | Kanako | Izuru Yakumo | https://kanako.chaotic.ninja | | |
113 | Kill-9 The Revival | Various authors | https://kill-9.chaotic.ninja | | |
114 | PXIMG(7) | Izuru Yakumo | https://pximg.chaotic.ninja | | |
115 | Shinmyoumaru | Mima-sama | https://shinmyoumaru.chaotic.ninja | | |
116 | Suika | Izuru Yakumo | https://suika.chaotic.ninja | | |
117 | TechnicalMarisa | Izuru Yakumo | https://technicalmarisa.chaotic.ninja | | |
118 | Tengu Space | [DeviousTengu](https://fedi.tengu.space/devious) | https://tengu.space | | |
119 | WindowMaker Shrine | Izuru Yakumo | https://themes.chaotic.ninja | | |
67 | 120 |
121 --- | |
122 | |
123 Ayaya~ |