Acrylamid is a command line application. That means you should have at least a clue how to open the terminal on your operation system (except for Windows).
To create a new blog, just run acrylamid init. You can choose between Mako and Jinja2 as templating languages. See also Commands for more details.
$ acrylamid init /path/to/blog/ create blog/theme/style.css create blog/theme/base.html create blog/theme/main.html create blog/theme/entry.html create blog/theme/articles.html create blog/theme/rss.xml create blog/theme/atom.xml create blog/content/sample-entry.txt Created your fresh new blog at 'blog'. Enjoy!
A new directory named tutorial has been created. Go into the directory and type ls -l
$ ls -l /path/to/blog/ total 4 -rw-r--r-- 1 ich 1452 Mai 23 19:48 conf.py drwxr-xr-x 3 ich 102 Mai 23 19:42 content/ drwxr-xr-x 8 ich 272 Mai 23 19:42 theme/
You can either fire up your editor and write an entry somewhere below content/ or run acrylamid new which will open your favourite editor save the entry to its permalink. BTW it does not matter how you name your file. It is only important, that it doesn’t contain binary in the first 512 bytes!
I’ll give you a short description of all available fields.
A date in the format your specified in your Configuration and several fallbacks you’ll find here: pelican/utils.py:21.
Acrylamid supports date time objects beginning from 01.01.1900, but keep in mind that datetimes before 1990 are not supported by python’s datetime API and the exact beginning may vary. I live in UTC+1 and can’t use the 1.1.1990 because it is actually 1899-12-31 at 23:00.
That is the default format of your articles. Similar to Jekyll:
---
title: Foo
date: 06/09/2012
---
With Acrylamid 0.4 you can also use the native metadata section provided by Markdown and reStructuredText. Both nativ formats are only active when you set METASTYLE = "native" in your Configuration and your filenames end with .rst or .rest for reStructuredText and .md or .mkdown for Markdown. Keep in mind, that the native metadata style only affects the parser. It does not set the filter to reST or Markdown.
reStructuredText:
Title
#####
:type: page
:tags: one, two
Here begins the body ...
Markdown:
date: 06/09/2012
title: Test
tags: [one, two]
Here starts my content ...
If you prefer reStructuredText or textile for a single entry or for your whole blog, set either (a filter can have different aliases, so reStructuredText or reST work both):
FILTERS = ['reStructuredText', ...] # or textile
or in your entry:
---
title: Hello World!
tags: [Hello World, Acrylamid]
filters: reST
---
Acrylamid_ is awesome!
.. _acrylamid: http://posativ.org/acrylamid/
The heart of Acrylamid. Generating the content. You can abbreviate acrylamid compile to acrylamid co if you like. gen and generate are aliases, too.
$ cd /path/to/blog/ $ acrylamid compile create [0.05s] output/articles/index.html create [0.37s] output/2012/die-verwandlung/index.html create [0.00s] output/index.html create [0.00s] output/tag/die-verwandlung/index.html create [0.00s] output/tag/franz-kafka/index.html create [0.03s] output/atom/index.html create [0.03s] output/rss/index.html create [0.00s] output/sitemap.xml create output/style.css 9 new, 0 updated, 0 skipped [0.63s]
You want to see incremental compilation in action? Then create a new entry and re-compile:
$ acrylamid new test $ acrylamid co update [0.02s] output/articles/index.html create [0.30s] output/2012/test/index.html update [0.00s] output/2012/die-verwandlung/index.html update [0.00s] output/index.html update [0.01s] output/atom/index.html update [0.01s] output/rss/index.html update [0.00s] output/sitemap.xml 1 new, 6 updated, 3 skipped [0.49s]
You’ll find all your theme files inside the (wait for it) theme directory. Most variables are explained in Templating and Views. Of you want to contribute your theme read Theming first.
$ ls theme/
articles.html atom.xml base.html entry.html main.html rss.xml
Note
Did you about the --mako flag that initializes all templates with a Mako analogon? Just create your blog like this: acrylamid init --mako. Unfortunately you can’t mix different tempating engines.
To edit a layout, just open and change something. Acrylamid automatically detects changes (even in parent templates) and re-renders the blog.
You can also apply a different templates to views, like so:
'/:year/:slug/': {
'view': 'entry',
'template': 'mytemplate.html'
}
Now you have your rendered HTML in your output directory, how do you deploy? First, Acrylamid does nothing for you but it provides a helper. You can add different deployment tasks in your conf.py and run them from Acrylamid. All what Acrylamid does is populating the shell environment with your configuration variables:
DEPLOYMENT = {
'blog': 'rsync -ruv $OUTPUT_DIR www@server:~/blog/'
}
You can run that task with acrylamid deploy TASK or even shorter acrylamid dp TASK. For more information, head over to deploy.
$ acrylamid deploy blog
execute rsync -av --delete output/ www@server:~/blog/
building file list ... done
sent 19701 bytes received 20 bytes 7888.40 bytes/sec
total size is 13017005 speedup is 660.06
Now, you know the basic usage of Acrylamid, you can go on with one of these topics: