1
0
Fork 0
forked from github/pelican

Images support and add built files to gitignore

This commit is contained in:
Arnaud BOS 2010-12-30 14:11:37 +00:00 committed by Alexis Metaireau
commit 3ee595f927
11 changed files with 136 additions and 11 deletions

View file

@ -11,7 +11,7 @@ class Page(object):
mandatory_properties = ('title',)
def __init__(self, content, metadatas={}, settings={}, filename=None):
self.content = content
self._content = content
self.translations = []
self.status = "published" # default value
@ -53,6 +53,14 @@ class Page(object):
if not hasattr(self, prop):
raise NameError(prop)
@property
def content(self):
if hasattr(self, "_get_content"):
content = self._get_content()
else:
content = self._content
return content
@property
def summary(self):
return truncate_html_words(self.content, 50)