Bug fixes and support for Gemtext markup

git-svn-id: file:///srv/svn/repo/aya/trunk@94 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
shinyoukai
2025-12-03 22:26:27 +00:00
parent 8be5654567
commit 050e315b61
8 changed files with 68 additions and 11 deletions

View File

@@ -17,24 +17,19 @@ Named after [Aya Shameimaru](https://en.touhouwiki.net/wiki/Aya_Shameimaru) from
Build it manually provided you have Go (>=1.17) installed:
$ go install mahou-no-mori.yakumo.dev/aya/cmd/aya@latest (1)
--- or ---
$ git clone https://git.mentality.rip/novaburst/aya
$ svn checkout https://svn.laidback.moe/repo/aya/trunk aya
$ cd aya
$ make
# make install
(1) If you use this method, the `aya version` subcommand may print the wrong string,
but it should not be a problem unless you use it on a page.
You can also disable certain features at build time, with the `-tags` switch.
Currently, these tags are available: `noamber`, `nogcss`.
Currently, these tags are available: `noamber`, `nogcss`, `nogemtext`
See `go help buildconstraint` for more details.
## Ideology
Keep your texts in markdown, [amber](https://github.com/eknkc/amber), or html format right in the main directory
of your blog/site.
Keep your texts in markdown, [amber](https://github.com/eknkc/amber), [gemtext](https://git.sr.ht/~m15o/gmi2html), or html format right in the main directory of your blog/site.
Keep all service files (extensions, layout pages, deployment scripts etc)
in the `.aya` subdirectory.
@@ -91,6 +86,22 @@ echo '</channel>' >> $AYA_OUTDIR/blog/rss.xml
echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml
```
## Example of [Twtxt](https://twtxt.readthedocs.io) feed generation
```bash
#!/bin/sh
for f in ./blog/*/*.md; do
d=$($AYA var $f date)
if [ !-z $d ]; then
timestamp=`gdate --date "$d" +%s`
title=`$AYA var $f title | tr A-Z a-z`
url=`$AYA var $f url`
descr=`$AYA var $f description`
echo $timestamp "$(gdate --date @$timestamp --iso-8601=seconds) $title ($desc) -- $url"
fi
done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/twtxt.txt
```
## 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