feat(frontend): enable Livewire SPA navigation (wire:navigate)
This commit is contained in:
@@ -7,3 +7,4 @@
|
||||
<p>Powered by LaraLog · Laravel · Filament</p>
|
||||
</footer>
|
||||
</div>{{-- #outmain --}}
|
||||
@livewireScripts
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<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="stylesheet" href="{{ theme('asset', 'style.css') }}">
|
||||
@livewireStyles
|
||||
@stack('head')
|
||||
@stack('theme:head')
|
||||
</head>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<div id="outmain">
|
||||
<header id="header">
|
||||
<div class="logo">
|
||||
<a href="{{ route('home') }}">{{ $siteName }}</a>
|
||||
<a wire:navigate href="{{ route('home') }}">{{ $siteName }}</a>
|
||||
<p class="description">{{ $siteDescription }}</p>
|
||||
</div>
|
||||
@include('partials.theme-inject', ['point' => 'header'])
|
||||
<nav id="nav">
|
||||
<ul>
|
||||
<li class="{{ request()->routeIs('home') ? 'current_page_item' : '' }}"><a href="{{ route('home') }}">首页</a></li>
|
||||
<li class="{{ request()->routeIs('archives*') ? 'current_page_item' : '' }}"><a href="{{ route('archives') }}">归档</a></li>
|
||||
<li class="{{ request()->routeIs('tags*') ? 'current_page_item' : '' }}"><a href="{{ route('tags') }}">标签</a></li>
|
||||
<li class="{{ request()->routeIs('links') ? 'current_page_item' : '' }}"><a href="{{ route('links') }}">友链</a></li>
|
||||
<li class="{{ request()->routeIs('comments') ? 'current_page_item' : '' }}"><a href="{{ route('comments') }}">评论</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 wire:navigate href="{{ route('archives') }}">归档</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 wire:navigate href="{{ route('links') }}">友链</a></li>
|
||||
<li class="{{ request()->routeIs('comments') ? 'current_page_item' : '' }}"><a wire:navigate href="{{ route('comments') }}">评论</a></li>
|
||||
@include('partials.feed-links', ['asList' => true])
|
||||
@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])
|
||||
<li>
|
||||
<form action="{{ route('logout') }}" method="post" class="inline-form">
|
||||
@@ -23,8 +23,8 @@
|
||||
</form>
|
||||
</li>
|
||||
@else
|
||||
<li><a href="{{ route('login') }}">登录</a></li>
|
||||
<li><a href="{{ route('register') }}">注册</a></li>
|
||||
<li><a wire:navigate href="{{ route('login') }}">登录</a></li>
|
||||
<li><a wire:navigate href="{{ route('register') }}">注册</a></li>
|
||||
@endauth
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<h3>分类</h3>
|
||||
<ul>
|
||||
@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
|
||||
<li>暂无分类</li>
|
||||
@endforelse
|
||||
@@ -22,7 +22,7 @@
|
||||
<h3>最新文章</h3>
|
||||
<ul>
|
||||
@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
|
||||
<li>暂无文章</li>
|
||||
@endforelse
|
||||
@@ -33,7 +33,7 @@
|
||||
<h3>最新评论</h3>
|
||||
<ul>
|
||||
@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
|
||||
<li>暂无评论</li>
|
||||
@endforelse
|
||||
@@ -44,7 +44,7 @@
|
||||
<h3>标签</h3>
|
||||
<p class="tagcloud">
|
||||
@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
|
||||
暂无标签
|
||||
@endforelse
|
||||
|
||||
Reference in New Issue
Block a user