1+ import gitRawCommits from "git-raw-commits"
2+ import { GetStaticPropsContext , GetStaticPropsResult } from "next"
13import Head from "next/head"
2- import Main from "../components/Main"
34import FormattedLink from "../components/FormattedLink"
4- import { GetStaticPropsContext , GetStaticPropsResult } from "next"
5- import gitRawCommits from "git-raw-commits"
5+ import Main from "../components/Main"
66
77interface CommitData {
88 hash : string
@@ -47,9 +47,14 @@ export default function Changelog({ location, commits }: { location: string } &
4747}
4848
4949function Commit ( { commit, prev } : { commit : CommitData , prev ?: CommitData } ) {
50- const child = < span > { commit . message } </ span >
51- const date = new Date ( commit . timestamp )
50+ const child = < span > { commit . message . split ( "\n" ) . map ( ( v , i , a ) =>
51+ < span key = { i } className = { i == 0 ? "font-semibold" : "font-normal pl-4" } >
52+ { v }
53+ { i == a . length - 1 || < br /> }
54+ </ span >
55+ ) } </ span >
5256
57+ const date = new Date ( commit . timestamp )
5358 const formattedDate = date . toLocaleString ( "en-UK" , {
5459 month : "long" ,
5560 day : "numeric" ,
@@ -95,7 +100,7 @@ export async function getStaticProps(context: GetStaticPropsContext): Promise<Ge
95100 return {
96101 hash : commit . sha ,
97102 timestamp : new Date ( commit . commit . committer . date ) . getTime ( ) ,
98- message : commit . commit . message . split ( "\n" ) [ 0 ] . trim ( ) ,
103+ message : commit . commit . message . replace ( / \n \n / g , "\n" ) . trim ( ) ,
99104 type : "Bot/Data"
100105 }
101106 } )
@@ -116,7 +121,7 @@ export async function getStaticProps(context: GetStaticPropsContext): Promise<Ge
116121 return {
117122 hash,
118123 timestamp,
119- message : split . join ( "|" ) . split ( "\n" ) [ 0 ] . trim ( ) ,
124+ message : split . join ( "|" ) . replace ( / \n \n / g , "\n" ) . trim ( ) ,
120125 type : "Website"
121126 }
122127 } )
0 commit comments