aboutsummaryrefslogtreecommitdiff
path: root/examples/docs/src
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-01-17 23:12:26 +0800
committerGravatar GitHub <noreply@github.com> 2023-01-17 23:12:26 +0800
commit2000f5fb1e5cb3b8507213d43ccfc907d22468c2 (patch)
tree59e371cf1ef32e5d72869b794960d7033d5e649a /examples/docs/src
parent1ca81c16b8b66236e092e6eb6ec3f73f5668421c (diff)
downloadastro-2000f5fb1e5cb3b8507213d43ccfc907d22468c2.tar.gz
astro-2000f5fb1e5cb3b8507213d43ccfc907d22468c2.tar.zst
astro-2000f5fb1e5cb3b8507213d43ccfc907d22468c2.zip
Update blog example env name (#5877)
Diffstat (limited to 'examples/docs/src')
-rw-r--r--examples/docs/src/components/Footer/AvatarList.astro6
-rw-r--r--examples/docs/src/env.d.ts8
2 files changed, 10 insertions, 4 deletions
diff --git a/examples/docs/src/components/Footer/AvatarList.astro b/examples/docs/src/components/Footer/AvatarList.astro
index b75589f5a..03b1e5bd7 100644
--- a/examples/docs/src/components/Footer/AvatarList.astro
+++ b/examples/docs/src/components/Footer/AvatarList.astro
@@ -17,11 +17,9 @@ type Commit = {
async function getCommits(url: string) {
try {
- const token = import.meta.env.SNOWPACK_PUBLIC_GITHUB_TOKEN ?? 'hello';
+ const token = import.meta.env.GITHUB_TOKEN ?? 'hello';
if (!token) {
- throw new Error(
- 'Cannot find "SNOWPACK_PUBLIC_GITHUB_TOKEN" used for escaping rate-limiting.'
- );
+ throw new Error('Cannot find "GITHUB_TOKEN" used for escaping rate-limiting.');
}
const auth = `Basic ${Buffer.from(token, 'binary').toString('base64')}`;
diff --git a/examples/docs/src/env.d.ts b/examples/docs/src/env.d.ts
index f964fe0cf..8e48612f5 100644
--- a/examples/docs/src/env.d.ts
+++ b/examples/docs/src/env.d.ts
@@ -1 +1,9 @@
/// <reference types="astro/client" />
+
+interface ImportMetaEnv {
+ readonly GITHUB_TOKEN: string | undefined;
+}
+
+interface ImportMeta {
+ readonly env: ImportMetaEnv;
+}