Skip to content

Commit 56caa06

Browse files
committed
Add prepend tag attribute
1 parent 7d4c396 commit 56caa06

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/components/adventure/AdventureChangelogs.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { MarkdownHeading } from "astro";
88
interface Props {
99
title: string;
1010
repo: string;
11+
prepend_tag: boolean;
1112
}
1213
1314
const props: Props = Astro.props;
@@ -17,7 +18,7 @@ const headings: MarkdownHeading[] = data.map((e) => {
1718
return {
1819
depth: 2,
1920
slug: `release-${e.tag}`,
20-
text: `${e.tag_name} ${e.name}`,
21+
text: (props.prepend_tag ?? false) ? `${e.tag_name}: ${e.name}` : e.name,
2122
};
2223
});
2324
---
@@ -28,7 +29,7 @@ const headings: MarkdownHeading[] = data.map((e) => {
2829
<div>
2930
<a class="title" href={`#release-${release.tag}`}>
3031
<h2 id={`release-${release.tag}`}>
31-
{release.tag_name} {release.name}
32+
{(props.prepend_tag ?? false) ? `${release.tag_name}: ${release.name}` : release.name}
3233
</h2>
3334
</a>
3435
<p class="released">

src/pages/adventure/version-history/adventure-platform-fabric.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
import AdventureChangelogs from "/src/components/adventure/AdventureChangelogs.astro";
33
---
44

5-
<AdventureChangelogs repo="KyoriPowered/adventure-platform-fabric" title="adventure-platform-fabric" />
5+
<AdventureChangelogs repo="KyoriPowered/adventure-platform-fabric" title="adventure-platform-fabric" prepend_tag=true />

src/pages/adventure/version-history/adventure.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
import AdventureChangelogs from "/src/components/adventure/AdventureChangelogs.astro";
33
---
44

5-
<AdventureChangelogs repo="KyoriPowered/adventure" title="adventure" />
5+
<AdventureChangelogs repo="KyoriPowered/adventure" title="adventure" prepend_tag=true />

0 commit comments

Comments
 (0)