mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add a setup.py for packaging :)
--HG-- rename : pelican/pelican => bin/pelican rename : pelican/themes/archives.html => pelican/themes/templates/archives.html rename : pelican/themes/article.html => pelican/themes/templates/article.html rename : pelican/themes/base.html => pelican/themes/templates/base.html rename : pelican/themes/categories.html => pelican/themes/templates/categories.html rename : pelican/themes/category.html => pelican/themes/templates/category.html rename : pelican/themes/index.html => pelican/themes/templates/index.html rename : pelican/themes/tag.html => pelican/themes/templates/tag.html rename : pelican/themes/tags.html => pelican/themes/templates/tags.html
This commit is contained in:
parent
75821fb644
commit
ebd906cd4b
22 changed files with 123 additions and 104 deletions
1
TODO
1
TODO
|
|
@ -1 +0,0 @@
|
||||||
* package it !
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
#!/usr/local/bin/python2.7
|
#!/usr/local/bin/python2.7
|
||||||
from generator import generate_output
|
from pelican.generator import generate_output
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="""Generate files, given some
|
parser = argparse.ArgumentParser(description="""A tool to generate a
|
||||||
files to read and a template to use.
|
static blog, with restructured text input files.""")
|
||||||
|
|
||||||
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.add_argument('-p', '--path', dest='path',
|
parser.add_argument('-p', '--path', dest='path',
|
||||||
help='Path where to find the content files (default is "content").')
|
help='Path where to find the content files (default is "content").')
|
||||||
|
|
@ -23,7 +23,10 @@ _DEFAULT_CONFIG = {'PATH': None,
|
||||||
'OUTPUT_PATH': 'output/',
|
'OUTPUT_PATH': 'output/',
|
||||||
'MARKUP': 'rst',
|
'MARKUP': 'rst',
|
||||||
'STATIC_PATHS': ['css', 'images'],
|
'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,
|
def generate_output(path=None, theme=None, output_path=None, markup=None,
|
||||||
settings=None):
|
settings=None):
|
||||||
|
|
@ -92,13 +95,13 @@ def generate_output(path=None, theme=None, output_path=None, markup=None,
|
||||||
title=context['BLOGNAME'],
|
title=context['BLOGNAME'],
|
||||||
link=context['BLOGURL'],
|
link=context['BLOGURL'],
|
||||||
feed_url='%s/%s' % (context['BLOGURL'], context['FEED_FILENAME']),
|
feed_url='%s/%s' % (context['BLOGURL'], context['FEED_FILENAME']),
|
||||||
description=context['BLOGSUBTITLE'])
|
description=context.get('BLOGSUBTITLE', ''))
|
||||||
for article in articles:
|
for article in articles:
|
||||||
feed.add_item(
|
feed.add_item(
|
||||||
title=article.title,
|
title=article.title,
|
||||||
link='%s/%s' % (context['BLOGURL'], article.url),
|
link='%s/%s' % (context['BLOGURL'], article.url),
|
||||||
description=article.content,
|
description=article.content,
|
||||||
author_name=article.author,
|
author_name=getattr(article, 'author', 'John Doe'),
|
||||||
pubdate=article.date)
|
pubdate=article.date)
|
||||||
|
|
||||||
fp = open(os.path.join(output_path, context['FEED_FILENAME']), 'w')
|
fp = open(os.path.join(output_path, context['FEED_FILENAME']), 'w')
|
||||||
|
|
|
||||||
0
pelican/themes/templates/tags.html
Normal file
0
pelican/themes/templates/tags.html
Normal file
21
setup.py
Normal file
21
setup.py
Normal file
|
|
@ -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',
|
||||||
|
],
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue