Changeset 56 in code


Ignore:
Timestamp:
Apr 9, 2023, 2:39:19 AM (2 years ago)
Author:
Izuru Yakumo
Message:

The fastest, period.

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
4 added
24 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r53 r56  
    33**.pub
    44
    5 /zs
     5/aya
    66/dist
    77/test.md
  • trunk/LICENSE

    r11 r56  
    22
    33Copyright (c) 2014 zserge
     4Copyright (c) 2023 Izuru Yakumo
    45
    56Permission is hereby granted, free of charge, to any person obtaining a copy
  • trunk/Makefile

    r55 r56  
    11destdir ?=
     2goflags ?= -v -ldflags "-w -X `go list`.Version=$(version) -X `go list`.Commit=$(commit)" -tags "static_build"
    23prefix ?= /usr/local
     4version ?= `git rev-list --count HEAD || echo "$version"`
     5commit ?= `git rev-parse --short HEAD || echo "$commit"`
     6
    37
    48build:
    5         go build -v
     9        go build ${goflags} ./cmd/aya
    610clean:
    7         rm -f zs
     11        rm -f aya
    812install:
    9         install -m0755 zs ${destdir}${prefix}/bin/zs
    10         install -m0644 zs.1 ${destdir}${prefix}/share/man/man1/zs.1
     13        install -Dm0755 aya ${destdir}${prefix}/bin/aya
     14        install -Dm0644 aya.1 ${destdir}${prefix}/share/man/man1/aya.1
    1115uninstall:
    12         rm -f ${prefix}/bin/zs
    13         rm -f ${prefix}/share/man/man1/zs.1
     16        rm -f ${prefix}/bin/aya
     17        rm -f ${prefix}/share/man/man1/aya.1
  • trunk/README.md

    r48 r56  
    1 # zs
     1# aya
    22
    3 zs is an extremely minimal static site generator written in Go.
     3aya is an extremely minimal static site generator written in Go.
    44
    5 It's inspired by `zas` generator, but is even more minimal.
    6 
    7 The name stands for 'zen static' as well as it's my initials.
     5This crow tengu stands for 'the fastest one in Gensokyo' and yes this is also a Touhou Project reference.
    86
    97## Features
     
    1816## Installation
    1917
    20 Download the binaries from Github or build it manually:
     18Build it manually assuming you have Go installed:
    2119
    22         $ go get git.mills.io/prologic/zs
     20        $ go install marisa.chaotic.ninja/aya@latest
    2321
    2422## Ideology
     
    2826
    2927Keep all service files (extensions, layout pages, deployment scripts etc)
    30 in the `.zs` subdirectory.
     28in the `.aya` subdirectory.
    3129
    3230Define variables in the header of the content files using [YAML]:
     
    4139files, e.g. `{{ title }}` or `{{ command arg1 arg2 }}.
    4240
    43 Write extensions in any language you like and put them into the `.zs`
     41Write extensions in any language you like and put them into the `.aya`
    4442subdiretory.
    4543
     
    4745placeholder.
    4846
    49 Every variable from the content header will be passed via environment variables like `title` becomes `$ZS_TITLE` and so on. There are some special variables:
     47Every variable from the content header will be passed via environment variables like `title` becomes `$AYA_TITLE` and so on. There are some special variables:
    5048
    51 * `$ZS` - a path to the `zs` executable
    52 * `$ZS_OUTDIR` - a path to the directory with generated files
    53 * `$ZS_FILE` - a path to the currently processed markdown file
    54 * `$ZS_URL` - a URL for the currently generated page
     49* `$AYA` - a path to the `aya` executable
     50* `$AYA_OUTDIR` - a path to the directory with generated files
     51* `$AYA_FILE` - a path to the currently processed markdown file
     52* `$AYA_URL` - a URL for the currently generated page
    5553
    5654## Example of RSS generation
     
    6058``` bash
    6159for f in ./blog/*.md ; do
    62         d=$($ZS var $f date)
     60        d=$($AYA var $f date)
    6361        if [ ! -z $d ] ; then
    6462                timestamp=`date --date "$d" +%s`
    65                 url=`$ZS var $f url`
    66                 title=`$ZS var $f title | tr A-Z a-z`
    67                 descr=`$ZS var $f description`
     63                url=`$AYA var $f url`
     64                title=`$AYA var $f title | tr A-Z a-z`
     65                descr=`$AYA var $f description`
    6866                echo $timestamp \
    6967                        "<item>" \
    7068                        "<title>$title</title>" \
    71                         "<link>http://zserge.com/$url</link>" \
     69                        "<link>http://ayaerge.com/$url</link>" \
    7270                        "<description>$descr</description>" \
    7371                        "<pubDate>$(date --date @$timestamp -R)</pubDate>" \
    74                         "<guid>http://zserge.com/$url</guid>" \
     72                        "<guid>http://ayaerge.com/$url</guid>" \
    7573                "</item>"
    7674        fi
     
    8482content generation, or additional commands, like LESS to CSS conversion:
    8583
    86         # .zs/post
     84        # .aya/post
    8785
    8886        #!/bin/sh
    89         lessc < $ZS_OUTDIR/styles.less > $ZS_OUTDIR/styles.css
    90         rm -f $ZS_OUTDIR/styles.css
     87        lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css
     88        rm -f $AYA_OUTDIR/styles.css
    9189
    9290## Command line usage
    9391
    94 `zs build` re-builds your site.
     92`aya build` re-builds your site.
    9593
    96 `zs build <file>` re-builds one file and prints resulting content to stdout.
     94`aya build <file>` re-builds one file and prints resulting content to stdout.
    9795
    98 `zs watch` rebuilds your site every time you modify any file.
     96`aya watch` rebuilds your site every time you modify any file.
    9997
    100 `zs var <filename> [var1 var2...]` prints a list of variables defined in the
     98`aya var <filename> [var1 var2...]` prints a list of variables defined in the
    10199header of a given markdown file, or the values of certain variables (even if
    102100it's an empty string).
  • trunk/go.mod

    r48 r56  
    1 module git.mills.io/prologic/zs
     1module marisa.chaotic.ninja/aya
    22
    33go 1.17
  • trunk/version.go

    r50 r56  
    1 package main
     1package aya
    22
    33import (
Note: See TracChangeset for help on using the changeset viewer.