In yesterday's post, I've presented a Python script to convert Pelican preamble files to YAML for Hugo.

For some UTF-8 files, these is a BOM marker at the beginning of the file. The script (as a true quick and dirty solution) doesn't check the presence of such marker and it cannot detect the Title element if it exists.

I added an fm = fm.strip('\ufeff') line to clear BOM marker from a line if it exists.


There is an editor called bvi to edit binary files in Hex format, similar to vi editor.