cognetif / kirby-blade-mix
Mix Directive for Kirby Blade Templating
Installs: 128
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
pkg:composer/cognetif/kirby-blade-mix
Requires
- ext-json: *
This package is auto-updated.
Last update: 2024-02-26 14:51:06 UTC
README
This project adds a @mixcss
and @mixjs
directive available for use in Blade templating when using the afbora/kirby-blade templating plugin.
Installation
To install, simply require with composer:
$ composer require cognetif/kirby-blade-mix
Add the following to your Kirby config file:
'afbora.blade.directives' => [
'mixjs' => function ($file)
{
return "<?= \Cognetif\Kirby\Mix\Mix::Js({$file}) ?>";
},
'mixcss' => function ($file) {
return "<?= \Cognetif\Kirby\Mix\Mix::Css({$file}) ?>";
}
]
Then you can use the directive in your blade templates such as:
<head>
@mixcss('/assets/main.css');
</head>
<!-- ... -->
<body>
@mixjs('/assets/main.js');
</body>
Mix Manifest Json
The directive assumes your mix-manifest.json
is in the $kirby->root('index')
path, otherwise known as your public folder with the main site index.php
file.