Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1006 Bytes

change-log.mdx

File metadata and controls

27 lines (22 loc) · 1006 Bytes

import Markdown from 'markdown-to-jsx' import { useSSG } from 'nextra/ssg'

export const getStaticProps = ({ params }) => { return fetch('https://api.github.com/repos/vercel/swr/releases') .then(res => res.json()) // we keep the most recent 5 releases here .then(releases => ({ props: { ssg: releases.slice(0, 5) }, revalidate: 10 })) }

export const ReleasesRenderer = () => { const releases = useSSG() return { releases.map(release => { const body = release.body .replace(/'/g, "'") .replace(/@([a-zA-Z0-9_-]+)(?=(,| ))/g, '@$1') return ## <a href="${release.html_url}" target="_blank" rel="noopener">${release.tag_name}</a> Published on ${new Date(release.published_at) .toDateString()}.\n\n${body}}).join('\n\n') } }

Change Log

Please visit the SWR release page for all history releases.