yakumo.izuru / aya

Go (97.08%)
Other (1.44%)
Assembly (1.01%)
Shell (0.33%)
Markdown (0.09%)
C (0.02%)
Makefile (0.01%)
Python (0.01%)

.gitignore

The fastest, period. Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-04-08T23:39:19-03:00

LICENSE

The fastest, period. Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-04-08T23:39:19-03:00

Makefile

Use vendored modules Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-07-23T10:18:53-03:00

README.md

Add support for bfchroma syntax highlighting Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-05-08T18:10:36-03:00

aya.1

Add a clean subcommand Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-04-29T01:37:22-03:00

cmd

Use vendored modules Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-07-23T10:18:53-03:00

go.mod

Use vendored modules Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-07-23T10:18:53-03:00

go.sum

Use vendored modules Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-07-23T10:18:53-03:00

vendor

Use vendored modules Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-07-23T10:18:53-03:00

version.go

The fastest, period. Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

2023-04-08T23:39:19-03:00

aya

aya is an extremely minimal static site generator written in Go.

Named after Aya Shameimaru from Touhou 9.5: Shoot the Bullet

Features

  • Zero configuration (no configuration file needed)
  • Cross-platform
  • Highly extensible
  • Works well for blogs and generic static websites (landing pages etc)
  • Easy to learn
  • Code highlighting with bfchroma
  • 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
of your blog/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 [YAML]:

title: My web site
keywords: best website, hello, world
---

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
subdiretory.

Everything the extensions prints to stdout 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 - a 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 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:

#!/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

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:

# .aya/post

#!/bin/sh
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 yosssi/gcss

Command line usage

aya build re-builds your site.

aya build <file> re-builds one file and prints resulting content to stdout.

aya serve serves your site over HTTP.

aya var <filename> [var1 var2...] prints a list of variables defined in the
header of a given markdown file, or the values of certain variables (even if
it's an empty string).

aya watch rebuilds your site every time you modify any file.

License

The software is distributed under the MIT license.

The MIT License (MIT)

Copyright (c) 2014 zserge
Copyright (c) 2023 Izuru Yakumo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

クローン


このレポジトリについて

The fastest static site generator

0

1

0


最終コミット

Use vendored modules Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
2023-07-23T10:18:53-03:00

リリース

作成中・・・

寄付

作成中・・・