Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Site'
Browse files Browse the repository at this point in the history
  • Loading branch information
kberov committed Oct 12, 2018
2 parents da2a767 + b810f08 commit 7a76e5b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Changes
@@ -1,5 +1,10 @@
Revision history for Mojolicious application Slovo

2018.10.12
- Features
(Hopefully temporarily) added new media types for woff and woff2 font
file formats.

2018.10.11
- Changes
Replaced 'Menaion Unicode TT' with 'Bukyvede' as the latter has the
Expand Down
12 changes: 10 additions & 2 deletions lib/Slovo.pm
Expand Up @@ -17,7 +17,7 @@ use Slovo::Controller;
use Slovo::Validator;

our $AUTHORITY = 'cpan:BEROV';
our $VERSION = '2018.10.11';
our $VERSION = '2018.10.12';
our $CODENAME = 'U+2C10 GLAGOLITIC CAPITAL LETTER NASHI (Ⱀ)';
my $CLASS = __PACKAGE__;

Expand All @@ -33,7 +33,8 @@ sub startup($app) {
## no critic qw(Subroutines::ProtectPrivateSubs)
$app->hook(before_dispatch => \&_before_dispatch);
$app->hook(around_dispatch => \&_around_dispatch);
$app->_set_routes_attrs->_load_config->_load_pugins->_default_paths();
$app->_set_routes_attrs->_load_config->_load_pugins->_default_paths
->_add_media_types();
return $app;
}

Expand Down Expand Up @@ -164,6 +165,13 @@ sub _set_routes_attrs ($app) {
return $app;
}

# Add more media types
sub _add_media_types($app) {
$app->types->type(woff => ['application/font-woff', 'font/woff']);
$app->types->type(woff2 => ['application/font-woff2', 'font/woff2']);
return $app;
}

sub load_class ($app, $class) {
state $log = $app->log;
$log->debug("Loading $class");
Expand Down
2 changes: 1 addition & 1 deletion lib/Slovo/resources/public/css/fonts.css
Expand Up @@ -49,7 +49,7 @@ header.mui-appbar .mui--text-title, footer.mui-appbar, #sidedrawer {
}

main, main section, article {
font-family: Veleka, FreeSerif serif;
font-family: Veleka, FreeSerif, BukyvedeRegular, serif;
}

.блъгарьскъ {
Expand Down
1 change: 1 addition & 0 deletions t/005_site.t
Expand Up @@ -12,6 +12,7 @@ my $t = Test::Mojo->with_roles('+Slovo')->install(
#'.' => '/tmp/slovo'
)->new('Slovo');
my $app = $t->app;

# like in production
$app->config->{cache_pages} = 1;
my $not_found = sub {
Expand Down

0 comments on commit 7a76e5b

Please sign in to comment.