Skip to content

Commit

Permalink
Trim whitespaces from changelog messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibowl committed Feb 12, 2022
1 parent 8c08ddd commit 1c9532e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pages/changelog.tsx
Expand Up @@ -40,6 +40,7 @@ export default function Changelog({ location, commits }: { location: string } &
<h2 className="text-3xl font-bold pb-2">
Commits
</h2>

{commits.map((commit, i, arr) => <Commit key={commit.hash} commit={commit} prev={arr[i - 1]} />)}

</Main>
Expand Down Expand Up @@ -85,7 +86,7 @@ export async function getStaticProps(context: GetStaticPropsContext): Promise<Ge
return {
hash: commit.sha,
timestamp: new Date(commit.commit.committer.date).getTime(),
message: commit.commit.message,
message: commit.commit.message.split("\n")[0].trim(),
type: "Bot/Data"
}
})
Expand All @@ -106,7 +107,7 @@ export async function getStaticProps(context: GetStaticPropsContext): Promise<Ge
return {
hash,
timestamp,
message: split.join("|"),
message: split.join("|").split("\n")[0].trim(),
type: "Website"
}
})
Expand Down

0 comments on commit 1c9532e

Please sign in to comment.