mirror of
https://github.com/pelican-plugins/share-post.git
synced 2025-10-15 17:08:54 +02:00
Revert "share_post: Don't read summary as it's not used anywhere"
This reverts commit 7c097d6699cff6aef0a08336cf5914f64e2bf2bd. Closes #549
This commit is contained in:
parent
5f6b44a973
commit
c4351fe453
1 changed files with 5 additions and 0 deletions
|
|
@ -27,11 +27,16 @@ def article_url(content):
|
|||
return quote(('%s/%s' % (site_url, content.url)).encode('utf-8'))
|
||||
|
||||
|
||||
def article_summary(content):
|
||||
return quote(BeautifulSoup(content.summary, 'html.parser').get_text().strip().encode('utf-8'))
|
||||
|
||||
|
||||
def share_post(content):
|
||||
if isinstance(content, contents.Static):
|
||||
return
|
||||
title = article_title(content)
|
||||
url = article_url(content)
|
||||
summary = article_summary(content)
|
||||
|
||||
tweet = ('%s%s%s' % (title, quote(' '), url)).encode('utf-8')
|
||||
diaspora_link = 'https://sharetodiaspora.github.io/?title=%s&url=%s' % (title, url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue