diff --git a/example_config.json b/example_config.json index 030f620..0fb8862 100644 --- a/example_config.json +++ b/example_config.json @@ -5,7 +5,8 @@ "title": "Thoughts", "description": "Hand-picked public posts from my social feed", "server": "https://social.ayco.io", - "user_id": "0123456789" + "user_id": "0123456789", + "max_summary_length": 100 } }, "ATTRIBUTION": { diff --git a/threads.py b/threads.py index 6b4ac1b..a254349 100755 --- a/threads.py +++ b/threads.py @@ -170,10 +170,11 @@ async def tag(id): def thread(id): attribution = get_attribution() app = get_app_config() + max_length = app.get('max_summary_length', 69) # Configure max summary length status = fetch_thread(id) status['summary'] = utils.clean_html(status['content']).strip() - if len(status['summary']) > 69: - status['summary'] = status['summary'][:69] + '...' + if len(status['summary']) > max_length: + status['summary'] = status['summary'][:max_length] + '...' return render_template('_home.html', threads=[status], app=app, attribution=attribution, render_date=datetime.now()) @threads.route('/api')