| 7 | | All aspects of Trac have been designed with the single goal to |
| 8 | | '''help developers write great software''' while '''staying out of the way''' |
| 9 | | and imposing as little as possible on a team's established process and |
| 10 | | culture. |
| 11 | | |
| 12 | | As all Wiki pages, this page is editable, this means that you can |
| 13 | | modify the contents of this page simply by using your |
| 14 | | web-browser. Simply click on the "Edit this page" link at the bottom |
| 15 | | of the page. WikiFormatting will give you a detailed description of |
| 16 | | available Wiki formatting commands. |
| 17 | | |
| 18 | | "[wiki:TracAdmin trac-admin] ''yourenvdir'' initenv" created |
| 19 | | a new Trac environment, containing a default set of wiki pages and some sample |
| 20 | | data. This newly created environment also contains |
| 21 | | [wiki:TracGuide documentation] to help you get started with your project. |
| 22 | | |
| 23 | | You can use [wiki:TracAdmin trac-admin] to configure |
| 24 | | [http://trac.edgewall.org/ Trac] to better fit your project, especially in |
| 25 | | regard to ''components'', ''versions'' and ''milestones''. |
| | 5 | 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]. |
| 35 | | * TracGuide -- Built-in Documentation |
| 36 | | * [http://trac.edgewall.org/ The Trac project] -- Trac Open Source Project |
| 37 | | * [http://trac.edgewall.org/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions |
| 38 | | * TracSupport -- Trac Support |
| | 30 | === Ideology |
| | 31 | 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.\\ |
| | 32 | Keep all service files (extensions, layout pages, deployment scripts, etc) in the {{{ .aya }}} subdirectory.\\ |
| | 33 | Define variables in the header of the content files using [https://yaml.org YAML]\\ |
| 40 | | For a complete list of local wiki pages, see TitleIndex. |
| | 35 | {{{ |
| | 36 | --- |
| | 37 | title: Aya |
| | 38 | description: The fastest static site generator |
| | 39 | keywords: ayayaya |
| | 40 | --- |
| | 41 | |
| | 42 | Markdown text goes after a header *separator* |
| | 43 | }}} |
| | 44 | |
| | 45 | Use placeholders for variables and plugins in your Markdown or HTML files, e.g. {{{ {{ title }} }}} or {{{ {{ command arg1 arg2 }} }}}.\\ |
| | 46 | Write extensions in any language you like and put them into the {{{ .aya }}} subdirectory. |
| | 47 | |
| | 48 | Everything the extensions print to standard output becomes the value of the placeholder. |
| | 49 | |
| | 50 | Every variable from the content header will be passed via environment variables like `title` becomes {{{ $AYA_TITLE }}} and so on.\\ |
| | 51 | There are some special variables: |
| | 52 | |
| | 53 | * {{{ $AYA }}} -- path to the `aya` executable |
| | 54 | * {{{ $AYA_OUTDIR }}} -- a path to the directory with generated files |
| | 55 | * {{{ $AYA_FILE }}} -- a path to the currently processed markdown file |
| | 56 | * {{{ $AYA_URL }}} -- a URL for the currently generated page |
| | 57 | |
| | 58 | === Example of RSS/Atom feed generation |
| | 59 | Extensions can be written in any language you know (Bash, Python, Lua, JavaScript, Go, even Assembler). |
| | 60 | Here's an example of how to scan all markdown blog posts and create RSS items: |
| | 61 | |
| | 62 | {{{ |
| | 63 | echo "Generating RSS feed" |
| | 64 | |
| | 65 | echo '<?xml version="1.0" encoding="utf-8"?>' > $AYA_OUTDIR/blog/rss.xml |
| | 66 | echo '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $AYA_OUTDIR/blog/rss.xml |
| | 67 | echo '<channel>' >> $AYA_OUTDIR/blog/rss.xml |
| | 68 | for f in ./blog/*/*.md ; do |
| | 69 | d=$($AYA var $f date) |
| | 70 | if [ ! -z $d ] ; then |
| | 71 | timestamp=`gdate --date "$d" +%s` |
| | 72 | url=`$AYA var $f url` |
| | 73 | title=`$AYA var $f title | tr A-Z a-z` |
| | 74 | descr=`$AYA var $f description` |
| | 75 | echo $timestamp "<item><title>$title</title><link>https://technicalmarisa.chaotic.ninja/blog/$url</link> |
| | 76 | <description>$descr</description><pubDate>$(gdate --date @$timestamp -R)</pubDate> |
| | 77 | <guid>https://technicalmarisa.chaotic.ninja/blog/$url</guid></item>" |
| | 78 | fi |
| | 79 | done | sort -r -n | cut -d' ' -f2- >> $AYA_OUTDIR/blog/rss.xml |
| | 80 | echo '</channel>' >> $AYA_OUTDIR/blog/rss.xml |
| | 81 | echo '</rss>' >> $AYA_OUTDIR/blog/rss.xml |
| | 82 | }}} |
| | 83 | |
| | 84 | === Hooks |
| | 85 | There are two special plugin names that are executed every time the build happens - {{{ prehook }}} and {{{ posthook }}}.\\ |
| | 86 | You can define some global actions here like content generation, or additional commands, like LESS to CSS conversion: |
| | 87 | |
| | 88 | {{{ |
| | 89 | #!/bin/sh |
| | 90 | lessc < $AYA_OUTDIR/styles.less > $AYA_OUTDIR/styles.css |
| | 91 | rm -f $AYA_OUTDIR/styles.css |
| | 92 | }}} |
| | 93 | |
| | 94 | An alternative method of generating CSS is placing {{{ .gcss }}} files for [https://github.com/yosssi/gcss gcss] to process. |
| | 95 | |
| | 96 | === Command line usage |
| | 97 | See {{{ aya(1) }}} |
| | 98 | |
| | 99 | === License |
| | 100 | This software is distributed under the [https://git.chaotic.ninja/yakumo.izuru/aya/src/branch/master/LICENSE MIT/X11] license. |