@@ -482,7 +482,7 @@ def index():
482
482
wants = wants_now
483
483
484
484
if current_user .can_edit_all_posts and wants :
485
- posts = site .posts
485
+ posts = site .all_posts
486
486
pages = site .pages
487
487
else :
488
488
wants = False
@@ -492,7 +492,7 @@ def index():
492
492
if (p .meta ('author.uid' )
493
493
and p .meta ('author.uid' ) != str (current_user .uid )):
494
494
continue
495
- if p .use_in_feeds :
495
+ if p .is_post :
496
496
posts .append (p )
497
497
else :
498
498
pages .append (p )
@@ -543,16 +543,25 @@ def edit(path):
543
543
or not author_change_success ):
544
544
meta ['author' ] = post .meta ('author' ) or current_user .realname
545
545
meta ['author.uid' ] = post .meta ('author.uid' ) or current_user .uid
546
- post .compiler .create_post (post .source_path , onefile = True ,
546
+
547
+ twofile = post .is_two_file
548
+ onefile = not twofile
549
+ post .compiler .create_post (post .source_path , onefile = onefile ,
547
550
is_page = False , ** meta )
551
+ if twofile :
552
+ meta_path = os .path .splitext (path )[0 ] + '.meta'
553
+ with io .open (meta_path , 'w+' , encoding = 'utf-8' ) as fh :
554
+ fh .write (nikola .utils .write_metadata (meta ))
548
555
scan_site ()
549
556
post = find_post (path )
550
557
context ['action' ] = 'save'
551
558
context ['post_content' ] = meta ['content' ]
552
559
else :
553
560
context ['action' ] = 'edit'
554
561
with io .open (path , 'r' , encoding = 'utf-8' ) as fh :
555
- context ['post_content' ] = fh .read ().split ('\n \n ' , 1 )[1 ]
562
+ context ['post_content' ] = fh .read ()
563
+ if not post .is_two_file :
564
+ context ['post_content' ] = context ['post_content' ].split ('\n \n ' , 1 )[1 ]
556
565
557
566
context ['post' ] = post
558
567
users = []
0 commit comments