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

Merged key in the layouts #618

Closed
oscarotero opened this issue Jun 17, 2024 · 0 comments
Closed

Merged key in the layouts #618

oscarotero opened this issue Jun 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@oscarotero
Copy link
Member

Enter your suggestions in details:

From discord conversation

mergedKeys allows to configure the merging strategy of some variables. This behavior should be applied also to layouts.

Use case:

I have a layout that needs a CSS file, and depends on other layout

---
layout: layouts/base.vto
css_file: /styles1.css
---

<main>
  {{ content }}
</main>

The other layout has also a css_file:

---
css_file: /styles-base.css
---
<html>
<head>
  {{ for style of css_file }}
    <link rel="stylesheet" href="{{ style }}">
  {{ /for }}
</head>
<body>
{{ content }}
</body>
</html>

The idea is to use the stringArray mode for css_file variable. It works with pages and _data files but not in layouts.

@oscarotero oscarotero added the enhancement New feature or request label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant