Changeset 56 in code
- Timestamp:
- Apr 9, 2023, 2:39:19 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 24 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r53 r56 3 3 **.pub 4 4 5 / zs5 /aya 6 6 /dist 7 7 /test.md -
trunk/LICENSE
r11 r56 2 2 3 3 Copyright (c) 2014 zserge 4 Copyright (c) 2023 Izuru Yakumo 4 5 5 6 Permission is hereby granted, free of charge, to any person obtaining a copy -
trunk/Makefile
r55 r56 1 1 destdir ?= 2 goflags ?= -v -ldflags "-w -X `go list`.Version=$(version) -X `go list`.Commit=$(commit)" -tags "static_build" 2 3 prefix ?= /usr/local 4 version ?= `git rev-list --count HEAD || echo "$version"` 5 commit ?= `git rev-parse --short HEAD || echo "$commit"` 6 3 7 4 8 build: 5 go build -v9 go build ${goflags} ./cmd/aya 6 10 clean: 7 rm -f zs11 rm -f aya 8 12 install: 9 install - m0755 zs ${destdir}${prefix}/bin/zs10 install - m0644 zs.1 ${destdir}${prefix}/share/man/man1/zs.113 install -Dm0755 aya ${destdir}${prefix}/bin/aya 14 install -Dm0644 aya.1 ${destdir}${prefix}/share/man/man1/aya.1 11 15 uninstall: 12 rm -f ${prefix}/bin/ zs13 rm -f ${prefix}/share/man/man1/ zs.116 rm -f ${prefix}/bin/aya 17 rm -f ${prefix}/share/man/man1/aya.1 -
trunk/README.md
r48 r56 1 # zs1 # aya 2 2 3 zsis an extremely minimal static site generator written in Go.3 aya is an extremely minimal static site generator written in Go. 4 4 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. 5 This crow tengu stands for 'the fastest one in Gensokyo' and yes this is also a Touhou Project reference. 8 6 9 7 ## Features … … 18 16 ## Installation 19 17 20 Download the binaries from Github or build it manually:18 Build it manually assuming you have Go installed: 21 19 22 $ go get git.mills.io/prologic/zs20 $ go install marisa.chaotic.ninja/aya@latest 23 21 24 22 ## Ideology … … 28 26 29 27 Keep all service files (extensions, layout pages, deployment scripts etc) 30 in the `. zs` subdirectory.28 in the `.aya` subdirectory. 31 29 32 30 Define variables in the header of the content files using [YAML]: … … 41 39 files, e.g. `{{ title }}` or `{{ command arg1 arg2 }}. 42 40 43 Write extensions in any language you like and put them into the `. zs`41 Write extensions in any language you like and put them into the `.aya` 44 42 subdiretory. 45 43 … … 47 45 placeholder. 48 46 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:47 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: 50 48 51 * `$ ZS` - a path to the `zs` executable52 * `$ ZS_OUTDIR` - a path to the directory with generated files53 * `$ ZS_FILE` - a path to the currently processed markdown file54 * `$ ZS_URL` - a URL for the currently generated page49 * `$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 55 53 56 54 ## Example of RSS generation … … 60 58 ``` bash 61 59 for f in ./blog/*.md ; do 62 d=$($ ZSvar $f date)60 d=$($AYA var $f date) 63 61 if [ ! -z $d ] ; then 64 62 timestamp=`date --date "$d" +%s` 65 url=`$ ZSvar $f url`66 title=`$ ZSvar $f title | tr A-Z a-z`67 descr=`$ ZSvar $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` 68 66 echo $timestamp \ 69 67 "<item>" \ 70 68 "<title>$title</title>" \ 71 "<link>http:// zserge.com/$url</link>" \69 "<link>http://ayaerge.com/$url</link>" \ 72 70 "<description>$descr</description>" \ 73 71 "<pubDate>$(date --date @$timestamp -R)</pubDate>" \ 74 "<guid>http:// zserge.com/$url</guid>" \72 "<guid>http://ayaerge.com/$url</guid>" \ 75 73 "</item>" 76 74 fi … … 84 82 content generation, or additional commands, like LESS to CSS conversion: 85 83 86 # . zs/post84 # .aya/post 87 85 88 86 #!/bin/sh 89 lessc < $ ZS_OUTDIR/styles.less > $ZS_OUTDIR/styles.css90 rm -f $ ZS_OUTDIR/styles.css87 lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css 88 rm -f $AYA_OUTDIR/styles.css 91 89 92 90 ## Command line usage 93 91 94 ` zsbuild` re-builds your site.92 `aya build` re-builds your site. 95 93 96 ` zsbuild <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. 97 95 98 ` zswatch` rebuilds your site every time you modify any file.96 `aya watch` rebuilds your site every time you modify any file. 99 97 100 ` zsvar <filename> [var1 var2...]` prints a list of variables defined in the98 `aya var <filename> [var1 var2...]` prints a list of variables defined in the 101 99 header of a given markdown file, or the values of certain variables (even if 102 100 it's an empty string). -
trunk/go.mod
r48 r56 1 module git.mills.io/prologic/zs1 module marisa.chaotic.ninja/aya 2 2 3 3 go 1.17 -
trunk/version.go
r50 r56 1 package main1 package aya 2 2 3 3 import (
Note:
See TracChangeset
for help on using the changeset viewer.