support inline summary specification

update documentation

change summary cutoff to a plugin

remove backup file

fix 3.2 tests

update summary plugin initialization and documentation

update documentation

fix documentation formatting
This commit is contained in:
dave mankoff 2013-02-09 19:43:32 -05:00
commit 3f4406dd6b
5 changed files with 171 additions and 18 deletions

View file

@ -218,19 +218,14 @@ Note that, aside from the title, none of this metadata is mandatory: if the date
is not specified and DEFAULT_DATE is 'fs', Pelican will rely on the file's
"mtime" timestamp, and the category can be determined by the directory in which
the file resides. For example, a file located at ``python/foobar/myfoobar.rst``
will have a category of ``foobar``.
will have a category of ``foobar``. If you would like to organize your files in
other ways where the name of the subfolder would not be a good category name,
you can set the setting ``USE_FOLDER_AS_CATEGORY`` to ``False``.
Note that, aside from the title and date, none of this metadata is mandatory.
If the date is not specified and you have ``DEFAULT_DATE`` set, Pelican will
use that instead, making the ``date`` metadata attribute optional. The category
can be determined by the directory in which the file resides. For example, a
file located at ``python/foobar/myfoobar.rst`` will have a category of
``foobar``. If you would like to organize your files in other ways where the
name of the subfolder would not be a good category name, you can set the
setting ``USE_FOLDER_AS_CATEGORY`` to ``False``. If there is no summary
metadata for a given post, the ``SUMMARY_MAX_LENGTH`` setting can be used to
specify how many words from the beginning of an article are used as the
summary.
If there is no summary metadata for a given post, the ``SUMMARY_MAX_LENGTH``
setting can be used to specify how many words from the beginning of an article
are used as the summary. Summaries can also be specified inline with the body
using the :ref:`Summary Plugin <plugin-summary>`.
You can also extract any metadata from the filename through a regular
expression to be set in the ``FILENAME_METADATA`` setting.

View file

@ -111,6 +111,7 @@ The following plugins are currently included with Pelican:
* `HTML tags for reStructuredText`_ ``pelican.plugins.html_rst_directive``
* `Related posts`_ ``pelican.plugins.related_posts``
* `Sitemap`_ ``pelican.plugins.sitemap``
* `Summary`_ ``pelican.plugins.summary``
Ideas for plugins that haven't been written yet:
@ -371,3 +372,34 @@ Here is an example configuration (it's also the default settings):
'pages': 'monthly'
}
}
.. _plugin-summary:
Summary
-------------
This plugin allows easy, variable length summaries directly embedded into the
body of your articles. It introduces two new settings: ``SUMMARY_BEGIN_MARKER``
and ``SUMMARY_END_MARKER``: strings which can be placed directly into an article
to mark the beginning and end of a summary. When found, the standard
``SUMMARY_MAX_LENGTH`` setting will be ignored. The markers themselves will also
be removed from your articles before they are published. The default values
are ``<!-- PELICAN_BEGIN_SUMMARY -->`` and ``<!-- PELICAN_END_SUMMARY -->``.
For example::
Title: My super title
Date: 2010-12-03 10:20
Tags: thats, awesome
Category: yeah
Slug: my-super-post
Author: Alexis Metaireau
This is the content of my super blog post.
<!-- PELICAN_END_SUMMARY -->
and this content occurs after the summary.
Here, the summary is taken to be the first line of the post. Because no
beginning marker was found, it starts at the top of the body. It is possible
to leave out the end marker instead, in which case the summary will start at the
beginning marker and continue to the end of the body.