-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update documentation with components
- Loading branch information
1 parent
f2907aa
commit 5229d40
Showing
4 changed files
with
132 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
import { Code } from '@astrojs/starlight/components'; | ||
const resourcesUrl = "https://gist.githubusercontent.com/trueberryless/7ed4110d6f4cf4d2517d98dfcc035705/raw"; | ||
interface Resource { | ||
name: string; | ||
description: string; | ||
url?: string; | ||
} | ||
type Resources = Record<string, Resource[]>; | ||
let resources: Resources | null = null; | ||
// Fetch resources at build time | ||
try { | ||
const response = await fetch(resourcesUrl); | ||
resources = await response.json() as Resources; | ||
} catch (error) { | ||
console.error("Failed to fetch resources:", error); | ||
resources = null; | ||
} | ||
--- | ||
|
||
<Code code={JSON.stringify(resources, null, 2)} lang='json' /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters