stakx 0.1.1 "Eccentric Wallaby"

April 29, 2017 allejo allejo

After about two months of fixing bugs, improving existing feature, and (hopefully) not breaking any existing functionality, I present stakx 0.1.1. You can view the full CHANGELOG for a full list of changes but here are some of the highlights.

So what's new?

Here are a few of the new features available in 0.1.1; see the full changelog to see everything.

The watch command has been improved

The watch command is now capable of compiling changes to parent templates. Before, when you would {% extend %} another Twig file, any changes made to the file you're extending wouldn't be compiled without restarting the watch command; this has been fixed. Additionally, the watch command now supports more than just polling the filesystem. Here's the order of supported tools in order of priority:

  • inotifywait (Linux shell utility)
  • fswatch (Cross-platform file change monitor with multiple backends)
  • watchmedo (Cross platform pything shell utility)
  • inotify (Php PECL extension)
  • Filesystem polling

Overall, the watch command is still in its experimental phase and has known issues such as not deleting files or objects correctly when they're deleted, moved, or renamed.

The new --use-drafts option

No one writes their posts perfectly or completely the first time around, that's why drafts exist in any given tool. Well now, drafts have come to stakx. Simply add draft: true to any given ContentItem and it will not write a file at compile time nor will it appear in the collections variable. If you'd like to build your website to see how drafts would look like, use --use-drafts in either the build or watch commands.

New FrontMatter values

All ContentItems and DataItems now have two special values available as a FrontMatter variable and in the this variable in Twig templates:

  • filename - the full name of the file
  • basename - the name of the file without the extension
permalink: /blog/%basename.html

So what's next?

There's a large amount of refactoring that I would like to do for the project and allow more customization such as custom template engines and custom parsers for ContentItems and DataItems. As an example, instead of use Parsedown you'd have the option to configure a CommonMark parser or your own custom parser. Or instead of using Twig, you'd like to use Nette instead.

These would be a lot of huge and breaking changes, especially internally so to answer what's next, a breaking release of stakx. The version number is yet to be decided and the PHP requirements is still yet to be decided. The 0.1.x branch will continue to use Twig 1 and support PHP 5.6+.