This commit is contained in:
Pig Fang 2020-05-21 11:35:27 +08:00
parent cccaef302a
commit 24d3a2e50a
2 changed files with 4 additions and 10 deletions

View File

@ -83,12 +83,10 @@ class HeadComposer
{
$links = [];
$links[] = [
'rel' => 'preload',
'as' => 'style',
'rel' => 'stylesheet',
'href' => 'https://cdn.jsdelivr.net/npm/@blessing-skin/admin-lte@3.0.4/dist/admin-lte.min.css',
'integrity' => 'sha256-nr8InsK/i0Skb3n3yHCVwEnsmblkae4Rs9aFJ4/JTWE=',
'crossorigin' => 'anonymous',
'onload' => "this.rel = 'stylesheet'",
];
$links[] = [
'rel' => 'preload',
@ -103,20 +101,16 @@ class HeadComposer
'crossorigin' => 'anonymous',
];
$links[] = [
'rel' => 'preload',
'as' => 'style',
'rel' => 'stylesheet',
'href' => 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all.min.css',
'integrity' => 'sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=',
'crossorigin' => 'anonymous',
'onload' => "this.rel = 'stylesheet'",
];
if (!$this->request->is('/')) {
$links[] = [
'rel' => 'preload',
'as' => 'style',
'rel' => 'stylesheet',
'href' => $this->webpack->url('style.css'),
'crossorigin' => 'anonymous',
'onload' => "this.rel = 'stylesheet'",
];
}
$view->with('links', $links);

View File

@ -2,7 +2,7 @@
<html lang="{{ locale }}">
<head>
{{ include('shared.head') }}
<link rel="preload" as="style" href="{{ home_page_css }}" crossorigin="anonymous" onload="this.rel = 'stylesheet'">
<link rel="stylesheet" href="{{ home_page_css }}" crossorigin="anonymous">
<link rel="preload" as="image" href="{{ home_pic_url }}">
<title>{{ site_name }}</title>
<style>