index.blade.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {{-- resources/views/blog/index.blade.php --}}
  2. @extends('blog.layouts.app')
  3. @section('title', $user['nickName'])
  4. @section('content')
  5. <h2 class="section-title">推荐阅读</h2>
  6. <div class="subsection-list">
  7. <div class="article-list--tile">
  8. <article class="has-image"><a href="/categories/documentation/">
  9. <div class="article-image"><img alt="Featured image of post Documentation" height="150" loading="lazy" src="/categories/documentation/hutomo-abrianto-l2jk-uxb1BY-unsplash_hu_543ba73fab19d0c8.jpg" srcset="/categories/documentation/hutomo-abrianto-l2jk-uxb1BY-unsplash_hu_543ba73fab19d0c8.jpg 1x, /categories/documentation/hutomo-abrianto-l2jk-uxb1BY-unsplash_hu_2b27d90ffb967881.jpg 2x" width="250"></div>
  10. <div class="article-details" style="background:linear-gradient(0deg,#bc8d7280 0%,#d0cfcdC0 100%)">
  11. <h2 class="article-title">Documentation</h2>
  12. </div>
  13. </a></article>
  14. <article><a href="/categories/syntax/">
  15. <div class="article-details">
  16. <h2 class="article-title">Syntax</h2>
  17. </div>
  18. </a></article>
  19. <article><a href="/categories/themes/">
  20. <div class="article-details">
  21. <h2 class="article-title">Themes</h2>
  22. </div>
  23. </a></article>
  24. </div>
  25. </div>
  26. <section class="article-list">
  27. @forelse($posts as $post)
  28. <article class="{{ !empty($post->cover) ? 'has-image' : '' }}">
  29. <header class="article-header">
  30. @if(!empty($post->cover))
  31. <div class="article-image">
  32. <a href="{{ route('library.tipitaka.read', ['id' => $post['uid']]) }}">
  33. <img src="{{ $post->cover }}"
  34. width="800" height="450"
  35. loading="lazy"
  36. alt="{{ $post->title }}" />
  37. </a>
  38. </div>
  39. @endif
  40. <div class="article-details">
  41. @if(!empty($post->categories))
  42. <header class="article-category">
  43. @foreach($post->categories as $category)
  44. <a href="{{ route('blog.category', ['user' => $user['userName'], 'category1' => $category['id']]) }}">
  45. {{ $category['label'] }}
  46. </a>
  47. @endforeach
  48. </header>
  49. @endif
  50. <div class="article-title-wrapper">
  51. <h2 class="article-title">
  52. <a href="{{ route('library.tipitaka.read', ['id' => $post['uid']]) }}">
  53. {{ $post->title }}
  54. </a>
  55. </h2>
  56. @if(!empty($post->summary))
  57. <h3 class="article-subtitle">{{ $post->summary }}</h3>
  58. @endif
  59. </div>
  60. <footer class="article-time">
  61. <div>
  62. <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-calendar-time"
  63. width="24" height="24" viewBox="0 0 24 24" stroke-width="2"
  64. stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
  65. <path stroke="none" d="M0 0h24v24H0z"></path>
  66. <path d="M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4"></path>
  67. <circle cx="18" cy="18" r="4"></circle>
  68. <path d="M15 3v4"></path>
  69. <path d="M7 3v4"></path>
  70. <path d="M3 11h16"></path>
  71. <path d="M18 16.496v1.504l1 1"></path>
  72. </svg>
  73. <time>{{ $post->formatted_updated_at }}</time>
  74. </div>
  75. </footer>
  76. </div>
  77. </header>
  78. </article>
  79. @empty
  80. <div class="not-found-card">
  81. <p>暂无文章</p>
  82. </div>
  83. @endforelse
  84. </section>
  85. @endsection