Search code examples
pugyamljekyllcodekit

Codekit Jade Compilation Issues


I'm attempting to compile a layout file for a static Jekyll/Github Pages project:

| ---
| layout: default
| ---

header.page-header
  h1 {{ page.title }}

...etc.

to:

(skipped line)    
---
layout: default
---
<header class="page-header">
  <h1>{{ page.title }}</h1>

...etc.

But codekit is adding an indent at the beginning of the compiled file (so the compiled file starts on line 2). If I change the Jade to a more basic file, I still get the same issue:

test.html

The extra line means that the YAML front header isn't recognized. Does anyone know a work around or a way to fix this?

P.s. I also tried changing the codekit settings to minify and I get this, which unfortunately causes the same problem

Solution: For now, I switched back to html and am no longer using jade, but if anyone has a solution their help would be much appreciated!


Solution

  • Just found this issue https://github.com/jadejs/jade/issues/1401 and solution that works for me:

    Jade template:

    :verbatim
        ---
        layout: default
        ---
    
    h1 {{ page.title }}
    

    Compiled html:

    ---
    layout: default
    ---
    
    <h1>{{ page.title }}</h1>
    

    Tested with grunt-contrib-jade and native jekyll build.