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

Configuring export directories #30

Closed
Webslung opened this issue Nov 16, 2017 · 3 comments
Closed

Configuring export directories #30

Webslung opened this issue Nov 16, 2017 · 3 comments

Comments

@Webslung
Copy link

Hoping this is the appropriate place to ask this question. Apologies if it isn't.

I'm looking to use the clean export function within PL to get a directory structure exported of my twig files that matches what's in the source directory. Ideally, this would include:

- _data
- _layouts
- _macros
- _meta
- _patterns <-- with all variants etc.
- _twig-components
- images
- js
- etc. <-- any files and dirs that would normally export to public or export directories.

In our shop we use a WordPress framework that makes use of twig files to build our templates with an MVC setup.

I can copy and paste or setup a deploy of some sort to dump out, but the export feature seems to be the more "tool centric" way to go. Is it extensible at all? Could I customize that in some way? Thanks and I'll hang up and listen. :-)

P.S. @dmolsen said to post here and maybe @aleksip or @EvanLovely could help me out. Thanks!

@bradfrost
Copy link
Member

@Webslung tough to see what exactly you need to do, but generally when I'm creating integrations like this, I'll use Grunt or Gulp to copy over the appropriate files to the appropriate places in my build. So something like:

  • /source/patterns/* => production/includes
  • /public/css/* => production/css/
  • /public/js/* => production/js/
  • /source/_data/* => production/_data/

And so on. When I call the command gulp export-to-production or whatever, the copy command copies things to the appropriate folders.

I don't know if that's generally what you're trying to accomplish.

@aleksip
Copy link
Member

aleksip commented Nov 20, 2017

@Webslung I take it you are talking about the php core/console --export command, and customizing it somehow? Or adding a custom command to do something similar?

I'm not 100 % sure about this, but I don't think there is a way to customize existing commands (other than using a plugin, but there are no plugin events for the export). I don't think there is a supported way to add new commands either. So currently something like what @bradfrost suggested would probably be the best way to do something other than what the default export command does.

However, this might change in the (hopefully near) future, as we are planning to refactor PL PHP core to use Symfony's Console component and also make it possible to provide custom PL commands.

@Webslung
Copy link
Author

@aleksip and @bradfrost your answers are what I was looking for. A set of gulp tasks was my fallback plan if something more integrated couldn't be used. I was looking to do something that built off of the core if possible, but gulp or some other task runner will do the trick. Thanks for the responses. Love PL!

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

No branches or pull requests

3 participants