Skip to content

Commit 72cb5cf

Browse files
authored
Merge branch 'ProjectDepot:main' into main
2 parents 70049a2 + f15b602 commit 72cb5cf

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public/avatar*.png
3434
public/avatar*.webp
3535
public/favicon.*
3636
src/hero.md
37+
src/hero.txt
3738
src/config.json
3839
scripts/repo-filter.js
3940
/docs/.vitepress/cache

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/fetch-data/fetch/gists.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ export async function fetchGists() {
1111

1212
try {
1313
const gistsUrl = `https://api.github.com/users/${username}/gists?per_page=${state.perPage}`;
14-
const dataStr = await downloadTextFile(gistsUrl, null);
14+
const dataStr = await downloadTextFile(gistsUrl, null, { token: '' });
1515
const data: Gist[] = JSON.parse(dataStr);
1616

1717
for (const gist of data) {
1818
for (const file of Object.values(gist.files)) {
1919
if (file.raw_url) {
2020
try {
21-
const content = await downloadTextFile(file.raw_url, null);
21+
const content = await downloadTextFile(file.raw_url, null, {
22+
token: '',
23+
});
2224
file.content = content;
2325
} catch (e) {
2426
err(`Error fetching content for ${file.filename}`, e);

scripts/fetch-data/paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function setPaths() {
2626
paths.readmeManifest = join(src, 'readme-manifest.json');
2727
paths.langColors = join(src, 'lang-colors.json');
2828
paths.userProfile = join(src, 'profile.json');
29-
paths.userReadme = join(src, 'hero.md');
29+
paths.userReadme = join(src, 'hero.txt');
3030
paths.avatar = join(_public, 'avatar.webp');
3131
paths.avatar150 = join(_public, 'avatar-150.webp');
3232
paths.faviconIco = join(_public, 'favicon.ico');

scripts/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function downloadFile(
1717
const { accept, isBinary = false } = options;
1818
let { token } = options;
1919
const headers: Record<string, string> = {};
20-
if (!token) token = process.env.GITHUB_TOKEN;
20+
if (token === undefined) token = process.env.GITHUB_TOKEN;
2121
if (token) {
2222
headers.Authorization = `token ${token}`;
2323
}

src/pages/index.astro

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
---
2+
import '@fontsource/inter';
3+
import '@fontsource/outfit';
24
import App from '../App.vue';
35
import { getConfig } from '../config';
46
import profile from '../profile.json';
57
68
import { getCollection } from 'astro:content';
79
import Hero from '../components/Hero.astro';
8-
import heroMd from '../hero.md?raw';
910
import { cautiousImport } from '../utils';
1011
11-
import '@fontsource/inter';
12-
import '@fontsource/outfit';
12+
const heroMdB64 = await cautiousImport(import.meta.glob('../hero.txt'));
13+
let heroMd = '';
14+
if (heroMdB64) {
15+
heroMd = Buffer.from(heroMdB64.split(',')[1], 'base64').toString('utf8');
16+
}
1317
1418
const ghUsername = GITHUB_ACTOR || 'your_username';
1519

0 commit comments

Comments
 (0)