use Mojo::Base 'Mojolicious::Plugin';
use Carp;
use Mojo::File qw(path);
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Cache;
use constant DEBUG => $ENV{MOJO_ICONIFY_DEBUG} || 0;
use const
$file ( $collections_path->list->each ) {
next if ( !$file =~ /.json/ );
$collections->{ $file->basename('.json') } = $file;
}
# Helpers
$app->helper(
'iconify_a
return if ( !defined $collections->{$collection} );
my $collection_data = decode_json $collections->{$collection}->slurp;
$cache->set( $collection => $collection_data );