
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
middleman-blog-drafts
Advanced tools
middleman-blog-drafts is an addon for middleman-blog that simplifies draft posts creation and publishing.
If you're just getting started, install the required gems and generate a new blog project:
gem install middleman middleman-blog-drafts
middleman init MY_BLOG_PROJECT --template=blog
Then add middleman-blog-drafts
to your Gemfile
and activate the extension in your config.rb
:
activate :drafts
middleman draft 'My awesome new blog post'
middleman publish source/drafts/my-awesome-new-blog-post.markdown
<% if drafts.any? %>
<ul>
<% drafts.each do |draft| %>
<li><%= link_to draft.title, draft.path %></li>
<% end %>
</ul>
<% end %>
As drafts won't be be available in the generated page by default, checking whether there are any is enough to decide whether to render the listing or not.
build
: when true
, the drafts will be available unconditionally. If not
given, the drafts will be available in middleman's development mode and
unavailable in middleman build
.
This allows you to control the behaviour, for example if you have a preview instance of your blog. One way to do so would be to set it based on an environment variable:
activate :drafts do |drafts|
drafts.build = true if ENV["SHOW_DRAFTS"]
end
This activates drafts in any environment where SHOW_DRAFTS
is given and uses
the default otherwise.
build
can be overriden on a per-draft basis. For example if you want to make
a draft available to a small audience for proofreading, you may force the build
of that one draft with the following frontmatter:
---
title: "Example blog post"
build: true
---
Likewise if you configure build
to true
for your entire blog, you may still
withhold single drafts from being built by setting build: false
in the
frontmatter.
See the blog extension guide for detailed information on configuring and using the blog extension.
Most of the code was based on the middleman-blog gem itself, so many thanks to everyone that helped out with it.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that middleman-blog-drafts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.