Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jekyll Front Matter skip #1175

Closed
Serhioromano opened this issue Apr 10, 2017 · 1 comment
Closed

Jekyll Front Matter skip #1175

Serhioromano opened this issue Apr 10, 2017 · 1 comment

Comments

@Serhioromano
Copy link

Description

I am using VS Code which uses beautify for formatting document. I'am doing project with Jekyll. I think you know is is default static page generator for Github Pages.

Every document that I want to be processed by Jekyll have to include as they call it Front Matter.

---
title: This is my document 
layout: default 
tags: tag1, tag2
category: news
---

This is YML. It tells Jekyll meta data about this file.

If beautification is applied this turns into single line

--- title: This is my document layout: default tags: tag1, tag2 category: news ---

Which is not recognized as Front Matter by Jekyll.

So I have to turn beautification off in VS Code completely for every HTML document.

Is it possible to detect Front Matter and not to format it? Looks like there is not parameter to exclude it from formatting because it is not in HTML tag.

Before

The code looked like this before beautification:

--- 
layout: default 
---

<div class="row">
    <div class="large-10 column">
    <h1 class="post-title">{{ page.title | escape }}</h1>
        {{ content }}
    </div>
</div>

Expected

The code should have looked like this after beautification:

--- 
layout: default 
---

<div class="row">
    <div class="large-10 column">
        <h1 class="post-title">{{ page.title | escape }}</h1>
        {{ content }}
    </div>
</div>

Actual Output

The code actually looked like this after beautification:

--- layout: default ---

<div class="row">
    <div class="large-10 column">
        <h1 class="post-title">{{ page.title | escape }}</h1>
        {{ content }}
    </div>
</div>

Steps to Reproduce

  1. Install VC Code
  2. Insert code snippet
  3. Click Command+P and type format. Select format code.

Environment

OS: macOS
Visual Studio Code

Settings

{
    "preserve_newlines": true,
    "max_preserve_newlines": 1
}
@bitwiseman
Copy link
Member

See #510.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants