diff --git a/TODO b/TODO index 6dc060e7..e69de29b 100644 --- a/TODO +++ b/TODO @@ -1 +0,0 @@ -* package it ! diff --git a/pelican/pelican b/bin/pelican similarity index 77% rename from pelican/pelican rename to bin/pelican index ff3a067d..98e9a64c 100755 --- a/pelican/pelican +++ b/bin/pelican @@ -1,13 +1,9 @@ #!/usr/local/bin/python2.7 -from generator import generate_output +from pelican.generator import generate_output import argparse -import os -parser = argparse.ArgumentParser(description="""Generate files, given some -files to read and a template to use. - -The main use case is to generate static-files-based blogs, to ease DVCSes as -storages, but it could be used with others goal in mind.""") +parser = argparse.ArgumentParser(description="""A tool to generate a +static blog, with restructured text input files.""") parser.add_argument('-p', '--path', dest='path', help='Path where to find the content files (default is "content").') diff --git a/pelican/themes/categories.html b/pelican/__init__.py similarity index 100% rename from pelican/themes/categories.html rename to pelican/__init__.py diff --git a/pelican/generator.py b/pelican/generator.py index aa441287..df236efa 100644 --- a/pelican/generator.py +++ b/pelican/generator.py @@ -23,7 +23,10 @@ _DEFAULT_CONFIG = {'PATH': None, 'OUTPUT_PATH': 'output/', 'MARKUP': 'rst', 'STATIC_PATHS': ['css', 'images'], - 'FEED_FILENAME': 'atom.xml'} + 'FEED_FILENAME': 'atom.xml', + 'BLOGNAME': 'A Pelican Blog', + 'BLOGURL': ''} + def generate_output(path=None, theme=None, output_path=None, markup=None, settings=None): @@ -92,13 +95,13 @@ def generate_output(path=None, theme=None, output_path=None, markup=None, title=context['BLOGNAME'], link=context['BLOGURL'], feed_url='%s/%s' % (context['BLOGURL'], context['FEED_FILENAME']), - description=context['BLOGSUBTITLE']) + description=context.get('BLOGSUBTITLE', '')) for article in articles: feed.add_item( title=article.title, link='%s/%s' % (context['BLOGURL'], article.url), description=article.content, - author_name=article.author, + author_name=getattr(article, 'author', 'John Doe'), pubdate=article.date) fp = open(os.path.join(output_path, context['FEED_FILENAME']), 'w') diff --git a/pelican/themes/archives.html b/pelican/themes/templates/archives.html similarity index 100% rename from pelican/themes/archives.html rename to pelican/themes/templates/archives.html diff --git a/pelican/themes/article.html b/pelican/themes/templates/article.html similarity index 100% rename from pelican/themes/article.html rename to pelican/themes/templates/article.html diff --git a/pelican/themes/base.html b/pelican/themes/templates/base.html similarity index 100% rename from pelican/themes/base.html rename to pelican/themes/templates/base.html diff --git a/pelican/themes/category.html b/pelican/themes/templates/categories.html similarity index 100% rename from pelican/themes/category.html rename to pelican/themes/templates/categories.html diff --git a/pelican/themes/tag.html b/pelican/themes/templates/category.html similarity index 100% rename from pelican/themes/tag.html rename to pelican/themes/templates/category.html diff --git a/pelican/themes/index.html b/pelican/themes/templates/index.html similarity index 100% rename from pelican/themes/index.html rename to pelican/themes/templates/index.html diff --git a/pelican/themes/tags.html b/pelican/themes/templates/tag.html similarity index 100% rename from pelican/themes/tags.html rename to pelican/themes/templates/tag.html diff --git a/pelican/themes/templates/tags.html b/pelican/themes/templates/tags.html new file mode 100644 index 00000000..e69de29b diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..d1459b08 --- /dev/null +++ b/setup.py @@ -0,0 +1,21 @@ +from distutils.core import setup + +setup( + name = "pelican", + version = '1.0', + url = 'http://hg.lolnet.org/pelican/', + author = 'Alexis Metaireau', + author_email = 'alexis@notmyidea.org', + description = "A tool to generate a static blog, with restructured text input files.", + packages = ['pelican'], + package_data = {'pelican': ['themes/templates/*']}, + scripts = ['bin/pelican'], + classifiers = ['Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'License :: OSI Approved :: GNU Affero General Public License v3', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], +)