mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Revert "Relativize URLs in summary as we do for content"
This reverts commit 5a993de400.
This commit is contained in:
parent
5a993de400
commit
8b36f90db9
2 changed files with 7 additions and 26 deletions
|
|
@ -85,8 +85,8 @@ class Page(object):
|
||||||
self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode('utf')
|
self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode('utf')
|
||||||
|
|
||||||
# manage summary
|
# manage summary
|
||||||
if not hasattr(self, '_summary'):
|
if not hasattr(self, 'summary'):
|
||||||
self._summary = property(lambda self: truncate_html_words(self.content, 50)).__get__(self, Page)
|
self.summary = property(lambda self: truncate_html_words(self.content, 50)).__get__(self, Page)
|
||||||
|
|
||||||
# manage status
|
# manage status
|
||||||
if not hasattr(self, 'status'):
|
if not hasattr(self, 'status'):
|
||||||
|
|
@ -106,15 +106,6 @@ class Page(object):
|
||||||
content = self._content
|
content = self._content
|
||||||
return content
|
return content
|
||||||
|
|
||||||
@property
|
|
||||||
def summary(self):
|
|
||||||
if hasattr(self, "_get_summary"):
|
|
||||||
summary = self._get_summary()
|
|
||||||
else:
|
|
||||||
summary = self._summary
|
|
||||||
return summary
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Article(Page):
|
class Article(Page):
|
||||||
mandatory_properties = ('title', 'date', 'category')
|
mandatory_properties = ('title', 'date', 'category')
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,7 @@ class Writer(object):
|
||||||
|
|
||||||
def __init__(self, output_path, settings=None):
|
def __init__(self, output_path, settings=None):
|
||||||
self.output_path = output_path
|
self.output_path = output_path
|
||||||
self.reminder_content = dict()
|
self.reminder = dict()
|
||||||
self.reminder_summary = dict()
|
|
||||||
self.settings = settings or {}
|
self.settings = settings or {}
|
||||||
|
|
||||||
def _create_new_feed(self, feed_type, context):
|
def _create_new_feed(self, feed_type, context):
|
||||||
|
|
@ -201,20 +200,11 @@ class Writer(object):
|
||||||
self.update_context_contents(name, item)
|
self.update_context_contents(name, item)
|
||||||
|
|
||||||
# if it is a content, patch it
|
# if it is a content, patch it
|
||||||
else:
|
elif hasattr(item, '_content'):
|
||||||
|
relative_path = get_relative_path(name)
|
||||||
if hasattr(item, '_content'):
|
|
||||||
relative_path = get_relative_path(name)
|
paths = self.reminder.setdefault(item, [])
|
||||||
paths = self.reminder_content.setdefault(item, [])
|
|
||||||
if relative_path not in paths:
|
if relative_path not in paths:
|
||||||
paths.append(relative_path)
|
paths.append(relative_path)
|
||||||
setattr(item, "_get_content",
|
setattr(item, "_get_content",
|
||||||
partial(_update_content, name, item))
|
partial(_update_content, name, item))
|
||||||
|
|
||||||
if hasattr(item, '_summary'):
|
|
||||||
relative_path = get_relative_path(name)
|
|
||||||
paths = self.reminder_summary.setdefault(item, [])
|
|
||||||
if relative_path not in paths:
|
|
||||||
paths.append(relative_path)
|
|
||||||
setattr(item, "_get_summary",
|
|
||||||
partial(_update_content, name, item))
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue