Version 0.10.0 is out now!
There’s some potential breaking changes so this post is to share what’s new and the potential problems you may have with upgrading.
Changes which may break things!
mount_push_type has been rewritten. It now accepts a different set of options and the resulting URLs of your PushType installation may have changed.
The admin and api engines are mounted as isolated engines at the specified mount point. The
FrontEndController is still added to the host app, but you can pass a path option in case you don’t want the PushType front end at the root of your application.
# default options mount_push_type admin: 'admin', api: 'api', front_end: '/' # with customised options mount_push_type admin: 'cms', front_end: 'pages'
Notice how previously the admin engine was mounted at “/push_type”. You can of course switch back to that path, but it is no longer the default.
Changes to route namespacing
PushType’s individual Rails engines now have distinct route namespaces. For example:
Previously everything was accessed through the same namespace (
push_type) - so if you’ve linked to any of the internal routes you’ll need to update the namespace for the correct path helper.
root_path back, and welcome
Previously PushType commandeered the
root_path which caused an error if the host app set it’s own
root_path. PushType no longer does this. Instead there is a new
home_node_path which will render the home page as set through
config.home_slug = false
In some cases, you may not even want a home page as your app handles that elsewhere. Now setting
config.home_slug = false in
config/initializers/push_type.rb will essentially remove the
media_path url helpers
media_path expected a file_uid string passed to it. You can still do that so there should be no problems, but you can now just pass the
media_path(asset, style: '#200x200')
In addition, if you have set an
asset_host in your Rails config, the
media_path helper will use the asset host URL.
node_path url helpers
node_path expected a permalink string passed to it. As above, this still works, but you can now just pass the
Other new features
Under the hood PushType now has a full API for managing content. This is so new and shiny, even PushType doesn’t use it’s own API yet ! But moving forward this will play a much greater roll, both for the admin UI and external integrations.
More to come on this.
Ability to preview nodes
When editing a node, there is now a link (under the publish button) to preview it. This will render the node and it’s template regardless of it’s publish status.
The route for previewing a node maps to the
FrontEndController. It is a public, unauthenticated URL so it can be shared with non users. It uses a base64 encoded identifier (derived from the node guid) and sets robots nofollow and no index headers, so these preview URLs shouldn’t end up in search engines.
There’s a few bug fixes in this version that won’t be fixed in 0.9.x.