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

Support blob syntax or listing directories in -O options command #55

Open
wamoyo opened this issue Mar 16, 2017 · 1 comment
Open

Support blob syntax or listing directories in -O options command #55

wamoyo opened this issue Mar 16, 2017 · 1 comment

Comments

@wamoyo
Copy link

wamoyo commented Mar 16, 2017

So, maybe I shouldn't but I use the -O flag to pass in some json that represents data in my app. I do this to separate data about events (like in person events) on my website, from all the various code that controls how to display the data about those events. Then I compile my pug files into static website assets, which is why there's no server where I can affect locals.

I'd suggest supporting listing a directory for the -O flag, so that it'll load multiple json files or javascript files and the variables they declare, into pug.

My higher level interest is to be able to make app data available in pug even when there's no server code, as in static site development. I just run two npm scripts to watch and build my site.

@wamoyo
Copy link
Author

wamoyo commented Apr 17, 2017

No thoughts on this?

For anyone else who arrives here, I ended up stringing together several files with jq using this command: jq -s '.[0] + .[1]' site-data.json public-keys.json >options.json and then running pug with that options.json object using the -O flag.

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

No branches or pull requests

1 participant