show brief in collection post

This commit is contained in:
Your Name 2023-12-31 07:13:39 -05:00 committed by Henri Dickson
parent c7445f8f61
commit 6dc678a75d
2 changed files with 4 additions and 2 deletions

View file

@ -52,7 +52,7 @@ class Collection(List):
return html
@property
def plain_description(self):
def plain_content(self):
html = render_md(self.brief)
return _RE_HTML_TAG.sub(" ", html)

View file

@ -549,7 +549,9 @@ class Takahe:
category = "收藏单"
item_link = collection.absolute_url
pre_conetent = f'{action_label}{category}<a href="{item_link}">《{collection.title}》</a><br>'
content = ""
content = collection.plain_content
if len(content) > 360:
content = content[:357] + "..."
data = {
"object": {
# "tag": [item.ap_object_ref for item in collection.items],