简体   繁体   中英

How do I run prettier for markdown files for Hugo the static site generator?

I use Vim version 7.4.629 and I want to use prettier to clean up markdown files for Hugo the static site generator. How do I configure Vim correctly? Here is an error message: _index.md|1 col 3| Invalid left-hand side in assignment _index.md|1 col 3| Invalid left-hand side in assignment

Here is an example _index.md file:

---
title: "Privacy Policy"
description: "Privacy Policy"
date: 2020-01-01T12:56:17+01:00
draft: false
menu:
  footer:
    name: Privacy Policy
    url: /privacy-policy/
    weight: 1
---

{{< divmd class="section-x" >}}
{{< divmd class="container" >}}
## Privacy Policy
---

### Privacy policy for website operators based on GDPR specifications

We are delighted you are visiting our website 
{{< /divmd >}}
{{< /divmd >}}

The line "proseWrap": "always", in the .prettierrc solved the problem.

Here the an example of my .prettierrc.

{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": false,
  "singleQuote": true,
  "traillingComma": "all",
  "bracketSpacing": false,
  "proseWrap": "always",
  "jsxBracketSameLine": false
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM