Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

1.5 KB
Raw Blame
---
title: Changelog
description: Jan is a ChatGPT-alternative that runs on your own computer, with a local API server.
keywords:
  [
    Jan,
    Customizable Intelligence, LLM,
    local AI,
    privacy focus,
    free and open source,
    private and offline,
    conversational AI,
    no-subscription fee,
    large language models,
    architecture,
  ]
---

import Changelog from "@/components/Changelog"
import fs from 'fs'
import path from 'path'
import matter from 'gray-matter'
import { format } from 'date-fns'

export const getStaticProps = async() => {
  const getChangelog = await fs.readdirSync(path.join(process.cwd(), 'src/pages/changelog')).filter((file) => {
    return path.extname(file).toLowerCase() === ".mdx" && !file.startsWith('index')
  })
  const changelog = []

  for (const item of getChangelog) {
    const content = fs.readFileSync(path.join(process.cwd(), `src/pages/changelog/${item}`), "utf8")
    const frontmatter = matter(content)

    if(!frontmatter.data.unlisted) {
      changelog.push({
        url: item.replace('.mdx', ''),
        title: frontmatter?.data?.title || '',
        ogImage: frontmatter?.data?.ogImage || null,
        version: frontmatter?.data?.version || null,
        description: frontmatter?.data?.description || null,
        date: String(frontmatter?.data?.date) || null,
      })
    }
    changelog.sort((a, b) => new Date(b.date) - new Date(a.date))
  }


  return {
    props: {
      ssg: changelog
    },
  }
}

<Changelog />