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

Closed
opened 2026-10-05 02:54:55 +02:00 by adam · 5 comments
Owner

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.

**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: ```json { "title": "aliases", "name": "aliases", "type": "list", "default": [ "post/{{slug}}" ], "hidden": true } ``` You should get the following: ```md --- title: test-title slug: test-title aliases: - post/{{slug}} --- ``` **Expected behavior** The slug variable should be rendered properly. ```md --- 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. <!-- github-sync-id:2128971815 -->
adam closed this issue 2026-10-05 02:54:55 +02:00
Author
Owner

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

Thanks, @Mikescops; this is indeed not yet supported, but let us make it happen! 💪 <!-- github-comment-id:1938350793 -->
Author
Owner

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

@Mikescops was added and is testable in the latest beta version. <!-- github-comment-id:1938736288 -->
Author
Owner

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

sounds like it broke the normal string interpolation 😓

image image
> @Mikescops was added and is testable in the latest beta version. sounds like it broke the normal string interpolation 😓 <img width="287" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/4266283/f01b4c2e-b622-4585-a228-bca2739692e6"> <img width="585" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/4266283/112c5ded-d793-4d37-9534-65a54c3b7e5c"> <!-- github-comment-id:1939110526 -->
Author
Owner

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

That is correct 🤦‍♂️, should be better with the new fix <!-- github-comment-id:1939139955 -->
Author
Owner

Much better, thanks!

image
Much better, thanks! <img width="409" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/4266283/7f03bd19-22d6-450b-bde1-c50d5214208c"> <!-- github-comment-id:1939171781 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#597