Changeset 65 in code for trunk


Ignore:
Timestamp:
May 7, 2023, 1:59:02 PM (2 years ago)
Author:
Izuru Yakumo
Message:

Update documentation

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/README.md

    r61 r65  
    33aya is an extremely minimal static site generator written in Go.
    44
    5 This crow tengu stands for 'the fastest one in Gensokyo' and yes this is also a Touhou Project reference.
     5Named 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)
    66
    77## Features
     
    1212* Works well for blogs and generic static websites (landing pages etc)
    1313* Easy to learn
    14 * Fast
     14* Fast (duh!)
    1515
    1616## Installation
     
    1919
    2020        $ go install marisa.chaotic.ninja/aya/cmd/aya@latest
    21 
     21        --- or ---
     22        $ git clone https://git.chaotic.ninja/yakumo.izuru/aya
     23        $ cd aya
     24        $ make
     25        # make install
     26       
    2227## Ideology
    2328
     
    5762
    5863``` bash
    59 for f in ./blog/*.md ; do
    60         d=$($AYA var $f date)
    61         if [ ! -z $d ] ; then
    62                 timestamp=`date --date "$d" +%s`
    63                 url=`$AYA var $f url`
    64                 title=`$AYA var $f title | tr A-Z a-z`
    65                 descr=`$AYA var $f description`
    66                 echo $timestamp \
    67                         "<item>" \
    68                         "<title>$title</title>" \
    69                         "<link>http://zserge.com/$url</link>" \
    70                         "<description>$descr</description>" \
    71                         "<pubDate>$(date --date @$timestamp -R)</pubDate>" \
    72                         "<guid>http://zserge.com/$url</guid>" \
    73                 "</item>"
    74         fi
    75 done | sort -r -n | cut -d' ' -f2-
     64#!/bin/sh
     65echo "Generating RSS feed"
     66
     67echo '<?xml version="1.0" encoding="utf-8"?>' > $AYA_OUTDIR/blog/rss.xml
     68echo '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $AYA_OUTDIR/blog/rss.xml
     69echo '<channel>' >> $AYA_OUTDIR/blog/rss.xml
     70for f in ./blog/*/*.md ; do
     71    d=$($AYA var $f date)
     72    if [ ! -z $d ] ; then
     73        timestamp=`gdate --date "$d" +%s`
     74        url=`$AYA var $f url`
     75        title=`$AYA var $f title | tr A-Z a-z`
     76        descr=`$AYA var $f description`
     77        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>"
     78    fi
     79done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/blog/rss.xml
     80echo '</channel>' >> $AYA_OUTDIR/blog/rss.xml
     81echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml
    7682```
    7783
     
    8793        lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css
    8894        rm -f $AYA_OUTDIR/styles.css
     95
     96## Extras
     97
     98`aya` also supports generating `.html` and `.css` by means of using `.amber`
     99and `.gcss` files. See more at [eknkc/amber](https://github.com/eknkc/amber) [yosssi/gcss](https://github.com/yosssi/gcss)
    89100
    90101## Command line usage
  • trunk/cmd/aya/main.go

    r64 r65  
    1 // $TheSupernovaDuo: cmd/aya/main.go,v 0.5.x 2023/4/26 8:49:6 yakumo_izuru Exp $
     1// $TheSupernovaDuo: cmd/aya/main.go,v 0.5.x 2023/5/7 10:57:10 yakumo_izuru Exp $
    22package main
    33
     
    301301        return err
    302302}
    303 
     303// This function passes the files to build to their corresponding functions
    304304func build(path string, w io.Writer, vars Vars) error {
    305305        ext := filepath.Ext(path)
     
    368368        log.Fatal(http.ListenAndServe(":8000", nil))
    369369}
    370 
     370// Initialize the environment
    371371func init() {
    372372        // prepend .aya to $PATH, so plugins will be found before OS commands
     
    375375        os.Setenv("PATH", p)
    376376}
    377 
     377// Print usage notes
    378378func printUsage() {
    379379        fmt.Printf("%v <command> [args]\n", os.Args[0])
Note: See TracChangeset for help on using the changeset viewer.