I thought I better document some of the things I have done to tweak MovableType for my weblog/journal. Let’s start with the archives.
I luckily ran across andersja’s blog piece called My Movable Type installation, and decided to change my archive structure before I had written too many entries.
MT defaults the name of an individual archive page as a non-descriptive, six-digit number, like 000024.html. The dirify property lets you rename your html document filename to the title of your weblog entry. For example, if the title of the entry is “Insert Name Here?”, the filename would be insert_name_here.html
. (Most special characters are ignored and spaces are converted into underscores.)
Next, I decided upon my archive types to be individual, category, and monthly. Since I plan to post only one, maybe two entries a day, the daily and weekly archive types seemed overkill. Later, I changed the monthly archive to resemble a calendar (thanks to dive into mark’s monthly archives), and changed the category archive to list entries by excerpts.
The next step was to change the directory structure of the archives. MT usually defaults to a single archive directory called “/archives/”. A prolific writer could easy post thousands of files into this one directory. The nature of a weblog or journal implies that everything is an archive except for the current entries on the main page. Why introduce an extra level in the directory structure? So, under Web Configuration/Core Setup, I set my Site URL and the Archive URL to the same thing, namely http://journal.cowpi.com/
.
I decided to divide my individual archive pages into categories instead of by date like most weblogs. I wanted my permanent links to an individual archive page to look like :
cowpi.com/journal/category/year/title_of_entry.html
(Note: the year level was added in order to prevent an enormous collection of files within one directory level, and hopefully avoiding duplicate entry titles.)
To accomplish this, under MT’s Web Configuration/Archiving, set the Archive File Template for Individual archives to:
<$MTEntryCategory dirify="1"$>/<$MTArchiveDate format="%Y"$>/<$MTEntryTitle dirify="1"$>.html
(Note: The above line should be entered as one long line with no line breaks.)
For my monthly archive pages, I wanted the links to look like:
cowpi.com/journal/2003/04.html
To accomplish this, under MT’s Web Configuration/Archiving, set the Archive File Template for Monthly archives to:
<$MTArchiveDate format="%Y/%m.html"$>
For my category archive pages, I wanted the links to look like:
cowpi.com/journal/category/index.html
To accomplish this, under MT’s Web Configuration/Archiving, set the Archive File Template for Category archives to:
<$MTArchiveCategory dirify="1"$>/index.html
To link to a any archive page, use the standard MT tags like <$MTEntryLink$>
or <$MTArchiveLink$>
.
Later, I used a little php in my Category archive pages, so I had to change the file extension .html
to .php
. Next, I wanted the link to a category archive page to look like:
cowpi.com/journal/category/
Note: Most servers will search inside this directory for a file called index
where the file extension could be .html
, .htm
, .php
, any other approved extension.
To accomplish this, any link to a category archive page from the main index page needs to be constructed from several pieces:
<a href="<$MTBlogURL$><$MTArchiveTitle dirify="1"$>/">
Well, that is all that I have done to the archives so far. I’m sure I will have to make modifications sometime in the future.
Update: See new archive structure