File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,7 @@ fn document_attributes(
330
330
. map ( Value :: scalar)
331
331
. collect ( ) ,
332
332
) ;
333
+ let tags = Value :: Array ( front. tags . iter ( ) . cloned ( ) . map ( Value :: scalar) . collect ( ) ) ;
333
334
// Reason for `file`:
334
335
// - Allow access to assets in the original location
335
336
// - Ease linking back to page's source
@@ -360,6 +361,7 @@ fn document_attributes(
360
361
Value :: scalar ( front. description . as_deref ( ) . unwrap_or ( "" ) . to_owned ( ) ) ,
361
362
) ,
362
363
( "categories" . into ( ) , categories) ,
364
+ ( "tags" . into ( ) , tags) ,
363
365
( "is_draft" . into ( ) , Value :: scalar ( front. is_draft ) ) ,
364
366
( "weight" . into ( ) , Value :: scalar ( front. weight ) ) ,
365
367
( "file" . into ( ) , Value :: Object ( file) ) ,
@@ -368,11 +370,6 @@ fn document_attributes(
368
370
] ;
369
371
let mut attributes: Object = attributes. into_iter ( ) . collect ( ) ;
370
372
371
- if !front. tags . is_empty ( ) {
372
- let tags = Value :: Array ( front. tags . iter ( ) . cloned ( ) . map ( Value :: scalar) . collect ( ) ) ;
373
- attributes. insert ( "tags" . into ( ) , tags) ;
374
- }
375
-
376
373
if let Some ( ref published_date) = front. published_date {
377
374
attributes. insert ( "published_date" . into ( ) , Value :: scalar ( * published_date) ) ;
378
375
}
You can’t perform that action at this time.
0 commit comments