We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b135365 commit 19e0834Copy full SHA for 19e0834
1 file changed
src/components/Code.astro
@@ -9,7 +9,7 @@ export interface Props extends ExpressiveCodeBlockProps
9
}
10
11
const response = await fetch(
12
- "https://api.github.com/repos/saucer/saucer/releases/latest",
+ "https://api.github.com/repos/saucer/saucer/tags",
13
{
14
headers: [
15
["Accept", "application/vnd.github+json"],
@@ -19,7 +19,7 @@ const response = await fetch(
19
);
20
21
const parsed = await response.json();
22
-const version = parsed["tag_name"] ?? "v7.0.0";
+const version = parsed?.[0]?.["name"] ?? "v7.0.0";
23
24
const { code, lang, ...props } = Astro.props;
25
const versionedCode = code.replace("$VERSION$", version);
0 commit comments