feat(frontend): enable Livewire SPA navigation (wire:navigate)
Build and Deploy / verify (push) Failing after 39m48s
Build and Deploy / deploy (push) Skipped

This commit is contained in:
2026-10-12 12:30:58 +00:00
parent b062e09db0
commit 6adfacc4e5
23 changed files with 58 additions and 58 deletions
+2 -2
View File
@@ -12,11 +12,11 @@
<ul class="archive-list"> <ul class="archive-list">
@foreach($months as $month => $monthPosts) @foreach($months as $month => $monthPosts)
<li> <li>
<a href="{{ route('archives.month', $year.$month) }}">{{ (int) $month }} 月</a> <a wire:navigate href="{{ route('archives.month', $year.$month) }}">{{ (int) $month }} 月</a>
<span class="count">({{ $monthPosts->count() }} 篇)</span> <span class="count">({{ $monthPosts->count() }} 篇)</span>
<ul class="archive-posts"> <ul class="archive-posts">
@foreach($monthPosts as $post) @foreach($monthPosts as $post)
<li><a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a> <time>{{ $post->published_at->format(blog_setting('listtime', 'm-d')) }}</time></li> <li><a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a> <time>{{ $post->published_at->format(blog_setting('listtime', 'm-d')) }}</time></li>
@endforeach @endforeach
</ul> </ul>
</li> </li>
+1 -1
View File
@@ -10,7 +10,7 @@
<div class="comment" id="comment-{{ $comment->id }}"> <div class="comment" id="comment-{{ $comment->id }}">
<div class="comment-head"> <div class="comment-head">
<strong>{{ $comment->author_name }}</strong> <strong>{{ $comment->author_name }}</strong>
<span>· 评论于 <a href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->post->title }}</a></span> <span>· 评论于 <a wire:navigate href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->post->title }}</a></span>
<span class="comment-time">· {{ $comment->created_at->format(blog_setting('comment_timeformat', 'Y-m-d H:i')) }}</span> <span class="comment-time">· {{ $comment->created_at->format(blog_setting('comment_timeformat', 'Y-m-d H:i')) }}</span>
</div> </div>
<div class="comment-body">{!! nl2br(e($comment->content)) !!}</div> <div class="comment-body">{!! nl2br(e($comment->content)) !!}</div>
+1 -1
View File
@@ -21,7 +21,7 @@
@error('email')<p class="error">{{ $message }}</p>@enderror @error('email')<p class="error">{{ $message }}</p>@enderror
<button type="submit" class="btn btn-primary">登录</button> <button type="submit" class="btn btn-primary">登录</button>
</form> </form>
<p class="auth-alt">还没有账号?<a href="{{ route('register') }}">立即注册</a></p> <p class="auth-alt">还没有账号?<a wire:navigate href="{{ route('register') }}">立即注册</a></p>
</main> </main>
</div> </div>
@include('partials.footer') @include('partials.footer')
+2 -2
View File
@@ -13,7 +13,7 @@
<div class="alert alert-error">你还不是会员,开通后可解锁会员专享文章。</div> <div class="alert alert-error">你还不是会员,开通后可解锁会员专享文章。</div>
@endif @endif
@else @else
<div class="alert alert-error">请先 <a href="{{ route('login') }}">登录</a> 后购买会员。</div> <div class="alert alert-error">请先 <a wire:navigate href="{{ route('login') }}">登录</a> 后购买会员。</div>
@endauth @endauth
<div class="plans-grid" style="display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;"> <div class="plans-grid" style="display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;">
@@ -35,7 +35,7 @@
@endforelse @endforelse
</div> </div>
<p style="margin-top:16px;"><a href="{{ route('membership.mine') }}">查看我的订阅</a></p> <p style="margin-top:16px;"><a wire:navigate href="{{ route('membership.mine') }}">查看我的订阅</a></p>
</main> </main>
@include('partials.sidebar') @include('partials.sidebar')
</div> </div>
+1 -1
View File
@@ -21,7 +21,7 @@
</div> </div>
</div> </div>
@empty @empty
<div class="empty">暂无订阅记录,<a href="{{ route('membership.index') }}">去开通会员</a></div> <div class="empty">暂无订阅记录,<a wire:navigate href="{{ route('membership.index') }}">去开通会员</a></div>
@endforelse @endforelse
</main> </main>
@include('partials.sidebar') @include('partials.sidebar')
@@ -11,9 +11,9 @@
<button type="submit" class="btn btn-primary">单篇解锁 ¥{{ number_format($price / 100, 2) }}</button> <button type="submit" class="btn btn-primary">单篇解锁 ¥{{ number_format($price / 100, 2) }}</button>
</form> </form>
@else @else
<a href="{{ route('membership.index') }}" class="btn btn-primary">开通会员</a> <a wire:navigate href="{{ route('membership.index') }}" class="btn btn-primary">开通会员</a>
@endif @endif
@else @else
<a href="{{ route('login') }}" class="btn btn-primary">登录后查看</a> <a wire:navigate href="{{ route('login') }}" class="btn btn-primary">登录后查看</a>
@endauth @endauth
</div> </div>
+2 -2
View File
@@ -41,11 +41,11 @@
</form> </form>
@endif @endif
@if($plansExist) @if($plansExist)
<a href="{{ route('membership.index') }}" class="btn">开通会员</a> <a wire:navigate href="{{ route('membership.index') }}" class="btn">开通会员</a>
@endif @endif
@endif @endif
@else @else
<a href="{{ route('login') }}" class="btn btn-primary">登录后解锁</a> <a wire:navigate href="{{ route('login') }}" class="btn btn-primary">登录后解锁</a>
@endauth @endauth
</div> </div>
</div> </div>
+9 -9
View File
@@ -1,31 +1,31 @@
<header class="site-header"> <header class="site-header">
<div class="container"> <div class="container">
<div class="site-brand"> <div class="site-brand">
<a href="{{ route('home') }}" class="site-title">{{ $siteName }}</a> <a wire:navigate href="{{ route('home') }}" class="site-title">{{ $siteName }}</a>
@if($siteDescription) @if($siteDescription)
<p class="site-desc">{{ $siteDescription }}</p> <p class="site-desc">{{ $siteDescription }}</p>
@endif @endif
</div> </div>
<nav class="site-nav"> <nav class="site-nav">
<a href="{{ route('home') }}" class="{{ request()->routeIs('home') ? 'active' : '' }}">首页</a> <a wire:navigate href="{{ route('home') }}" class="{{ request()->routeIs('home') ? 'active' : '' }}">首页</a>
<a href="{{ route('archives') }}" class="{{ request()->routeIs('archives*') ? 'active' : '' }}">归档</a> <a wire:navigate href="{{ route('archives') }}" class="{{ request()->routeIs('archives*') ? 'active' : '' }}">归档</a>
<a href="{{ route('tags') }}" class="{{ request()->routeIs('tags*') ? 'active' : '' }}">标签</a> <a wire:navigate href="{{ route('tags') }}" class="{{ request()->routeIs('tags*') ? 'active' : '' }}">标签</a>
<a href="{{ route('links') }}" class="{{ request()->routeIs('links') ? 'active' : '' }}">友链</a> <a wire:navigate href="{{ route('links') }}" class="{{ request()->routeIs('links') ? 'active' : '' }}">友链</a>
<a href="{{ route('comments') }}" class="{{ request()->routeIs('comments') ? 'active' : '' }}">评论</a> <a wire:navigate href="{{ route('comments') }}" class="{{ request()->routeIs('comments') ? 'active' : '' }}">评论</a>
@include('partials.feed-links') @include('partials.feed-links')
<form class="site-search" action="{{ route('search') }}" method="get"> <form class="site-search" action="{{ route('search') }}" method="get">
<input type="search" name="q" placeholder="搜索..." value="{{ request('q', request('keyword', '')) }}"> <input type="search" name="q" placeholder="搜索..." value="{{ request('q', request('keyword', '')) }}">
</form> </form>
@auth @auth
<a href="{{ route('profile') }}">{{ auth()->user()->name }}</a> <a wire:navigate href="{{ route('profile') }}">{{ auth()->user()->name }}</a>
@include('partials.admin-link') @include('partials.admin-link')
<form action="{{ route('logout') }}" method="post" class="inline-form"> <form action="{{ route('logout') }}" method="post" class="inline-form">
@csrf @csrf
<button type="submit" class="link-btn">退出</button> <button type="submit" class="link-btn">退出</button>
</form> </form>
@else @else
<a href="{{ route('login') }}">登录</a> <a wire:navigate href="{{ route('login') }}">登录</a>
<a href="{{ route('register') }}">注册</a> <a wire:navigate href="{{ route('register') }}">注册</a>
@endauth @endauth
</nav> </nav>
</div> </div>
@@ -5,7 +5,7 @@
@if ($paginator->onFirstPage()) @if ($paginator->onFirstPage())
<span class="disabled">&laquo;</span> <span class="disabled">&laquo;</span>
@else @else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a> <a wire:navigate href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a>
@endif @endif
@foreach ($elements as $element) @foreach ($elements as $element)
@@ -17,14 +17,14 @@
@if ($page == $paginator->currentPage()) @if ($page == $paginator->currentPage())
<span class="current">{{ $page }}</span> <span class="current">{{ $page }}</span>
@else @else
<a href="{{ $url }}">{{ $page }}</a> <a wire:navigate href="{{ $url }}">{{ $page }}</a>
@endif @endif
@endforeach @endforeach
@endif @endif
@endforeach @endforeach
@if ($paginator->hasMorePages()) @if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}" rel="next">&raquo;</a> <a wire:navigate href="{{ $paginator->nextPageUrl() }}" rel="next">&raquo;</a>
@else @else
<span class="disabled">&raquo;</span> <span class="disabled">&raquo;</span>
@endif @endif
+5 -5
View File
@@ -6,19 +6,19 @@
@endphp @endphp
<article class="post-card {{ $post->isPinned() ? 'sticky' : '' }} post-card-{{ $viewMode }}"> <article class="post-card {{ $post->isPinned() ? 'sticky' : '' }} post-card-{{ $viewMode }}">
@if($url = $post->coverImageUrl()) @if($url = $post->coverImageUrl())
<a href="{{ route('posts.show', $post->id) }}" class="post-cover"> <a wire:navigate href="{{ route('posts.show', $post->id) }}" class="post-cover">
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy"> <img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
</a> </a>
@endif @endif
<h2 class="post-title"> <h2 class="post-title">
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif @if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
<a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a> <a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
</h2> </h2>
<div class="post-meta"> <div class="post-meta">
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time> <time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time>
@if($post->category) @if($post->category)
<span>·</span> <span>·</span>
<a href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a> <a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
@endif @endif
<span>· 阅读 {{ $post->views }}</span> <span>· 阅读 {{ $post->views }}</span>
<span>· 评论 {{ $post->comment_count }}</span> <span>· 评论 {{ $post->comment_count }}</span>
@@ -33,9 +33,9 @@
</div> </div>
@endif @endif
<div class="post-footer"> <div class="post-footer">
<a href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 &raquo;</a> <a wire:navigate href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 &raquo;</a>
@foreach($post->tags as $tag) @foreach($post->tags as $tag)
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a> <a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
@endforeach @endforeach
</div> </div>
</article> </article>
+4 -4
View File
@@ -5,7 +5,7 @@
<ul class="widget-list"> <ul class="widget-list">
@forelse($categories as $category) @forelse($categories as $category)
<li> <li>
<a href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a> <a wire:navigate href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a>
<span class="count">({{ $category->post_count }})</span> <span class="count">({{ $category->post_count }})</span>
</li> </li>
@empty @empty
@@ -18,7 +18,7 @@
<h3 class="widget-title">最新文章</h3> <h3 class="widget-title">最新文章</h3>
<ul class="widget-list"> <ul class="widget-list">
@forelse($recentPosts as $post) @forelse($recentPosts as $post)
<li><a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li> <li><a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li>
@empty @empty
<li>暂无文章</li> <li>暂无文章</li>
@endforelse @endforelse
@@ -30,7 +30,7 @@
<ul class="widget-list"> <ul class="widget-list">
@forelse($recentComments as $comment) @forelse($recentComments as $comment)
<li> <li>
<a href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}"> <a wire:navigate href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">
{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 30) }} {{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 30) }}
</a> </a>
</li> </li>
@@ -44,7 +44,7 @@
<h3 class="widget-title">标签云</h3> <h3 class="widget-title">标签云</h3>
<div class="tag-cloud"> <div class="tag-cloud">
@forelse($hotTags as $tag) @forelse($hotTags as $tag)
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link">{{ $tag->name }}</a> <a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">{{ $tag->name }}</a>
@empty @empty
<span>暂无标签</span> <span>暂无标签</span>
@endforelse @endforelse
+1 -1
View File
@@ -14,7 +14,7 @@
@endif @endif
<p><strong>商品:</strong>{{ $payment->subject }}</p> <p><strong>商品:</strong>{{ $payment->subject }}</p>
<p><strong>金额:</strong>¥{{ number_format($payment->amount / 100, 2) }}</p> <p><strong>金额:</strong>¥{{ number_format($payment->amount / 100, 2) }}</p>
<p class="auth-alt"><a href="{{ route('home') }}">返回首页</a></p> <p class="auth-alt"><a wire:navigate href="{{ route('home') }}">返回首页</a></p>
</main> </main>
</div> </div>
@include('partials.footer') @include('partials.footer')
+1 -1
View File
@@ -16,7 +16,7 @@
@csrf @csrf
<button type="submit" class="btn btn-primary">确认支付(模拟)</button> <button type="submit" class="btn btn-primary">确认支付(模拟)</button>
</form> </form>
<p class="auth-alt"><a href="{{ route('home') }}">取消,返回首页</a></p> <p class="auth-alt"><a wire:navigate href="{{ route('home') }}">取消,返回首页</a></p>
</main> </main>
</div> </div>
@include('partials.footer') @include('partials.footer')
+1 -1
View File
@@ -18,7 +18,7 @@
<p><a href="{{ url('/admin') }}" target="_blank" rel="noopener">进入后台管理</a></p> <p><a href="{{ url('/admin') }}" target="_blank" rel="noopener">进入后台管理</a></p>
@endif @endif
</div> </div>
<p><a href="{{ route('home') }}">&laquo; 返回首页</a></p> <p><a wire:navigate href="{{ route('home') }}">&laquo; 返回首页</a></p>
</main> </main>
@include('partials.sidebar') @include('partials.sidebar')
</div> </div>
+1 -1
View File
@@ -32,7 +32,7 @@
</div> </div>
<button type="submit" class="btn btn-primary">注册</button> <button type="submit" class="btn btn-primary">注册</button>
</form> </form>
<p class="auth-alt">已有账号?<a href="{{ route('login') }}">去登录</a></p> <p class="auth-alt">已有账号?<a wire:navigate href="{{ route('login') }}">去登录</a></p>
</main> </main>
</div> </div>
@include('partials.footer') @include('partials.footer')
+2 -2
View File
@@ -45,7 +45,7 @@
@endif @endif
@if($post->author)<span>· {{ $post->author->name }}</span>@endif @if($post->author)<span>· {{ $post->author->name }}</span>@endif
@if($post->category) @if($post->category)
<span>· <a href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a></span> <span>· <a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a></span>
@endif @endif
<span>· 阅读 {{ $post->views }}</span> <span>· 阅读 {{ $post->views }}</span>
</div> </div>
@@ -59,7 +59,7 @@
@if($post->tags->isNotEmpty()) @if($post->tags->isNotEmpty())
<div class="post-tags"> <div class="post-tags">
@foreach($post->tags as $tag) @foreach($post->tags as $tag)
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a> <a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
@endforeach @endforeach
</div> </div>
@endif @endif
+1 -1
View File
@@ -7,7 +7,7 @@
<h1 class="list-title">全部标签</h1> <h1 class="list-title">全部标签</h1>
<div class="tag-cloud big"> <div class="tag-cloud big">
@forelse($tags as $tag) @forelse($tags as $tag)
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link" style="font-size: {{ max(0.9, min(1.8, 0.9 + $tag->posts_count * 0.1)) }}em"> <a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link" style="font-size: {{ max(0.9, min(1.8, 0.9 + $tag->posts_count * 0.1)) }}em">
{{ $tag->name }} ({{ $tag->posts_count }}) {{ $tag->name }} ({{ $tag->posts_count }})
</a> </a>
@empty @empty
+2 -4
View File
@@ -31,16 +31,14 @@
Dashboard Dashboard
</a> </a>
@else @else
<a <a wire:navigate href="{{ route('login') }}"
href="{{ route('login') }}"
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] text-[#1b1b18] border border-transparent hover:border-[#19140035] dark:hover:border-[#3E3E3A] rounded-sm text-sm leading-normal" class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] text-[#1b1b18] border border-transparent hover:border-[#19140035] dark:hover:border-[#3E3E3A] rounded-sm text-sm leading-normal"
> >
Log in Log in
</a> </a>
@if (Route::has('register')) @if (Route::has('register'))
<a <a wire:navigate href="{{ route('register') }}"
href="{{ route('register') }}"
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] border-[#19140035] hover:border-[#1915014a] border text-[#1b1b18] dark:border-[#3E3E3A] dark:hover:border-[#62605b] rounded-sm text-sm leading-normal"> class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] border-[#19140035] hover:border-[#1915014a] border text-[#1b1b18] dark:border-[#3E3E3A] dark:hover:border-[#62605b] rounded-sm text-sm leading-normal">
Register Register
</a> </a>
@@ -7,3 +7,4 @@
<p>Powered by LaraLog · Laravel · Filament</p> <p>Powered by LaraLog · Laravel · Filament</p>
</footer> </footer>
</div>{{-- #outmain --}} </div>{{-- #outmain --}}
@livewireScripts
@@ -14,6 +14,7 @@
<link rel="alternate" type="application/rss+xml" title="{{ $siteName }}" href="{{ route('feed.rss') }}"> <link rel="alternate" type="application/rss+xml" title="{{ $siteName }}" href="{{ route('feed.rss') }}">
<link rel="alternate" type="text/plain" title="llms.txt" href="{{ route('feed.llms') }}"> <link rel="alternate" type="text/plain" title="llms.txt" href="{{ route('feed.llms') }}">
<link rel="stylesheet" href="{{ theme('asset', 'style.css') }}"> <link rel="stylesheet" href="{{ theme('asset', 'style.css') }}">
@livewireStyles
@stack('head') @stack('head')
@stack('theme:head') @stack('theme:head')
</head> </head>
@@ -1,20 +1,20 @@
<div id="outmain"> <div id="outmain">
<header id="header"> <header id="header">
<div class="logo"> <div class="logo">
<a href="{{ route('home') }}">{{ $siteName }}</a> <a wire:navigate href="{{ route('home') }}">{{ $siteName }}</a>
<p class="description">{{ $siteDescription }}</p> <p class="description">{{ $siteDescription }}</p>
</div> </div>
@include('partials.theme-inject', ['point' => 'header']) @include('partials.theme-inject', ['point' => 'header'])
<nav id="nav"> <nav id="nav">
<ul> <ul>
<li class="{{ request()->routeIs('home') ? 'current_page_item' : '' }}"><a href="{{ route('home') }}">首页</a></li> <li class="{{ request()->routeIs('home') ? 'current_page_item' : '' }}"><a wire:navigate href="{{ route('home') }}">首页</a></li>
<li class="{{ request()->routeIs('archives*') ? 'current_page_item' : '' }}"><a href="{{ route('archives') }}">归档</a></li> <li class="{{ request()->routeIs('archives*') ? 'current_page_item' : '' }}"><a wire:navigate href="{{ route('archives') }}">归档</a></li>
<li class="{{ request()->routeIs('tags*') ? 'current_page_item' : '' }}"><a href="{{ route('tags') }}">标签</a></li> <li class="{{ request()->routeIs('tags*') ? 'current_page_item' : '' }}"><a wire:navigate href="{{ route('tags') }}">标签</a></li>
<li class="{{ request()->routeIs('links') ? 'current_page_item' : '' }}"><a href="{{ route('links') }}">友链</a></li> <li class="{{ request()->routeIs('links') ? 'current_page_item' : '' }}"><a wire:navigate href="{{ route('links') }}">友链</a></li>
<li class="{{ request()->routeIs('comments') ? 'current_page_item' : '' }}"><a href="{{ route('comments') }}">评论</a></li> <li class="{{ request()->routeIs('comments') ? 'current_page_item' : '' }}"><a wire:navigate href="{{ route('comments') }}">评论</a></li>
@include('partials.feed-links', ['asList' => true]) @include('partials.feed-links', ['asList' => true])
@auth @auth
<li><a href="{{ route('profile') }}">{{ auth()->user()->name }}</a></li> <li><a wire:navigate href="{{ route('profile') }}">{{ auth()->user()->name }}</a></li>
@include('partials.admin-link', ['asList' => true]) @include('partials.admin-link', ['asList' => true])
<li> <li>
<form action="{{ route('logout') }}" method="post" class="inline-form"> <form action="{{ route('logout') }}" method="post" class="inline-form">
@@ -23,8 +23,8 @@
</form> </form>
</li> </li>
@else @else
<li><a href="{{ route('login') }}">登录</a></li> <li><a wire:navigate href="{{ route('login') }}">登录</a></li>
<li><a href="{{ route('register') }}">注册</a></li> <li><a wire:navigate href="{{ route('register') }}">注册</a></li>
@endauth @endauth
</ul> </ul>
</nav> </nav>
@@ -11,7 +11,7 @@
<h3>分类</h3> <h3>分类</h3>
<ul> <ul>
@forelse($categories as $category) @forelse($categories as $category)
<li><a href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a> ({{ $category->post_count }})</li> <li><a wire:navigate href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a> ({{ $category->post_count }})</li>
@empty @empty
<li>暂无分类</li> <li>暂无分类</li>
@endforelse @endforelse
@@ -22,7 +22,7 @@
<h3>最新文章</h3> <h3>最新文章</h3>
<ul> <ul>
@forelse($recentPosts as $post) @forelse($recentPosts as $post)
<li><a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li> <li><a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li>
@empty @empty
<li>暂无文章</li> <li>暂无文章</li>
@endforelse @endforelse
@@ -33,7 +33,7 @@
<h3>最新评论</h3> <h3>最新评论</h3>
<ul> <ul>
@forelse($recentComments as $comment) @forelse($recentComments as $comment)
<li><a href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 20) }}</a></li> <li><a wire:navigate href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 20) }}</a></li>
@empty @empty
<li>暂无评论</li> <li>暂无评论</li>
@endforelse @endforelse
@@ -44,7 +44,7 @@
<h3>标签</h3> <h3>标签</h3>
<p class="tagcloud"> <p class="tagcloud">
@forelse($hotTags as $tag) @forelse($hotTags as $tag)
<a href="{{ route('tags.show', $tag->name) }}">{{ $tag->name }}</a> <a wire:navigate href="{{ route('tags.show', $tag->name) }}">{{ $tag->name }}</a>
@empty @empty
暂无标签 暂无标签
@endforelse @endforelse
+2 -2
View File
@@ -43,7 +43,7 @@
@endif @endif
@if($post->author)<span>· {{ $post->author->name }}</span>@endif @if($post->author)<span>· {{ $post->author->name }}</span>@endif
@if($post->category) @if($post->category)
<span>· <a href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a></span> <span>· <a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a></span>
@endif @endif
<span>· 阅读 {{ $post->views }}</span> <span>· 阅读 {{ $post->views }}</span>
</div> </div>
@@ -57,7 +57,7 @@
@if($post->tags->isNotEmpty()) @if($post->tags->isNotEmpty())
<div class="post-tags"> <div class="post-tags">
@foreach($post->tags as $tag) @foreach($post->tags as $tag)
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a> <a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
@endforeach @endforeach
</div> </div>
@endif @endif