Implement AssetPack

This commit is contained in:
swaggboi 2022-08-15 18:35:30 -04:00
parent 4adc4b18b0
commit d9bf249728
10 changed files with 21 additions and 1 deletions

3
.gitignore vendored
View File

@ -38,3 +38,6 @@ inc/
/PostText.conf
/PostText.yaml
/PostText.yml
# AssetPack cache
/assets/cache/

View File

@ -14,6 +14,7 @@ use PostText::Model::Thread;
# Load Mojo plugins
plugin 'Config';
plugin 'TagHelpers::Pagination';
plugin AssetPack => {pipes => [qw{Css Combine}]};
# Helpers
helper pg => sub {
@ -96,5 +97,7 @@ if (my $threads_per_page = app->config->{'threads_per_page'}) {
app->thread->threads_per_page($threads_per_page)
}
app->asset->process('main.css', 'css/PostText.css');
# Send it
app->start();

View File

@ -24,6 +24,5 @@ Run the tests locally (against development environment)
## TODOs
1. Setup [Mojolicious::Plugin::AssetPack](https://metacpan.org/pod/Mojolicious::Plugin::AssetPack)
1. Pick a date format
1. Reply model

8
assets/assetpack.db Normal file
View File

@ -0,0 +1,8 @@
[css-min:css/PostText.css]
checksum=942e7be1d2
format=css
minified=1
[css-min:https://unpkg.com/98.css]
checksum=4f089bc53f
format=css
minified=1

1
assets/cache/98-6dcfb1396a.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.field-with-error{}

2
assets/cache/unpkg.com/98.css vendored Normal file

File diff suppressed because one or more lines are too long

1
assets/css/PostText.css Normal file
View File

@ -0,0 +1 @@
.field-with-error {}

View File

@ -1,3 +1,4 @@
requires 'Mojolicious';
requires 'Mojo::Pg';
requires 'Mojolicious::Plugin::TagHelpers::Pagination';
requires 'Mojolicious::Plugin::AssetPack';

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<title>Post::Text - <%= title %></title>
<%= asset 'main.css' %>
</head>
<body>
<h1>Post::Text</h1>