Announcing Acorn Prettify

We’re excited to announce the launch of a new package, Acorn Prettify, which is the successor to the Soil plugin.

Read more at Announcing Acorn Prettify | Roots

5 Likes

Acorn Prettify v1.0.1 released

What’s Changed

Full Changelog: https://github.com/roots/acorn-prettify/compare/v1.0.0...v1.0.1

3 Likes

I tried this on a clean install of roots/bedrock and the latest roots/sage

composer require roots/acorn-prettify

No problem installing. Then:

wp acorn vendor:publish --tag=prettify-config

But this produced:

 INFO  No publishable resources for tag [prettify-config].  

And there is no config file to be found anywhere, and no front end change to nav item classes or any other (previously Soil) enhancement such as relative URLs.

You need to run wp acorn optimize:clear probably. This should be done for you automatically when you install packages if you setup post-autoload-dump like the Acorn installation docs show.

2 Likes

The nav walker from Soil is not included in this package — I’d recommend using GitHub - Log1x/navi: A developer-friendly alternative to the WordPress NavWalker.

These are disabled by default and can be enabled via the config if you’d like

See:

1 Like

Thanks very much @Log1x and @ben

@Log1x - that does indeed sort it. I added the post-autoload-dump script to composer.json then ran composer dump-autoload -o followed by trying the command to publish the config file. Now I can see it as config/prettify.php in the theme directory.

@ben - Once the config was published I could see the custom nav walker was removed, so that will explain the menu item classes. I’ll look at your suggested approach.

2 Likes

Please may I ask what the best practice would be for including scripts such as Google analytics now that Soil has been deprecated? I’m using Radicle.

I can’t decide if I need to add into a helper class, or put into the scripts directory.

Answering my own question:

In the local development envirionment (eg. in virtual machine, maybe):

wp acorn make:provider

In the created file, add a filter for wp_head within the register() method. Echo your script from within the filter. Use the Roots\env function to get environment variables and insert into the script.

Add the environment variables (eg. GTAG="your google tag id") to your .env file. If using trellis, this can be automated by adding to the env vars in the appropriate file(s) in trellis/group_vars.

Then add your new provider class to the lists of providers in both composer.json and config/app.php following the conventions in each file.


Documentation: Service Provider Configuration | Radicle Docs | Roots

1 Like