page.tsx 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { allChangelogs } from '@/.contentlayer/generated';
  2. import Mdx from '@/components/MDX';
  3. import { changelogEnabled } from '@/config/site';
  4. import { dateTemplate, distanceToNow, format } from '@/lib/date';
  5. import { notFound } from 'next/navigation';
  6. export const metadata = {
  7. title: 'Changelog',
  8. description: 'Discover the latest Tabler app updates and enhancements on our Changelog page. Stay informed and experience the best features!',
  9. };
  10. export default function ChangelogPage() {
  11. if (!changelogEnabled) {
  12. notFound();
  13. }
  14. const changelogs = allChangelogs
  15. .sort((a, b) => {
  16. return new Date(a.date).getTime() - new Date(b.date).getTime();
  17. })
  18. .reverse();
  19. return (
  20. <>
  21. <section className="section pb-0">
  22. <div className="container">
  23. <div className="section-header mb-0">
  24. <h2 className="section-title section-title-lg">Changelog</h2>
  25. <p className="section-description">
  26. Most recent updates, bug fixes, and introduction of new features.
  27. </p>
  28. </div>
  29. </div>
  30. </section>
  31. <section className="section">
  32. <div className="container container-narrow">
  33. <div className="timeline">
  34. {changelogs.map((changelog) => (
  35. <div className="row g-7 timeline-item" key={changelog.version}>
  36. <div className="col-3 timeline-summary">
  37. <div className="font-medium font-h4">v{changelog.version}</div>
  38. <div
  39. className="text-muted mb-3 font-h6"
  40. itemProp="datePublished"
  41. content={format(changelog.date, 'yyyy-MM-dd')}
  42. >
  43. Published{' '}
  44. <time
  45. dateTime={dateTemplate(changelog.date)}
  46. className="text-muted"
  47. >
  48. {distanceToNow(changelog.date)}
  49. </time>
  50. </div>
  51. </div>
  52. <div className="col-9 timeline-description">
  53. {changelog.title && <h3 className="mb-3">{changelog.title}</h3>}
  54. <div className="markdown">
  55. <Mdx code={changelog.body.code} />
  56. </div>
  57. </div>
  58. </div>
  59. ))}
  60. </div>
  61. </div>
  62. </section>
  63. </>
  64. );
  65. }