Mercurial > yakumo_izuru > aya
comparison README.md @ 64:0716397c44e8 draft
Update documentation
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author | yakumo.izuru |
---|---|
date | Sun, 07 May 2023 13:59:02 +0000 |
parents | cf7277e42ece |
children | 6d985efa0f7a |
comparison
equal
deleted
inserted
replaced
63:1bd8a674a30c | 64:0716397c44e8 |
---|---|
1 # aya | 1 # aya |
2 | 2 |
3 aya is an extremely minimal static site generator written in Go. | 3 aya is an extremely minimal static site generator written in Go. |
4 | 4 |
5 This crow tengu stands for 'the fastest one in Gensokyo' and yes this is also a Touhou Project reference. | 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) |
6 | 6 |
7 ## Features | 7 ## Features |
8 | 8 |
9 * Zero configuration (no configuration file needed) | 9 * Zero configuration (no configuration file needed) |
10 * Cross-platform | 10 * Cross-platform |
11 * Highly extensible | 11 * Highly extensible |
12 * Works well for blogs and generic static websites (landing pages etc) | 12 * Works well for blogs and generic static websites (landing pages etc) |
13 * Easy to learn | 13 * Easy to learn |
14 * Fast | 14 * Fast (duh!) |
15 | 15 |
16 ## Installation | 16 ## Installation |
17 | 17 |
18 Build it manually assuming you have Go installed: | 18 Build it manually assuming you have Go installed: |
19 | 19 |
20 $ go install marisa.chaotic.ninja/aya/cmd/aya@latest | 20 $ go install marisa.chaotic.ninja/aya/cmd/aya@latest |
21 | 21 --- or --- |
22 $ git clone https://git.chaotic.ninja/yakumo.izuru/aya | |
23 $ cd aya | |
24 $ make | |
25 # make install | |
26 | |
22 ## Ideology | 27 ## Ideology |
23 | 28 |
24 Keep your texts in markdown, or HTML format right in the main directory | 29 Keep your texts in markdown, or HTML format right in the main directory |
25 of your blog/site. | 30 of your blog/site. |
26 | 31 |
54 ## Example of RSS generation | 59 ## Example of RSS generation |
55 | 60 |
56 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: | 61 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: |
57 | 62 |
58 ``` bash | 63 ``` bash |
59 for f in ./blog/*.md ; do | 64 #!/bin/sh |
60 d=$($AYA var $f date) | 65 echo "Generating RSS feed" |
61 if [ ! -z $d ] ; then | 66 |
62 timestamp=`date --date "$d" +%s` | 67 echo '<?xml version="1.0" encoding="utf-8"?>' > $AYA_OUTDIR/blog/rss.xml |
63 url=`$AYA var $f url` | 68 echo '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $AYA_OUTDIR/blog/rss.xml |
64 title=`$AYA var $f title | tr A-Z a-z` | 69 echo '<channel>' >> $AYA_OUTDIR/blog/rss.xml |
65 descr=`$AYA var $f description` | 70 for f in ./blog/*/*.md ; do |
66 echo $timestamp \ | 71 d=$($AYA var $f date) |
67 "<item>" \ | 72 if [ ! -z $d ] ; then |
68 "<title>$title</title>" \ | 73 timestamp=`gdate --date "$d" +%s` |
69 "<link>http://zserge.com/$url</link>" \ | 74 url=`$AYA var $f url` |
70 "<description>$descr</description>" \ | 75 title=`$AYA var $f title | tr A-Z a-z` |
71 "<pubDate>$(date --date @$timestamp -R)</pubDate>" \ | 76 descr=`$AYA var $f description` |
72 "<guid>http://zserge.com/$url</guid>" \ | 77 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>" |
73 "</item>" | 78 fi |
74 fi | 79 done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/blog/rss.xml |
75 done | sort -r -n | cut -d' ' -f2- | 80 echo '</channel>' >> $AYA_OUTDIR/blog/rss.xml |
81 echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml | |
76 ``` | 82 ``` |
77 | 83 |
78 ## Hooks | 84 ## Hooks |
79 | 85 |
80 There are two special plugin names that are executed every time the build | 86 There are two special plugin names that are executed every time the build |
84 # .aya/post | 90 # .aya/post |
85 | 91 |
86 #!/bin/sh | 92 #!/bin/sh |
87 lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css | 93 lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css |
88 rm -f $AYA_OUTDIR/styles.css | 94 rm -f $AYA_OUTDIR/styles.css |
95 | |
96 ## Extras | |
97 | |
98 `aya` also supports generating `.html` and `.css` by means of using `.amber` | |
99 and `.gcss` files. See more at [eknkc/amber](https://github.com/eknkc/amber) [yosssi/gcss](https://github.com/yosssi/gcss) | |
89 | 100 |
90 ## Command line usage | 101 ## Command line usage |
91 | 102 |
92 `aya build` re-builds your site. | 103 `aya build` re-builds your site. |
93 | 104 |