Grav 1.4 & Admin 1.7 Released!

Building for the future...

6 mins

Today we're proud to release Grav 1.4, which has been in development and testing since the start of December 2017. This release has been created to act as a stepping stone in the Grav development process to make some new features and functionality available earlier than previously planned, and allow more time for testing and refinement.

New Quark Core Theme

Since the Grav project began, the core theme that Grav used, and the one that most other themes have been built on has been Antimatter. This was a simple theme built with a simple 'nucleus' of minimal CSS. As the needs of Grav users have grown, so has the need for a better more flexible base theme. Enter Quark, a new theme built on top of the feature-rich, yet lightweight, Spectre.css framework.

This theme remains minimal but has more features built such as configurable header options, and flexible hero blocks. As part of this development effort, a new version of the Blog Skeleton and One-Page Skeleton has been created to make full use of Quark and show off its capabilities.

We've also implemented some new features into the core of Grav to bridge the gap until Grav 2.0 is ready.

Cache

We're moving our current cache mechanism to a new Simple Cache system based on PSR-16 that will allow Grav to have much greater control and flexibility over caching strategies. For example, we will be able to cache different elements of Grav using different cache stores, with different timeouts, and unique cache clearing logic.

We'll also have the ability to cache more atomic elements of the output so you can construct a page layout with content that is cached more aggressively than others areas of content. Baking in this new functionality in Grav 1.4 will allow theme and plugin developers to use these new techniques now rather than waiting for Grav 2.0.

Content Blocks

Content Blocks are a feature that exists to some degree in our Gantry 5 framework, and we're now adding this with a variety of improvements to Grav 1.4. The goal of Content Blocks is to allow the easy development of nested HTML blocks with their Stylesheets and JavaScript as needed.

This will allow functionality to be much more modular and self-contained than in previous versions of Grav. You will be able to create output along with any associated CSS or JS elements with full caching capability without worrying about losing assets when content is cached, as well as having much greater control to ensure you only load assets when the content needs them. Content Blocks will take Grav's already powerful Twig templating to the next level.

Objects

Another feature that we intend to have fully implemented in Grav 2.0 is a new set of Object classes that will enhance Grav's collection capabilities. By adding an initial set of these classes in Grav 1.4 we can use them in Grav plugins now, and be able to test them thoroughly before they are fully integrated into the core functionality. These new object classes will enable us to create complex queries that go far beyond the basic querying Grav supports currently.

More Minor Stuff

There have been several other minor improvements to improve the whole Grav experience:

  • New Twig {% try %} and {% catch %} tags to allow error handling at the Twig template level
  • New Twig {% switch %} tag for simpler if logic
  • New Twig {% markdown %} to render blocks of markdown without needing to resort to variables and filters
  • New Twig {% script %} and {% style %} tags for easier CSS/JS asset handling
  • New Twig filter |nicenumber to allow for simpler human-readable number formatting
  • New Twig filter |yaml_encode and |yaml_decode to work similarly to existing JSON filters
  • New Twig functions for theme_var(), header_var() and body_class() as used by Quark and other themes to handle variable resolution
  • New Twig function read_file() to output the contents of a file
  • The old GravTrait has been deprecated in favor of Grav::instance()
  • Debugbar can now be used in non-HTML responses
  • Transferred copyright of Grav from RocketTheme, LLC to Trilby Media, LLC as Trilby is Grav-focused and a better entity to own the copyright.
  • Minor visual improvements for the Whoops error page
  • Better Page::collection() filtering support including the ability to have non-published pages in collections
  • New Collection::toExtendedArray() method to output a full collection array that can easily be converted to JSON/YAML
  • Code optimizations in various classes such as Utils, Uri, and Cache
  • Test suite has been updated and improved with more accurate tests
  • Added a new Utils::url() function to allow for an easier way to generate valid URLs within Grav
  • All vendor libraries have been updated to their latest versions
  • Bug fixes and improvements for Grav in environments with paths that use special characters
  • Various other bugs and issues that have been reported since Grav 1.4 development began

There are some other key features that got added as part of the last few Grav 1.3 releases that while not unique to 1.4, deserve mention:

  • Built-in Twig partials for metadata.html.twig and messages.html.twig which can be used by any theme
  • HTML5 Audio controls added
  • Added the ability to force lowercase URLs
  • New Session::setFlashCookieObject() and Session::getFlashCookieObject() methods that enable messages to be stored between session resets.
  • Ability to to disable automatic use of PHPs internationalization module
  • Page media can now be ordered by dragging-and-dropping

Grav Admin Plugin 1.7

The Grav admin plugin has been updated alongside Grav 1.4 with a new theme. The newer theme has a lighter overall feel with a dark sidebar and light body area. The overriding request for the admin was to have a lighter, more professional feel, and we've taken this advice to heart with the latest release.

Along with this update in color, the theme now defaults to operating without Google Fonts. This makes the whole UI feel snappier and faster and works out-of-the-box in offline situations. A new line-based icon font and some other minor layout enhancements make up the rest of the UI revamp.

The updates and improvements to Grav 1.4 as well as the 1.7 version of the Admin plugin, provide Grav with a fresh feel for 2018, as well as allowing for continued development and enhancements over the coming year.

Thoughts on Grav 2.0

As I alluded to at the start of this post, we've already started thinking about and planning for Grav 2.0. There are some fundamental improvements we want to built into 2.0, and it will require some fairly comprehensive changes throughout the core. Some things we know we want, and a few of those have been implemented and added to Grav 1.4, but others are still very much up for discussion. We hope to maintain compatibility with Grav 1.0, but if we cannot achieve this while providing the new functionality and improvements we have planned, we plan to build a plugin or process to migrate sites.

The final list of features planned for version 2.0 is not complete. We are still very much in the Request for Comments (RFC) stage. If you want to review the current status or want to contribute with your ideas and thoughts, please do so on our Roadmap for Grav 2.0 issue on GitHub.

Grav Premium
Turbo-charge your Grav site - from the creators of Grav