forked from github/pelican
Images support and add built files to gitignore
This commit is contained in:
parent
5af56793eb
commit
3ee595f927
11 changed files with 136 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue