From 6dc678a75d7d6306d4e722de22f01f98f5626f86 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 31 Dec 2023 07:13:39 -0500 Subject: [PATCH] show brief in collection post --- journal/models/collection.py | 2 +- takahe/utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/journal/models/collection.py b/journal/models/collection.py index 9e209c3b..4018ce09 100644 --- a/journal/models/collection.py +++ b/journal/models/collection.py @@ -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) diff --git a/takahe/utils.py b/takahe/utils.py index 5c4ae8d8..4e948462 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -549,7 +549,9 @@ class Takahe: category = "收藏单" item_link = collection.absolute_url pre_conetent = f'{action_label}{category}《{collection.title}》
' - content = "" + content = collection.plain_content + if len(content) > 360: + content = content[:357] + "..." data = { "object": { # "tag": [item.ap_object_ref for item in collection.items],