middleman / middleman-blog

Blog Engine Extension for Middleman
https://middlemanapp.com
MIT License
325 stars 179 forks source link

Add support for environments #361

Open eellson opened 6 years ago

eellson commented 6 years ago

As of https://github.com/middleman/middleman/pull/1293/files middleman splits the notion of :mode and :environment. This PR updates middleman-blog to also handle this distinction.

This allows generation of blogposts using config for a particular environment using the --environment flag. e.g:

middleman article 'Awesome new post' --environment blog would look for config within the configure :blog do ... end block.

The main gotcha I see is that this requires Time.zone to be set in config.rb also. I wonder though if that is related to one of the various other date-related issues: https://github.com/middleman/middleman-blog/issues/238, https://github.com/middleman/middleman-blog/issues/191, https://github.com/middleman/middleman-blog/issues/143

Additionally, the -e alias is already used for editing on this project, while for middleman itself, and other extensions, this is used for environment specification. I've left out that alias for now.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 92.702% when pulling a67ec009d56cf390fd8287af1e369911746fb64b on eellson:environment-support into fec110fad6b6535f875ae4d1c6d3ab0f5866228f on middleman:master.

markets commented 8 months ago

Hey @eellson 👋🏼 I'm helping to maintain this project now, could you please summarize why we need this feature?