File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ def make_urls_absolute(html, base_url):
29
29
30
30
class Feeds :
31
31
def pre_build (self , context ):
32
+ env = context .templating_engine .env
33
+ render_summary = env .globals .get ('render_summary' )
32
34
FEEDS_DOMAIN = getattr (context .settings , 'FEEDS_DOMAIN' , '/' )
33
35
FEEDS = getattr (context .settings , 'FEEDS' , [])
34
36
@@ -165,8 +167,17 @@ def pre_build(self, context):
165
167
'name' : author ,
166
168
})
167
169
170
+ # relies on a plugin generating a summary - see
171
+ # https://github.com/pengutronix/flamingo-ptx-blog-engine/blob/master/flamingo_ptx_blog_engine/summary.py
172
+ # for an example
168
173
if i ['summary' ]:
169
- summary = str (i ['summary' ])
174
+ if render_summary :
175
+ summary = render_summary (i )
176
+ else :
177
+ summary = str (i ['summary' ])
178
+
179
+ summary = make_urls_absolute (summary , fe_link ['href' ])
180
+
170
181
if 'html_filter' in feed_config :
171
182
summary = feed_config ['html_filter' ](summary )
172
183
fe .summary (summary , type = 'html' )
You can’t perform that action at this time.
0 commit comments