index.pug 999 B

1234567891011121314151617181920
  1. div(class="container mx-auto px-4 py-8")
  2. h1(class="text-3xl font-bold mb-8") Блог
  3. div(v-if="loading" class="text-center") Загрузка...
  4. div(v-else-if="error" class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded") {{ error }}
  5. div(v-else)
  6. div(v-for="post in posts" :key="post._id" class="bg-white rounded-lg shadow-md p-6 mb-6")
  7. h2(class="text-2xl font-semibold mb-2")
  8. app-link(:to="'/blog/'+post._id") {{ post.title }}
  9. p(class="text-gray-600 mb-4") {{ post.excerpt }}
  10. div(class="flex justify-between items-center text-sm text-gray-500")
  11. span {{ new Date(post.created_at).toLocaleDateString() }}
  12. span Автор: {{ post.author }}
  13. div(v-if="post.tags" class="mt-4")
  14. span(v-for="tag in post.tags" :key="tag" class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded mr-2") {{ tag }}