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

More control over export  #376

Description

@bradfrost

(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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions