estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...

Home Page:https://frontmatter.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue: Variable interpolation is not working in array/list for placeholder

Mikescops opened this issue · comments

Describe the bug
When using a default placeholder that is an array, the variables are not interpolated inside.

To Reproduce
Create a new field in your contenttype with the following:

               {
                    "title": "aliases",
                    "name": "aliases",
                    "type": "list",
                    "default": [
                        "post/{{slug}}"
                    ],
                    "hidden": true
                }

You should get the following:

---
title: test-title
slug: test-title
aliases:
  - post/{{slug}}
---

Expected behavior
The slug variable should be rendered properly.

---
title: test-title
slug: test-title
aliases:
  - post/test-title
---

Note that using "default": "post/{{slug}}" properly renders "default": "post/test-title" so the problem is related to how array are managed.

Thanks, @Mikescops; this is indeed not yet supported, but let us make it happen! 💪

@Mikescops was added and is testable in the latest beta version.

@Mikescops was added and is testable in the latest beta version.

sounds like it broke the normal string interpolation 😓

image image

That is correct 🤦‍♂️, should be better with the new fix

Much better, thanks!

image