gajus/gitdown

Notice breaks Jekyll markdown pages

Closed this issue · 2 comments

The auto generated notice breaks the YAML frontmatter when using Jekyll to convert a markdown file to HTML:


---
layout: index
title: Home
permalink: /

---

Generates:

<!--
This file has been generated using Gitdown (https://github.com/gajus/gitdown).
Direct edits to this will be be overwritten. Look for Gitdown markup file under ./.gitdown/ path.
-->

---
layout: index
title: Home
permalink: /

---

And will make Jekyll ignore that file (since it does not start with the frontmatter). I hacked it with setting Gitdown.notice = function() { return ''; };.

I can think of two solutions:

  1. Make the notice a plugin (with customizable text) and add the standard notice if the plugin hasn't been used.
  2. Insert the notice after the second --- if the file starts with it.

I will add a configuration option to enable/disable insertion of the comment at the top of the file.

gajus commented
<!--
This file has been generated using Gitdown (https://github.com/gajus/gitdown).
Direct edits to this will be be overwritten. Look for Gitdown markup file under ./.gitdown/ path.
-->

Is no longer being included in the output.