category.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {{-- resources/views/blog/category.blade.php --}}
  2. @extends('blog.layouts.app')
  3. @section('title', $user['nickName'] . ' · ' . collect($current)->pluck('label')->implode(' / '))
  4. @section('content')
  5. <header>
  6. <h3 class="section-title">Categories</h3>
  7. <div class="section-card">
  8. <div class="section-details">
  9. <h3 class="section-count">{{ $count }} 篇</h3>
  10. <h1 class="section-term">
  11. @foreach($current as $category)
  12. / <a href="{{ route('blog.category', ['user' => $user['userName'], 'category1' => $category['id']]) }}">
  13. {{ $category['label'] }}
  14. </a>
  15. @endforeach
  16. </h1>
  17. {{-- 子分类标签 --}}
  18. @if(!empty($tagOptions))
  19. <section class="widget tagCloud">
  20. <div class="tagCloud-tags">
  21. @foreach($tagOptions as $id => $tag)
  22. @if($tag['count'] < $count)
  23. <a href="{{ rtrim(url()->current(), '/') . '/' . $tag['tag']->name }}">
  24. {{ $tag['tag']->name }} ({{ $tag['count'] }})
  25. </a>
  26. @endif
  27. @endforeach
  28. </div>
  29. </section>
  30. @endif
  31. </div>
  32. </div>
  33. </header>
  34. <section class="article-list--compact">
  35. @forelse($posts as $post)
  36. <article>
  37. <a href="{{ route('library.tipitaka.read', ['id' => $post['uid']]) }}">
  38. <div class="article-details">
  39. <h2 class="article-title">{{ $post->title }}</h2>
  40. <footer class="article-time">
  41. <time>{{ $post->formatted_updated_at }}</time>
  42. </footer>
  43. </div>
  44. @if(!empty($post->cover))
  45. <div class="article-image">
  46. <img src="{{ $post->cover }}"
  47. width="120" height="120"
  48. alt="{{ $post->title }}"
  49. loading="lazy" />
  50. </div>
  51. @endif
  52. </a>
  53. </article>
  54. @empty
  55. <div class="not-found-card" style="padding: 20px;">
  56. <p>此分类下暂无文章</p>
  57. </div>
  58. @endforelse
  59. </section>
  60. @endsection