diff --git a/app/controllers/App.php b/app/controllers/App.php
index ef82d2d..419d5ce 100644
--- a/app/controllers/App.php
+++ b/app/controllers/App.php
@@ -12,7 +12,7 @@ class App extends Controller
if (has_custom_logo()) {
return wp_get_attachment_image($custom_logo_id, 'original');
} else {
- return file_get_contents(get_theme_file_path() . '/dist/' . svg_path('images/logo.svg'));
+ return file_get_contents(get_theme_file_path() . '/dist/' . asset_dir('images/logo.svg'));
}
}
diff --git a/app/helpers.php b/app/helpers.php
index 442f2f3..b89c869 100644
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -76,16 +76,16 @@ function template_path($file, $data = [])
*/
function asset_path($asset)
{
- return sage('assets')->getUri($asset);
+ return fix_path(sage('assets')->getUri('/' . $asset));
}
/**
* @param $asset
* @return string
*/
-function svg_path($asset)
+function asset_dir($asset)
{
- return sage('assets')->get($asset);
+ return fix_path(sage('assets')->get('/' . $asset));
}
/**
@@ -195,3 +195,8 @@ function contact_form_submission()
}
return false;
}
+
+function fix_path($path)
+{
+ return str_replace('/dist//', '/dist/', $path);
+}
diff --git a/package.json b/package.json
index c35f4b3..5da3e4c 100644
--- a/package.json
+++ b/package.json
@@ -91,6 +91,7 @@
"devDependencies": {
"browser-sync": "^2.18.13",
"browser-sync-webpack-plugin": "^1.2.0",
+ "cross-env": "*",
"eslint": "~4.2",
"eslint-loader": "~1.9",
"eslint-plugin-import": "~2.7",
diff --git a/resources/views/front-page.blade.php b/resources/views/front-page.blade.php
index f4090b5..00730cf 100644
--- a/resources/views/front-page.blade.php
+++ b/resources/views/front-page.blade.php
@@ -29,12 +29,12 @@
@if($previous_page)
- @php(include get_theme_file_path() . '/dist/' . Aldine\svg_path('images/left-arrow.svg'))
+ @php(include get_theme_file_path() . '/dist/' . Aldine\asset_dir('images/left-arrow.svg'))
@endif
@if($next_page <= $catalog_data['pages'])
- @php(include get_theme_file_path() . '/dist/' . Aldine\svg_path('images/right-arrow.svg'))
+ @php(include get_theme_file_path() . '/dist/' . Aldine\asset_dir('images/right-arrow.svg'))
@endif
diff --git a/resources/views/page-catalog.blade.php b/resources/views/page-catalog.blade.php
index fbb9baa..8a65c8f 100644
--- a/resources/views/page-catalog.blade.php
+++ b/resources/views/page-catalog.blade.php
@@ -50,7 +50,7 @@
@if($catalog_data['pages'] > 1)
@endif
diff --git a/resources/views/partials/footer.blade.php b/resources/views/partials/footer.blade.php
index c4d04f4..6aedce9 100644
--- a/resources/views/partials/footer.blade.php
+++ b/resources/views/partials/footer.blade.php
@@ -31,7 +31,7 @@