summaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-09-14 09:14:39 -0400
committerGravatar GitHub <noreply@github.com> 2021-09-14 09:14:39 -0400
commitb6a75494b1c128503de3eba5363b46528142d8b2 (patch)
tree90098b84b352c7e60d8db4b2e18f109b6b7c6482 /docs/src
parent72c916535d29fb92ab10efcf62308041ba2858a7 (diff)
downloadastro-b6a75494b1c128503de3eba5363b46528142d8b2.tar.gz
astro-b6a75494b1c128503de3eba5363b46528142d8b2.tar.zst
astro-b6a75494b1c128503de3eba5363b46528142d8b2.zip
Add types to examples and docs (#1347)
* Adds a changeset * Add types to examples and docs * Make changes based on review feedback * Avoid using the variable named props * Make path a const
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/components/Footer/AvatarList.astro12
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/src/components/Footer/AvatarList.astro b/docs/src/components/Footer/AvatarList.astro
index 589e296b9..053b015fa 100644
--- a/docs/src/components/Footer/AvatarList.astro
+++ b/docs/src/components/Footer/AvatarList.astro
@@ -1,8 +1,14 @@
---
// fetch all commits for just this page's path
-const path = "docs/" + Astro.props.path;
-const url = `https://api.github.com/repos/snowpackjs/astro/commits?path=${path}`;
-const commitsURL = `https://github.com/snowpackjs/astro/commits/main/${path}`;
+
+export interface Props {
+ path: string;
+}
+
+const { path } = Astro.props as Props;
+const commitPath = 'docs/' + path;
+const url = `https://api.github.com/repos/snowpackjs/astro/commits?path=${commitPath}`;
+const commitsURL = `https://github.com/snowpackjs/astro/commits/main/${commitPath}`;
async function getCommits(url) {
try {