Update documentation
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/aya/trunk@65 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
51
README.md
51
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
aya is an extremely minimal static site generator written in Go.
|
||||
|
||||
This crow tengu stands for 'the fastest one in Gensokyo' and yes this is also a Touhou Project reference.
|
||||
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)
|
||||
|
||||
## Features
|
||||
|
||||
@@ -11,14 +11,19 @@ This crow tengu stands for 'the fastest one in Gensokyo' and yes this is also a
|
||||
* Highly extensible
|
||||
* Works well for blogs and generic static websites (landing pages etc)
|
||||
* Easy to learn
|
||||
* Fast
|
||||
* Fast (duh!)
|
||||
|
||||
## Installation
|
||||
|
||||
Build it manually assuming you have Go installed:
|
||||
|
||||
$ go install marisa.chaotic.ninja/aya/cmd/aya@latest
|
||||
|
||||
--- or ---
|
||||
$ git clone https://git.chaotic.ninja/yakumo.izuru/aya
|
||||
$ cd aya
|
||||
$ make
|
||||
# make install
|
||||
|
||||
## Ideology
|
||||
|
||||
Keep your texts in markdown, or HTML format right in the main directory
|
||||
@@ -56,23 +61,24 @@ Every variable from the content header will be passed via environment variables
|
||||
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:
|
||||
|
||||
``` bash
|
||||
for f in ./blog/*.md ; do
|
||||
d=$($AYA var $f date)
|
||||
if [ ! -z $d ] ; then
|
||||
timestamp=`date --date "$d" +%s`
|
||||
url=`$AYA var $f url`
|
||||
title=`$AYA var $f title | tr A-Z a-z`
|
||||
descr=`$AYA var $f description`
|
||||
echo $timestamp \
|
||||
"<item>" \
|
||||
"<title>$title</title>" \
|
||||
"<link>http://zserge.com/$url</link>" \
|
||||
"<description>$descr</description>" \
|
||||
"<pubDate>$(date --date @$timestamp -R)</pubDate>" \
|
||||
"<guid>http://zserge.com/$url</guid>" \
|
||||
"</item>"
|
||||
fi
|
||||
done | sort -r -n | cut -d' ' -f2-
|
||||
#!/bin/sh
|
||||
echo "Generating RSS feed"
|
||||
|
||||
echo '<?xml version="1.0" encoding="utf-8"?>' > $AYA_OUTDIR/blog/rss.xml
|
||||
echo '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $AYA_OUTDIR/blog/rss.xml
|
||||
echo '<channel>' >> $AYA_OUTDIR/blog/rss.xml
|
||||
for f in ./blog/*/*.md ; do
|
||||
d=$($AYA var $f date)
|
||||
if [ ! -z $d ] ; then
|
||||
timestamp=`gdate --date "$d" +%s`
|
||||
url=`$AYA var $f url`
|
||||
title=`$AYA var $f title | tr A-Z a-z`
|
||||
descr=`$AYA var $f description`
|
||||
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>"
|
||||
fi
|
||||
done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/blog/rss.xml
|
||||
echo '</channel>' >> $AYA_OUTDIR/blog/rss.xml
|
||||
echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml
|
||||
```
|
||||
|
||||
## Hooks
|
||||
@@ -87,6 +93,11 @@ content generation, or additional commands, like LESS to CSS conversion:
|
||||
lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css
|
||||
rm -f $AYA_OUTDIR/styles.css
|
||||
|
||||
## Extras
|
||||
|
||||
`aya` also supports generating `.html` and `.css` by means of using `.amber`
|
||||
and `.gcss` files. See more at [eknkc/amber](https://github.com/eknkc/amber) [yosssi/gcss](https://github.com/yosssi/gcss)
|
||||
|
||||
## Command line usage
|
||||
|
||||
`aya build` re-builds your site.
|
||||
|
||||
Reference in New Issue
Block a user