question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Frontmatter config not behaving as expected

See original GitHub issue

Describe the bug

There seems to be an error with using multiline configs in the Frontmatter. The error is best seen in attempting to recreate the Hero and Features sections from the Frontmatter Configs docs.

Hero

When attempting to recreate the hero section from the docs, I get the following error:

[vite] Internal server error: duplicated mapping key at line 10, column 4:
                        text: Get Started
       ^

👉 Removing the actions such that the Frontmatter only contains the code below, does not result in an error of any kind but does not render anything on the page.

---
layout: home

hero:
  name: VuePress
  text: Vite & Vue powered static site generator.
  tagline: Lorem ipsum...
---

Features

Similarly, in attempting to recreate the features section I get the error:

[vite] Internal server error: end of the stream or a document separator is expected at line 8, column 2:
        - icon: 🖖
     ^

👉 Removing all but one feature, as shown in the code below, does not give errors but results in only icon being displayed.

---
layout: home

features:
  - icon: ⚡️
    title: Vite, The DX that can't be beat
    details: Lorem ipsum...
---
image

👉 Removing the icon field results in the following:

---
layout: home

features:
  - title: Vite, The DX that can't be beat
    details: Lorem ipsum...
---
image

Reproduction

File containing the exact code as per the hero section of the docs:

---
layout: home

hero:
  name: VuePress
  text: Vite & Vue powered static site generator.
  tagline: Lorem ipsum...
  actions:
    - theme: brand
      text: Get Started
      link: /guide/what-is-vitepress
    - theme: alt
      text: View on GitHub
      link: https://github.com/vuejs/vitepress
---

Expected behavior

Reproduce the hero section as per the docs

System Info

System:
    OS: macOS 12.1
    CPU: (8) arm64 Apple M1
    Memory: 98.45 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.15.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 104.0.5112.101
    Safari: 15.2
  npmPackages:
    vitepress: ^1.0.0-alpha.13 => 1.0.0-alpha.13

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ruanspiescommented, Aug 31, 2022

Thanks for the assistance, it did turn out to be an indentation issue that was caused by auto-formatting settings in the IDE.

1reaction
ruanspiescommented, Aug 31, 2022
image
Read more comments on GitHub >

github_iconTop Results From Across the Web

MD025 Error when using front_matter_title and h1 #377 - GitHub
Hi, when using title in a YAML frontmatter (aka metadata block) the first heading h1 throws a linting error for rules MD025 and...
Read more >
Why are my Jekyll defaults in config not working?
I am comparing it with another Jekyll site that I maintain where my sitewide frontmatter defaults are working as expected. What gives?
Read more >
Gitlab wiki hides front matter when editing page and removes ...
I'm having the same issue. It doesn't work as documented. However it seems only YAML front matter isn't working as expected. So I'm...
Read more >
Frontmatter display has changed in 1.1.0 - Bug reports
In the editor settings, set “Show Frontmatter” off. Look at a any note with frontmatter. Expected result. I expect to not see the...
Read more >
Order of sort, if value is not set in frontmatter? - support - HUGO
So when i add a new md file it take place not in order I would expect (it takes a place in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found