NAME
Plerd - Ultralight blogging with Markdown and Dropbox
DESCRIPTION
Plerd is a very lightweight system for writing and maintaining a blog based on Markdown files stored in a Dropbox-synced directory.
For instructions on installing and using Plerd, please see the README file that should have accompanied this distribution. It is also available online at https://github.com/jmacdotorg/plerd#plerd.
The remainder of this document describes method calls and other information specific to the Plerd object class. (If you are using Plerd to run a blog, you don't necessarily have to know any of this!)
CLASS METHODS
- new( \%config )
-
Object constructor. The single config hashref must include the following keys, each of which maps to the object attribute of the same name (see "OBJECT ATTRIBUTES").
path
title
base_uri
author_name
author_email
And, optional keys:
image
image_alt
twitter_id
recent_posts_maxsize Default value: 10
OBJECT ATTRIBUTES
Read-only attributes, set during construction
- base_uri
-
URI object representing the base URI for this blog, which the system will prepend to any absolute links it builds.
- image
-
(Optional) URI object representing this blog's default image, for use in social media metadata and such.
- image_alt
-
(Optional) A text description of this blog's default image, for use in social media metadata and such.
- path
-
The path to a filesystem directory within which Plerd will look for "source", "docroot", "templates", and "db" directories as needed, using those names exactly.
Caution: If this is not defined and any one of the previous three attributes is also undefined, then Plerd will die if you try to publish the blog.
- publication_path
-
The path to the filesystem directory containing this blog's output directory.
- source_path
-
The path to the filesystem directory containing this blog's source directory.
- template_path
-
The path to the filesystem directory containing this blog's templates directory.
- database_path
-
The path to the filesystem directory containing this blog's database directory.
-
The path to the filesystem directory containing this blog's out directory for tag index files.
- title
-
String representing this blog's title.
- twitter_id
-
(Optional) This Twitter username associated with this blog. Does not include the leading '@' character.
- recent_posts_maxsize
-
Integer representing the maximum size of the recent_posts array, which in turn defines how many posts (at most) appear on the blog's front page and syndication document.
Read-only attributes
- posts
-
An arrayref of Plerd::Post objects, representing all the blog's posts, in newest-to-oldest order. (Recency is determined by the dates manually set on the posts by the posts' author, not on their source files' modification time or whatever.)
- recent_posts
-
An arrayref of Plerd::Post objects, representing the most recent posts made to the blog, in newest-to-oldest order. (Recency is determined by the dates manually set on the posts by the posts' author, not on their source files' modification time or whatever.)
The size of the array is no larger than the current value of the Plerd object's
recent_posts_maxsize
attribute (and thus will be equal to that number for any blog whose total number of posts is greater than that number). - directory
-
A Path::Class::Dir object representation of the path provided via this object's
path
attribute. If said attribute is undefined, then this will return undef. - source_directory
-
A Path::Class::Dir object representation of the Dropbox-synced directory that holds the blog's Markdown-based source files.
- template_directory
-
A Path::Class::Dir object representation of the Dropbox-synced directory that holds the blog's Template Toolkit-based template files. (See also Template.)
- publication_directory
-
A Path::Class::Dir object representation of the Dropbox-synced directory that holds the blog's docroot -- in other words, the place Plerd will write HTML and XML files to.
- database_directory
-
A Path::Class::Dir object representation of the directory that holds the blogs's private, not-necessarily-human-readable data files.
-
A Path::Class::Dir object representation of the directory within the docroot that holds tag index HTML files.
- tag_index_uri
-
This is a URI object that points to the tag index. It is particularly helpful when creating navigation.
OBJECT METHODS
- publish_all
-
Publishes every Markdown file in the blog's source directory. Also recreates the recent, archive, and syndication files.
- post_with_url( $absolute_url )
-
Returns the Plerd::Post object that has the given absolute URL. Returns undef if there is no such post.
- tag_uri( $tag )
-
If $tag is defined, returns a URI object with the address of the web page for the given tag.
Otherwise, returns a URI object referring to the tag index page.
-
If the blog's posts declare any tags at all, then this returns true. Otherwise, returns false.
AUTHOR
Jason McIntosh <jmac@jmac.org>
CONTRIBUTORS
Petter Hassberg
Joe Johnston
Christian Sánchez
David Turner
Rebecca Turner