page.tsx 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import Link from 'components/Link';
  2. import { allPosts } from 'contentlayer/generated';
  3. export const metadata = {
  4. title: 'Blog',
  5. description: 'Stay in the loop with all things Tabler. We provide regular updates on new features, changelogs, and news, ensuring you never miss any of our software developments.',
  6. };
  7. export default async function BlogPage() {
  8. return (
  9. <>
  10. <div className="sm:gx-6 xl:gx-7">
  11. {allPosts.map((post, i) => (
  12. <div
  13. className="guide"
  14. key={post.slug}
  15. itemScope={true}
  16. itemType="https://schema.org/NewsArticle"
  17. >
  18. <div className="guide-date">
  19. {/* <meta
  20. itemProp="datePublished"
  21. content={format(new Date(post.date), "yyyy-MM-dd")}
  22. />
  23. <div>{format(new Date(post.date), "d")}</div>
  24. <div>{format(new Date(post.date), "MMM")}</div> */}
  25. </div>
  26. <div className="box">
  27. {post.image && (
  28. <Link href={post.slug} className="d-block mb-4">
  29. <div className="border-light rounded lh-1">
  30. <img
  31. src={post.image}
  32. width={660}
  33. height={361}
  34. className="rounded"
  35. alt={post.title}
  36. itemProp="image"
  37. />
  38. </div>
  39. </Link>
  40. )}
  41. <div>
  42. {post.title && (
  43. <h2>
  44. <meta itemProp="headline" content={post?.title} />
  45. <meta itemProp="url" content={post.slug} />
  46. <Link href={post.slug}>{post?.title}</Link>
  47. </h2>
  48. )}
  49. <div className="markdown text-muted">
  50. <p itemProp="description">{post.summary}</p>
  51. </div>
  52. </div>
  53. <div className="mt-4">
  54. <div className="row items-center">
  55. <div className="col">
  56. <div
  57. className="d-flex items-center"
  58. itemProp="author"
  59. itemScope={true}
  60. itemType="https://schema.org/Person"
  61. >
  62. <div
  63. className="avatar mr-3"
  64. style={{
  65. backgroundImage: 'url(/img/authors/codecalm.jpg)',
  66. }}
  67. />
  68. <span itemProp="name">Paweł Kuna</span>
  69. <meta itemProp="url" content="https://tabler.io" />
  70. </div>
  71. </div>
  72. <div className="col-auto">
  73. {/* <Link
  74. href={post.slug}
  75. className="btn"
  76. aria-label={`Read more about "${post.title}"`}
  77. >
  78. Read more
  79. </Link> */}
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. ))}
  86. </div>
  87. </>
  88. );
  89. }