Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

More control over export #376

Open
bradfrost opened this issue Sep 28, 2016 · 0 comments
Open

More control over export #376

bradfrost opened this issue Sep 28, 2016 · 0 comments

Comments

@bradfrost
Copy link
Member

(Not sure which repo to put this, @dmolsen & @bmuenzenmeyer, so I'm putting it here for now.)

I'm running into something that I think could be handled at a lower level. Whenever I run php core/console --export, a few files that I'm only using with Pattern Lab (such as pattern-scaffolding.css) are still referenced in the head of my documented.

I think it would be great if we could wrap these files in a conditional so that when export runs, it switches the conditional off, keeping PL-specific files out of the exported files. For example, _00-head.mustache could look something like this:

<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../../css/styles.css?{{ cacheBuster }}" media="all" />

{{# patternLabOnly }}

<link rel="stylesheet" href="../../css/pattern-scaffolding.css?{{ cacheBuster }}" media="all" />

<script src="//localhost:35729/livereload.js"></script>

<!-- Other stuff I want to include only in PL but not in my exported code -->

{{/ patternLabOnly }}
</head>
</html>

The same conditional could also be applied in _01-foot.mustache, or better yet, could be applied in any pattern within source/_patterns. This would give people flexibility to do what they need to do within the PL shell, but strip everything out when it gets exported for production.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant