Closed Atulin closed 4 years ago
I thought that me generating the files with
''.join([
'---\n',
f'Author: {author}',
...,
'---\n'
])
might've been at fault, so I went with
post: Post = Post(data['Body'].strip())
post['Title'] = data['Title']
post['Author'] = data['Author']
post['Date'] = data['Date']
post['Category'] = data['Category']
post['Tags'] = data['Tags']
and frontmatter.dumps()
instead, hoping that it'll create correct and valid files.
Alas, the problem still persists. Files generated in this way still seem to contain no metadata, and their entirety is treated as the content.
When encoding on read isn't set to utf-8
, the first character in the file is 
, only then followed by three dashes. Could be the culprit.
Edit: yes, it was. Seems to be fixed by creating the files with utf-8
encoding instead of utf-8-sig
For each and every file the first print prints
0
, and the second print prints the entire content of the file, including the frontmatter block and all.All files look more-or-less like so: