Weblog Mode |
Contents |
Macros
{@blogmax.el} works by substituting your text files into
templates that you define. It looks in the directory
containing the text file for the template and then in each
parent directory until it finds it. Most sites will just
have one template in the main directory, but you don't have
to do it that way. And you can also have two different sites
that share some templates by making their root directories
both children of a directory containing the templates.
You control the substitution with
macros, some of which look up shortcuts, some of which
pull in file content, and some of which report certain
information about the current file or your blog as a
whole. You can also use the full power of Emacs Lisp in a
macro.
There are four templates:
- The page template:
page-template.tmpl
This is the top-level template. Rendering of every page
starts with the contents of this template.
- The content template:
content-template.tmpl
This template is
substituted for the \{contentTemplate} macro on daily blog
pages, pages that are in your site's root directory.
- The story template:
story-template.tmpl
This template is substituted for the \{contentTemplate}
macro on story pages, pages that are in a sub-directory of
your site's root direectory.
- The day template:
day-template.tmpl
This template is substituted for the \{dayTemplate} macro.
Here's the page-template.tmpl file for this site. Note the \{txtLink}
macro near the end of the file. That generates a link to the text file
containing the page's contents. This allows you to easily get to the
contents of each page in this site.
{include "../page-template.tmpl" t t}
Here's the story-template.tmpl file for this site. This
replaces \{contentTemplate} in the text above.
{include "../story-template.tmpl" t t}
Here's the file
templates.txt that provides the content for this
page. This replaces \{storyContent} in the text above.
{include "templates.txt" t t}
Weblog Mode |
Contents |
Macros