Log1x / blade-svg-sage

A simple package to add support for Blade SVG by Adam Wathan to Roots Sage.
MIT License
73 stars 13 forks source link

Path issues after update #6

Closed strarsis closed 7 years ago

strarsis commented 7 years ago

This may be related to https://github.com/Log1x/blade-svg-sage/issues/5.

After updating blade-svg-sage to latest (using composer), the file isn't found anymore: /dist/images/svg/icons not found.

Do I have to adjust the code?

Log1x commented 7 years ago

The path was changed to be 1:1 with the original blade-svg.

You can use the following filter to change it:

add_filter('bladesvg_image_path', function () {
    return parse_asset_path('images/svg/icons');
});
strarsis commented 7 years ago

@Log1x: The 'bladesvg_image_path' filter doesn't seem to work.

add_filter('bladesvg_image_path', function () {
    return parse_asset_path('images/icons');
});

parse_asset_path returns '/dist/images/svg/icons' instead the filtered '/dist/images/icons'.

    function parse_asset_path($asset)
    {
        [...]
        return trailingslashit(\App\config('theme')['dir']) . trailingslashit('dist') . \App\sage('assets')->get($asset);
    }