page.tsx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import { allGuides } from 'contentlayer/generated';
  2. import { format } from '@/lib/date';
  3. import Link from '@/components/Link';
  4. export const metadata = {
  5. title: 'Guides',
  6. description: 'Learn how to use Tabler effectively with our comprehensive guides. Master the app and streamline your workflow today.',
  7. };
  8. export default async function GuidesPage() {
  9. return (
  10. <section className="section">
  11. <div className="container">
  12. <div className="section-header">
  13. <h2 className="section-title section-title-lg">Guides</h2>
  14. <p className="section-description">
  15. The most interesting articles to help you build better applications
  16. </p>
  17. </div>
  18. <div className="guides sm:gx-6 xl:gx-7">
  19. {allGuides.map((guide, i) => (
  20. <div
  21. className="guide"
  22. key={guide.slug}
  23. itemScope={true}
  24. itemType="https://schema.org/NewsArticle"
  25. >
  26. <div className="guide-date">
  27. <meta
  28. itemProp="datePublished"
  29. content={format(guide.date, 'yyyy-MM-dd')}
  30. />
  31. <div>{format(guide.date, 'd')}</div>
  32. <div>{format(guide.date, 'MMM')}</div>
  33. </div>
  34. <div className="box">
  35. {guide.image && (
  36. <Link href={guide.slug} className="d-block mb-4">
  37. <div className="border-light rounded lh-1">
  38. <img
  39. src={guide.image}
  40. width={660}
  41. height={361}
  42. className="rounded"
  43. alt={guide.title}
  44. itemProp="image"
  45. />
  46. </div>
  47. </Link>
  48. )}
  49. <div>
  50. {guide.title && (
  51. <h2>
  52. <meta itemProp="headline" content={guide?.title} />
  53. <meta itemProp="url" content={guide.slug} />
  54. <Link href={guide.slug}>{guide?.title}</Link>
  55. </h2>
  56. )}
  57. <div className="markdown text-muted">
  58. <p itemProp="description">{guide.summary}</p>
  59. </div>
  60. </div>
  61. <div className="mt-4">
  62. <div className="row items-center">
  63. <div className="col">
  64. <div
  65. className="d-flex items-center"
  66. itemProp="author"
  67. itemScope={true}
  68. itemType="https://schema.org/Person"
  69. >
  70. <div
  71. className="avatar mr-3"
  72. style={{
  73. backgroundImage: 'url(/img/authors/codecalm.jpg)',
  74. }}
  75. />
  76. <span itemProp="name">Paweł Kuna</span>
  77. <meta itemProp="url" content="https://tabler.io" />
  78. </div>
  79. </div>
  80. <div className="col-auto">
  81. <Link
  82. href={guide.slug}
  83. className="btn"
  84. aria-label={`Read more about "${guide.title}"`}
  85. >
  86. Read more
  87. </Link>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. ))}
  94. </div>
  95. </div>
  96. </section>
  97. );
  98. }
  99. // export async function getStaticProps() {
  100. // const guides = await getAllGuides(['slug', 'title', 'summary', 'date', 'image'])
  101. // return {
  102. // props: {
  103. // guides,
  104. // menu: 'guides',
  105. // meta: {
  106. // bodyClassName: 'bg-light',
  107. // title: 'Guides - The most interesting articles to help you build better applications',
  108. // },
  109. // },
  110. // }
  111. // }