Files
gouki 3cec4c5e18
CI / PHPUnit (PHP 8.3) (push) Failing after 4s
CI / PHPUnit (PHP 8.2) (push) Failing after 1m9s
CI / Deploy (manual gate) (push) Skipped
wip: article AI polish, category SEO fields, cover generator, membership plan seeder
2026-09-07 18:48:37 +00:00

119 lines
5.1 KiB
PHP

@php
$themeManager = app(\App\Domain\Theme\ThemeManager::class);
$activeTheme = $themeManager->active();
$stylevars = \App\Models\Stylevar::query()->visible()->orderBy('id')->get();
@endphp
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>{{ $seo['title'] ?? ($settings->site_name ?? config('app.name')) }}</title>
@if(!empty($seo['canonical']))
<link rel="canonical" href="{{ $seo['canonical'] }}">
@endif
@if(!empty($seo['description']))
<meta name="description" content="{{ $seo['description'] }}">
@endif
@if(!empty($seo['keywords']))
<meta name="keywords" content="{{ $seo['keywords'] }}">
@endif
@foreach(($seo['og'] ?? []) as $property => $content)
<meta property="{{ $property }}" content="{{ $content }}">
@endforeach
@foreach(($seo['twitter'] ?? []) as $name => $content)
<meta name="{{ $name }}" content="{{ $content }}">
@endforeach
@if(!empty($seo['jsonld']))
<script type="application/ld+json">{!! json_encode($seo['jsonld'], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) !!}</script>
@endif
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ url('/rss.xml') }}">
<link rel="stylesheet" href="{{ $themeManager->assetUrl('style.css') }}?v={{ @filemtime(base_path('themes/'.$activeTheme.'/assets/style.css')) }}">
@stack('head')
@themeslot('head')
</head>
<body data-theme="{{ $activeTheme }}">
@themeslot('body_start')
<header class="site-header">
<div class="wrap">
<div class="brand-block">
<a class="brand" href="{{ url('/') }}">{{ $settings->site_name ?? 'Lara' }}<span>Blog</span></a>
<p class="tagline">{{ $settings->site_description ?: '写作、归档与发现——现代博客引擎' }}</p>
</div>
<nav class="nav-bar" aria-label="{{ __('frontend.nav.home') }}">
<a href="{{ url('/') }}">{{ __('frontend.nav.home') }}</a>
<a href="{{ url('/archives.shtml') }}">{{ __('frontend.nav.archives') }}</a>
<a href="{{ url('/tagslist.shtml') }}">{{ __('frontend.nav.tags') }}</a>
<a href="{{ url('/comments.shtml') }}">{{ __('frontend.nav.comments') }}</a>
<a href="{{ url('/links.shtml') }}">{{ __('frontend.nav.links') }}</a>
<a href="{{ url('/search.shtml') }}">{{ __('frontend.nav.search') }}</a>
@auth
<a href="{{ url('/index.php?action=profile') }}">{{ __('frontend.nav.profile') }}</a>
@else
<a href="{{ url('/login.shtml') }}">{{ __('frontend.nav.login') }}</a>
<a href="{{ url('/reg.shtml') }}">{{ __('frontend.nav.register') }}</a>
@endauth
</nav>
@themeslot('nav_after')
@if(session('status'))
<p class="flash">{{ session('status') }}</p>
@endif
</div>
</header>
@themeslot('header_after')
<main class="wrap layout">
<section class="content">
@themeslot('content_before')
@yield('content')
@themeslot('content_after')
</section>
<aside class="sidebar">
@themeslot('sidebar_before')
<div class="panel">
<h3>{{ __('frontend.sidebar.categories') }}</h3>
<ul>
@forelse(($categories ?? []) as $category)
<li>
<a href="{{ $category->publicUrl() }}">{{ $category->name }}</a>
@if((int) $category->articles_count > 0)
<span class="meta">({{ $category->articles_count }})</span>
@endif
</li>
@empty
<li class="note">{{ __('frontend.sidebar.empty_category') }}</li>
@endforelse
</ul>
</div>
@foreach($stylevars as $stylevar)
<div class="panel">
<h3>{{ $stylevar->title }}</h3>
<p class="note">{!! nl2br(e($stylevar->value)) !!}</p>
</div>
@endforeach
@php($sidebarInject = trim(\App\Domain\Theme\ThemeSlot::render('sidebar')))
@if($sidebarInject !== '')
<div class="panel theme-slot-sidebar">
{!! $sidebarInject !!}
</div>
@endif
@php($sidebarAfter = trim(\App\Domain\Theme\ThemeSlot::render('sidebar_after')))
@if($sidebarAfter !== '')
<div class="panel theme-slot-sidebar-after">
{!! $sidebarAfter !!}
</div>
@endif
<div class="panel">
<h3>{{ __('frontend.sidebar.subscribe') }}</h3>
<p class="note"><a href="{{ url('/rss.xml') }}">RSS</a> · <a href="{{ url('/sitemap.xml') }}">Sitemap</a> · <a href="{{ url('/llms.txt') }}">llms.txt</a></p>
</div>
</aside>
</main>
@themeslot('footer_before')
<footer class="site-footer wrap">
<p>&copy; {{ date('Y') }} {{ $settings->site_name ?? 'LaraBlog' }} · {{ __('frontend.common.theme') }} {{ $activeTheme }}</p>
</footer>
@themeslot('footer_after')
@themeslot('body_end')
</body>
</html>