File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,10 @@ class Post {
233
233
data . slug = slugize ( ( data . slug || data . title ) . toString ( ) , { transform : config . filename_case } ) ;
234
234
data . layout = ( data . layout || config . default_layout ) . toLowerCase ( ) ;
235
235
data . date = data . date ? moment ( data . date ) : moment ( ) ;
236
+ // Whether to allow async/concurrent rendering of tags within the post.
237
+ // Enabling it can improve performance for slow async tags, but may produce
238
+ // wrong results if tags within a post depend on each other.
239
+ data . async_tags = data . async_tags || false ;
236
240
237
241
return Promise . all ( [
238
242
// Get the post path
@@ -413,6 +417,9 @@ class Post {
413
417
// If rendering is disabled, do nothing.
414
418
return cacheObj . restoreAllSwigTags ( content ) ;
415
419
}
420
+ if ( ! data . async_tags ) {
421
+ return tag . render ( cacheObj . restoreAllSwigTags ( content ) , data ) ;
422
+ }
416
423
// We'd like to render tags concurrently, so we split `content`
417
424
// by top-level HTML nodes that have swig tags into `split_content` array
418
425
// (nodes that don't have swig tags don't need to be split).
You can’t perform that action at this time.
0 commit comments