File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,10 @@ class Post {
233233 data . slug = slugize ( ( data . slug || data . title ) . toString ( ) , { transform : config . filename_case } ) ;
234234 data . layout = ( data . layout || config . default_layout ) . toLowerCase ( ) ;
235235 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 ;
236240
237241 return Promise . all ( [
238242 // Get the post path
@@ -413,6 +417,9 @@ class Post {
413417 // If rendering is disabled, do nothing.
414418 return cacheObj . restoreAllSwigTags ( content ) ;
415419 }
420+ if ( ! data . async_tags ) {
421+ return tag . render ( cacheObj . restoreAllSwigTags ( content ) , data ) ;
422+ }
416423 // We'd like to render tags concurrently, so we split `content`
417424 // by top-level HTML nodes that have swig tags into `split_content` array
418425 // (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