Jekyll does not generate html file from markdown file (md file)

Jekyll is an interesting application to create static web pages from Markdown files. The simplified Markdown syntax also makes it easy to add new content quickly.

With the command

bundle exec jekyll serve

you can create html-files from md-files under Linux/Ubuntu.

I encountered the problem that all markdown files were converted to html files, except one md file. No html file was created from a markdown file. The markdown file was only copied to the output directory _site.


Compare Front Matter with other md files

This indicates that Jekyll treats the file as a static file and just copies it.

One reason for this may be that the so-called Font Matter is missing or incorrect.

Screenshot Jekyll Front Matter in Markdown-File
Jekyll Front Matter in md-file

In the Front Matter the reference to the layout, the definition of the title and other details are made.

But a comparison of the Front Matter with the other md-files that are correctly converted from Markdown to html has shown that there is no noticeable difference.

Check encoding

Now you can check if there are differences in the encoding of the respective file. You can check the encoding with a text editor like Sublime.

In my case it turned out that the md-file in question, which is not converted into an html-file, has the encoding UTF-8 with BOM.

Screenshot showing encoding in text-editor
encoding UTF-8 with BOM shown in texteditor sublime

If you now save the file with the encoding UTF-8 (without BOM), the md file in question is also correctly generated as an HTML-file in the output directory _site.

Leave a Reply

Your email address will not be published. Required fields are marked *