Browse Source

Fix manifest path.

pull/9/head
Ned Zimmerman 8 years ago
parent
commit
4427fa916e
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 2
      app/controllers/App.php
  2. 11
      app/helpers.php
  3. 1
      package.json
  4. 4
      resources/views/front-page.blade.php
  5. 4
      resources/views/page-catalog.blade.php
  6. 2
      resources/views/partials/footer.blade.php
  7. 10
      webpack.mix.js
  8. 13
      yarn.lock

2
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'));
}
}

11
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);
}

1
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",

4
resources/views/front-page.blade.php

@ -29,12 +29,12 @@
</div>
@if($previous_page)
<a class="previous" data-page="{{ $previous_page }}" href="{{ network_home_url("/page/$previous_page/#latest-titles") }}">
@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'))
</a>
@endif
@if($next_page <= $catalog_data['pages'])
<a class="next" data-page="{{ $next_page }}" href="{{ network_home_url("/page/$next_page/#latest-titles") }}">
@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'))
</a>
@endif
</div>

4
resources/views/page-catalog.blade.php

@ -50,7 +50,7 @@
</div>
@if($catalog_data['pages'] > 1)
<nav class="catalog-navigation">
@if($previous_page)<a class="previous" data-page="{{ $previous_page }}" href="{{ network_home_url("/catalog/page/$previous_page/") }}">@php(include get_theme_file_path() . '/dist/' . Aldine\svg_path('images/left-arrow.svg')) {{ __('Previous', 'aldine') }}</a>@endif
@if($previous_page)<a class="previous" data-page="{{ $previous_page }}" href="{{ network_home_url("/catalog/page/$previous_page/") }}">@php(include get_theme_file_path() . '/dist/' . Aldine\asset_dir('images/left-arrow.svg')) {{ __('Previous', 'aldine') }}</a>@endif
<div class="pages">
@for($i = 1; $i <= $catalog_data['pages']; $i++)
@if($i === $current_page)
@ -60,7 +60,7 @@
@endif
@endfor
</div>
@if($next_page <= $catalog_data['pages'])<a class="next" data-page="{{ $next_page }}" href="{{ network_home_url("/catalog/page/$next_page/") }}">{{ __('Next', 'aldine') }} @php(include get_theme_file_path() . '/dist/' . Aldine\svg_path('images/right-arrow.svg'))</a>@endif
@if($next_page <= $catalog_data['pages'])<a class="next" data-page="{{ $next_page }}" href="{{ network_home_url("/catalog/page/$next_page/") }}">{{ __('Next', 'aldine') }} @php(include get_theme_file_path() . '/dist/' . Aldine\asset_dir('images/right-arrow.svg'))</a>@endif
</nav>
@endif
</section>

2
resources/views/partials/footer.blade.php

@ -31,7 +31,7 @@
</div>
</section>
<section class="pressbooks-footer">
<a class="pressbooks-icon" href="https://pressbooks.com" title="Pressbooks">@php(include get_theme_file_path() . '/dist/' . Aldine\svg_path('images/pb.svg'))</a>
<a class="pressbooks-icon" href="https://pressbooks.com" title="Pressbooks">@php(include get_theme_file_path() . '/dist/' . Aldine\asset_dir('images/pb.svg'))</a>
<div class="pressbooks-links">
<h1><a href="https://pressbooks.com">{!! sprintf(__('Powered by %s', 'aldine'), '<span class="pressbooks">Pressbooks</span>') !!}</a></h1>
<ul>

10
webpack.mix.js

@ -61,3 +61,13 @@ if (!mix.inProduction()) {
if (mix.inProduction()) {
mix.version();
}
// Add Isotope support.
mix.webpackConfig({
resolve: {
alias: {
'masonry': 'masonry-layout',
'isotope': 'isotope-layout',
},
},
});

13
yarn.lock

@ -1606,6 +1606,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
cross-env@*:
version "5.0.5"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.0.5.tgz#4383d364d9660873dd185b398af3bfef5efffef3"
dependencies:
cross-spawn "^5.1.0"
is-windows "^1.0.0"
cross-spawn@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
@ -1613,7 +1620,7 @@ cross-spawn@^3.0.0:
lru-cache "^4.0.1"
which "^1.2.9"
cross-spawn@^5.0.1:
cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
dependencies:
@ -3808,6 +3815,10 @@ is-valid-glob@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe"
is-windows@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9"
is-zip@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-zip/-/is-zip-1.0.0.tgz#47b0a8ff4d38a76431ccfd99a8e15a4c86ba2325"

Loading…
Cancel
Save