Skip to content
App for creating static resume-like pages with dynamic interactivity.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


# AYM CMS Readme

The AYM CMS is a simple static CMS system built on top
of [Django][1] templates, and a 76 line Python build script.

You can use all the default Django template filters and tags,
and AYM CMS has a couple of custom tags to facilitate
handling static content more intelligently.


### Prerequisites

AYM makes use of a handful of Python libraries:

1.  Django
2.  Python-Markdown
3.  PIL
4.  Pygments

All of those libraries should be an easy_install away:

    sudo easy_install django
    sudo easy_install markdown
    sudo easy_install PIL
    sudo easy_install Pygments

### Installation

If you have the folder containing this README file, then
AYM CMS is already installed.

### Usage

Unzip/download the AYM CMS project folder. Then type


to build the current website to the ``deploy/`` directory.

### Adding Pages to your CMS

Adding a page to your cms is a two step affair:

1.  Create a template within the ``templates/`` directory.
     You can take advantage of template inheritance and all
     the normal Django templates goodies to do so.

2. Add the template's name to ``PAGES_TO_RENDER`` in
    your ```` file.

You may create templates in subfolders of ``templates/``,
but be sure that the template string you give to ``PAGES_TO_RENDER``
reflects that.

For example, you might create the ``charts`` subfolder in ``templates/``,
so that its path is ``templates/charts/``. If you create a template named
``line_chart.html``, then you would update ``PAGES_TO_RENDER`` to look
like this:


AKA, it works exactly the same way that Django does.

### Adding Static Content to your CMS

All content within the ``static/`` directory will be copied over
into the ``deploy/static/`` directory when you run the build

The script will preserve subfolders as well, so simply arrange
things to your liking in the ``static/`` folder and you'll be
good to go.

### Adding Images to Project

Add any images you want to the ``images/`` folder, and AYM
CMS will automatically create thumbnails and copy them into a
subfolder of the ``deploy/static`` folder when you run the build

You can access these images within your templates in two ways.
First, the ``images`` template context is a list of your images
which can can use as follows:

    {% for image in images %}
    <a href="{{ image.image }}">
        <img src="{{ image.thumbnail }}" alt="{{ image.filename }}">
    {% endfor %}

Second, you may refer to images by name via the ``images_dict``
context variable. If you added the ``crazy_cats.png`` image to
your ``images/`` directory, you could then refer to it like this:

    <img src="{{ images_dict.crazy_cats.image }}">

And thats really all there is to it.

### AYM Template Tags

At this time there are two custom template tags included
in the AYM CMS project: ``markdown`` and ``syntax``.

``markdown`` renders the enclosed text as Markdown markup.
It is used as follows:

    {% load aym %}
    <p> I love templates. </p>
    {% markdown %}
    Render this **content all in Markdown**.

    >> Writing in Markdown is quicker than
    >> writing in HTML.

    1.  Or at least that is my opinion.
    2.  What about you?
    {% endmarkdown %}

``syntax`` uses Pygments to render the enclosed text with
a code syntax highlighter. Usage is:

    {% load aym %}
    <p> blah blah blah </p>
    {% syntax objc %}
    [obj addObject:[NSNumber numberWithInt:53]];
    return [obj autorelease];
    {% endsyntax %}

They are both intended to make writing static content
quicker and less painful.
You can’t perform that action at this time.