- NEW: LiveReload integration! When viewing your site through
flutterby serve
, it will now be automatically reloaded when you make changes to a file. Flutterby will even try to apply changed stylesheets transparently, without reloading the page you're on. - BREAKING CHANGE: There has been a minor, but potentially breaking, change to how Flutterby deals with file names. Where previously Flutterby would always use the first extension of a file as the target extension, it will now use the first extension suffix it considers to be static (eg.
js
,html
,txt
etc.) This allows for input files likejquery.min.js
orjquery.min.js.erb
to compile tojquery.min.js
(where they would previously compile tojquery.min
.) (#35) - NEW: Event system! (TODO: add link to tutorial.)
- NEW:
flutterby build
now has a new--prefix
option. When supplied, the specified URL will be used to prefix all URLs generated byNode#url
(and paths generated by the newNode#path
.) - NEW:
flutterby build
now has a new--threads
option. Use it to specify the number of threads Flutterby should use when exporting your site. Depending on the nature of your site, using multiple threads may give exporting a considerable speed boost. - NEW:
flutterby serve
now has a new--address
option you can use to configure the IP address/host name the server will bind to. (thanks @localhost) - NEW: If your project has a
/404.html(.*)
page, it will be used byflutterby serve
to render 404 errors. If it doesn't, Flutterby now has a somewhat nicer to look at internal template that it will use. - NEW: Flutterby will now add your project's
lib
directory to Ruby's load path. Use it to house any Ruby modules that you want out of your site directory.
- FIXED: Images and other binaries would crash Flutterby when trying to extract frontmatter from them. Woops! (#29)
- FIXED: Front matter is now extracted using a non-greedy regular expression, fixing the problem with
---
horizontal rules in Markdown bodies.
- NEW: Within a view context, you can now invoke
render(node, as: "foo")
, and it will use a_foo
partial in the same folder asnode
, passingnode
as afoo
local. This allows you to easily apply decorator partials to nodes. - NEW: When invoking
Node#render
, you now have additional control over the layout behavior through thelayout
argument. Like before, whentrue
, the default page layouts will be applied; whenfalse
, no layout will be applied whatsoever; but now you can also pass one or more nodes (or node selectors) that will be applied as layouts. - BREAKING: If you want to pass locals to
render
, you now need to use thelocals:
key. Example:node.render(locals: { foo: "bar" })
- IMPROVED: The new project template has received some minor improvements, including a
Rakefile
containing an exampledeploy
task.
- NEW: Just like
find
, there is now also afind!
that will raise an exception when the specified node could not be found. - NEW: Nodes can now control the layout(s) that will be applied to them in their front matter through the
layout
keyword.
- NEW: Views now provide an
extend_view
method that you can (and should) use in_view.rb
extensions. - NEW: Improved log output, especially when using
--debug
.
- NEW: Nodes have two new attributes,
prefix
andslug
, which are automatically generated from the node's name. If the name starts with a combination of decimals and dashes, these will become theprefix
, and the remainder auf the name thesuffix
. For example, a name of123-introduction
will result in a prefix of123
and a slug ofintroduction
. As before, a prefix that looks like a date (eg.2017-04-01-introduction
) will automatically be parsed intodata[:date]
. - NEW: When nodes are being spawned, their names will be changed to their slugs by default (ie. any prefix contained in the original name will be removed.) For example, a
123-foo.html.md
will be exported as justfoo.html
. - NEW: Nodes now have first-class support of a node title through the new
title
attribute. This will either usedata[:title]
, when available, or generate a title fromslug
(eg. a node namedhello-world.html.md
will automatically have a title ofHello World
.) - NEW: You can now also access a node's data using a convenient dot syntax; eg.
node.data.foo.bar
will returnnode.data[:foo][:bar]
. If you're on Ruby 2.3 or newer, this allows you to use the safe navigation operator; eg.data.foo&.bar
. - BREAKING CHANGE: The
_node.rb
mechanism is gone. In its stead, you can now add_init.rb
files that will be evaluated automatically; those can use the newextend_siblings
andextend_parent
convenience methods to extend all available siblings (or the parent) with the specified module or block. - NEW: These node extensions can now supply an
on_setup
block that will be executed after the tree has been fully spawned. You can use these setup blocks to further modify the tree. - NEW: The
flutterby build
andflutterby serve
CLI commands now provide additional debug output when started with the--debug
option. - NEW: Added
Node#create
as a convenience method for creating new child nodes below a given node. - CHANGE: Some massive refactoring, the primary intent being to perform the rendering of nodes in a thread-safe manner.
- NEW: Flutterby views now have a
tag
helper method available that can generate HTML tags programatically. - NEW: Flutterby views now have a
link_to
helper method available that renders link tags. You can use a URL string as the link target, eg.link_to "Home", "/"
, or any Flutterby node, eg.link_to "Blog", blog_node
. - NEW: Flutterby views now have a
debug
helper that will dump its argument's YAML representation into a<pre>
HTML tag (similar to Rails.)
- NEW: Flutterby now uses ActiveSupport. It's a big dependency, but there's just so much useful goodness in there -- let's ride on the shoulders of that giant! This allows you to use all the neat little ActiveSupport toys you may know from Rails in your Flutterby project.
- CHANGE: Thanks to the new inclusion of ActiveSupport, Flutterby now properly deals with HTML escaping (by way of
ActiveSupport::SafeBuffer
). This may not be critically important to static sites, but since Flutterby aspires to also power live sites, better make this change now than later. To sum things up, Flutterby now deals with HTML escaping pretty much like Rails does. Hooray!
- BREAKING CHANGE: The default for
Node#render
is now to not render a layout. Passlayout: true
if you do want the node to be rendered within a layout. - BREAKING CHANGE: The behavior of
find
has now changed with regard to relative paths.find(".")
will now return the node's parent (ie. it's folder); before, a single dot would return the node itself. This change was made to makefind
behave more like what you would expect from a file system. - CHANGE: Stop the Slodown library from picking up Coderay et al to perform server-side syntax highlighting. This will probably be made configurable at some point in the future. For the time being, it is recommended to perform syntax highlighting through client-side libraries like highlight.js.
- NEW: You can now pass options to rendered partials. For example, when you invoke
<%= render("_foo.html.erb", name: "bar") %>
,_foo.html.erb
can useopts[:name]
. - NEW:
flutterby serve
now properly catches and displays exceptions via the better_errors gem. - NEW: For filters not natively supported by Flutterby, it will now fall back to Tilt. This means you can just add any gem supported by Tilt to your project to use it as a template language, with no Flutterby-specific plugin required. Hooray!
- NEW: the
flutterby
CLI now has aversion
command that will print the version of Flutterby you're using.
- First release!