When you run Jekyll it processes the source files for your site and any files with YAML Front Matter are subject to special processing. The Front Matter is used to tell Jekyll how to format your page.

Bear in mind that Jekyll doesn't process your .org files, but the .html files produced by exporting. So when writing an org file it should be formatted in such a way that when exported it produces html suitable for processing by Jekyll.

YAML Front Matter must be the first thing in the file, with no blank lines above the Front Matter Section. A typical Front Matter Section would look like:

--- layout: default title: My Page Title. ---

So you should ensure that any Front Matter directives come first in your org file.

Note that the three hyphens --- are part of the markup and are required. The layout tag tells Jekyll which layout from its _layouts directory should be used to format your page. You can include any other keys in the Front Matter section (e.g. title: ), which you can use in your page. See the Jekyll wiki for more details on Front Matter.

Below is a short extract from one of my org files showing my setup:

#+STARTUP: showall indent #+STARTUP: hidestars #+BEGIN_EXPORT html --- layout: default title: Benighted on the Ben. excerpt: An unplanned bivouac on Ben Nevis. --- #+END_EXPORT It was early January when six of us travelled up to ....

The Front Matter section is wrapped in #+BEGIN_EXPORT html so it is exported literally to the final html file. You may need to upgrade your org version as older versions produced two blank lines before the Front Matter section when exported. You can define your own Front Matter keys and use them within your generated page. In the above example I use the "excerpt" key to display "teasers" for a blog post.

Note that the current git version of org removes the first --- if the directory containing the file start with an underscore. The workaround is to start your file with --- in both the first two lines.

Carsten has also provided two hooks that are run after exporting is complete, which can also be used to tidy up the output:

org-export-html-final-hook (always) org-publish-after-export-hook ( when going through org-publish)