== Aya An extremely ''fucking fast'' and (not quite) minimal static site generator written in [https://go.dev Go]. It's named after [https://en.touhouwiki.net/wiki/Aya_Shameimaru Aya Shameimaru] from [https://en.touhouwiki.net/wiki/Phantasmagoria_of_Flower_View Phantasmagoria of Flower View]. === Features * Zero configuration * Cross-platform * Highly extensible * Works well for blogs, documentation pages, and generic static websites * Easy to learn (make layout, write pages, {{{ aya build }}}, and done!) === Installation Requires [https://go.dev Go] 1.17 or higher. {{{ $ git clone https://git.chaotic.ninja/yakumo.izuru/aya $ cd aya $ make $ ./aya-OS-ARCH % ...alternatively can be installed wherever you want $ make PREFIX=$HOME/.local install % ...or globally # make install $ aya }}} === Ideology Keep your texts in [https://en.wikipedia.org/wiki/Markdown Markdown], [https://github.com/eknkc/amber Amber], or [https://en.wikipedia.org/wiki/HTML HTML] right in the main directory of your blog or site.\\ Keep all service files (extensions, layout pages, deployment scripts, etc) in the {{{ .aya }}} subdirectory.\\ Define variables in the header of the content files using [https://yaml.org YAML]\\ {{{ --- title: Aya description: The fastest static site generator keywords: ayayaya --- Markdown text goes after a header *separator* }}} Use placeholders for variables and plugins in your Markdown or HTML files, e.g. {{{ {{ title }} }}} or {{{ {{ command arg1 arg2 }} }}}.\\ Write extensions in any language you like and put them into the {{{ .aya }}} subdirectory. Everything the extensions print to standard output becomes the value of the placeholder. Every variable from the content header will be passed via environment variables like `title` becomes {{{ $AYA_TITLE }}} and so on.\\ There are some special variables: * {{{ $AYA }}} -- path to the `aya` executable * {{{ $AYA_OUTDIR }}} -- a path to the directory with generated files * {{{ $AYA_FILE }}} -- a path to the currently processed markdown file * {{{ $AYA_URL }}} -- a URL for the currently generated page === Example of RSS/Atom feed generation 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: {{{ echo "Generating RSS feed" echo '' > $AYA_OUTDIR/blog/rss.xml echo '' >> $AYA_OUTDIR/blog/rss.xml echo '' >> $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 "$titlehttps://technicalmarisa.chaotic.ninja/blog/$url $descr$(gdate --date @$timestamp -R) https://technicalmarisa.chaotic.ninja/blog/$url" fi done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/blog/rss.xml echo '' >> $AYA_OUTDIR/blog/rss.xml echo '' >> $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: {{{ #!/bin/sh lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css rm -f $AYA_OUTDIR/styles.css }}} An alternative method of generating CSS is placing {{{ .gcss }}} files for [https://github.com/yosssi/gcss gcss] to process. === Command line usage See {{{ aya(1) }}} === License This software is distributed under the [https://git.chaotic.ninja/yakumo.izuru/aya/src/branch/master/LICENSE MIT/X11] license.