-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature Request: Conditionals (or Empty/Unset Vars) #4
Comments
OrEven just some way to make it so if a variable isn't defined, it just replaces the Kit comment with an empty string. For example: page.kit<!DOCTYPE html>
<html>
<head>...</head>
<body>
<nav>
<!-- @page = class="active" -->
<!-- @import nav.kit -->
</nav>
...
</body>
</html> nav.kit <ul>
<li <!-- &@home -->>
<a href="/">Home</a>
</li>
<li <!-- &@page -->>
<a href="/page.html">Page</a>
</li>
<li <!-- &@other -->>
<a href="/other.html">Other</a>
</li>
</ul> (The page.html<!DOCTYPE html>
<html>
<head>...</head>
<body>
<nav>
<ul>
<li>
<a href="/">Home</a>
</li>
<li class="active">
<a href="/page.html">Page</a>
</li>
<li>
<a href="/other.html">Other</a>
</li>
</ul>
</nav>
...
</body>
</html> |
FYI, here's my workaround. In
And then, e.g., in
|
Hey Bryan, is this feature still on the radar? This would be extremely useful. |
For folks checking the status of this issue, here's a bit of a workaround that gets you conditional functionality.
As an example, here's what goes in the parent file:
And here's the child file:
The resulting compiled file will have block one commented out and block two included:
Maybe it's not the most aesthetically pleasing approach, but it does get the job done. And thanks @bdkjones for CodeKit! |
Ha, that's ridiculously clever. Well done. Sent from my iPhone
|
For example:
page.kit
nav.kit
page.html
The text was updated successfully, but these errors were encountered: