Files
fn_b/resources/views/components/app-layout.blade.php
T

66 lines
2.4 KiB
PHP
Executable File

@props([
'sTitle' => config('app.title').' - '.config('app.name'),
'sDesc' => config('app.desc'),
'sKeywords' => config('app.keywords'),
'sSlug' => '',
'sOgType' => 'website',
'sOgImg' => '/sites/'.config("app.site_code_short").'/siteimg.jpg',
'sRobots' => 'index, follow',
'bEditorialPreview' => false,
])
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="slug" content="{{ $sSlug }}">
<meta name="robots" content="{{ app()->environment('staging') ? 'noindex, nofollow' : $sRobots }}">
@php
$sTodayDate = now()->format('Y年m月d日'); //有问题?
@endphp
{{-- SEO 三杰 --}}
<title>{{ $sTitle }}</title>
<meta name="description" content="{{ $sTodayDate.$sDesc }}">
<meta name="keywords" content="{{ $sKeywords }}">
<link rel="canonical" href="{{ url()->current() }}">
{{-- 社交媒体 Meta (Open Graph) - 现在的标准配置 --}}
<meta property="og:title" content="{{ $sTitle }}">
<meta property="og:description" content="{{ $sDesc }}">
<meta property="og:type" content="{{ $sOgType }}">
<meta property="og:url" content="{{ url()->current() }}">
<meta property="og:image" content="{{ str_starts_with($sOgImg ?? '', '/') ? url($sOgImg) : $sOgImg }}">
{{-- 声明它是 PNG,并告诉浏览器它的实际尺寸 --}}
<link rel="icon" type="image/png" href="/sites/{{ config('app.site_code_short') }}/icon.png" sizes="166x166">
{{-- 强行喂给苹果,虽然它推荐 180,但 166 总比没有强 --}}
<link rel="apple-touch-icon" href="/sites/{{ config('app.site_code_short') }}/icon.png">
{{-- 暂时没错颜色切换 --}}
<meta name="theme-color" content="#ffffff">
@vite(['resources/css/app.css', "resources/sites/".config("app.site_code_short")."/css/app.css",'resources/js/app.js'])
@stack('styles')
@if(! app()->environment('staging') && ! $bEditorialPreview && config('app.site_code_short') == 'cfn')
<script defer src="https://umami.gemcook.net/script.js" data-website-id="c553e118-942e-4d6b-9e6d-9d7e696ab5fd"></script>
@endif
</head>
<body class="home blog">
<x-nav-bar />
{{ $slot }}
<x-footer />
@stack('scripts')
</body>
</html>