website
git clone https://git.pyrossh.dev/website
木 Personal website of pyrossh. Built with astrojs, shiki, vite.
ff21db4
— pyrossh
2026-05-10T17:26:00+05:30
Upgrade to astro v6.3.0
Generated files not shown: bun.lock
package.json
CHANGED
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@appzic/astro-reset-css": "^1.2.0",
|
|
18
|
-
"astro": "
|
|
18
|
+
"astro": "6.3.0",
|
|
19
19
|
"astro-color-scheme": "^1.1.6",
|
|
20
|
-
"astro-expressive-code": "^0.
|
|
20
|
+
"astro-expressive-code": "^0.42.0",
|
|
21
21
|
"astro-icon": "^1.1.5",
|
|
22
22
|
"pretty-bytes": "^7.1.0",
|
|
23
23
|
"simple-git": "^3.27.0",
|
|
24
24
|
"timeago.js": "^4.0.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@astrojs/rss": "^4.0.
|
|
27
|
+
"@astrojs/rss": "^4.0.18",
|
|
28
|
-
"@astrojs/sitemap": "^3.
|
|
28
|
+
"@astrojs/sitemap": "^3.7.2",
|
|
29
29
|
"@aws-sdk/client-s3": "^3.932.0",
|
|
30
30
|
"@aws-sdk/client-sts": "^3.932.0",
|
|
31
31
|
"@iconify-json/material-symbols": "^1.2.39",
|
src/pages/repos/[...repoId]/files/[...file]/blame/index.astro
CHANGED
|
@@ -11,7 +11,7 @@ export async function getStaticPaths() {
|
|
|
11
11
|
for (const repo of repos) {
|
|
12
12
|
const files = await getFiles(repo.data.absolutePath);
|
|
13
13
|
for (const file of files) {
|
|
14
|
-
const history = await getFileHistory(repo.data.absolutePath, file.
|
|
14
|
+
const history = await getFileHistory(repo.data.absolutePath, file.absolutePath);
|
|
15
15
|
routes.push({
|
|
16
16
|
params: { repoId: repo.id, file: file.name },
|
|
17
17
|
props: {
|
src/pages/repos/[...repoId]/files/[...file]/history/index.astro
CHANGED
|
@@ -12,7 +12,7 @@ export async function getStaticPaths() {
|
|
|
12
12
|
for (const repo of repos) {
|
|
13
13
|
const files = await getFiles(repo.data.absolutePath);
|
|
14
14
|
for (const file of files) {
|
|
15
|
-
const history = await getFileHistory(repo.data.absolutePath, file.
|
|
15
|
+
const history = await getFileHistory(repo.data.absolutePath, file.absolutePath);
|
|
16
16
|
routes.push({
|
|
17
17
|
params: { repoId: repo.id, file: file.name },
|
|
18
18
|
props: {
|
src/pages/repos/[...repoId]/files/[...file]/index.astro
CHANGED
|
@@ -13,7 +13,10 @@ export async function getStaticPaths() {
|
|
|
13
13
|
const files = await getFiles(repo.data.absolutePath);
|
|
14
14
|
for (const file of files) {
|
|
15
15
|
routes.push({
|
|
16
|
+
params: {
|
|
16
|
-
|
|
17
|
+
repoId: repo.id,
|
|
18
|
+
file: file.name,
|
|
19
|
+
},
|
|
17
20
|
props: {
|
|
18
21
|
repo: repo,
|
|
19
22
|
file: file,
|
|
@@ -59,7 +62,9 @@ const isImage = [
|
|
|
59
62
|
/>
|
|
60
63
|
) : (
|
|
61
64
|
<Code
|
|
65
|
+
code={
|
|
62
|
-
|
|
66
|
+
contentBuffer.toString("utf-8").trim() || "No content to display."
|
|
67
|
+
}
|
|
63
68
|
lang={file.ext || "txt"}
|
|
64
69
|
/>
|
|
65
70
|
)
|
src/utils/commit.ts
CHANGED
|
@@ -40,8 +40,11 @@ export const getFiles = async (repoPath: string): Promise<FileNode[]> => {
|
|
|
40
40
|
try {
|
|
41
41
|
const stat = await fs.stat(`${repoPath}/${p}`);
|
|
42
42
|
const ext = path.extname(p).replace(".", "");
|
|
43
|
+
const name = p.endsWith("index.html")
|
|
44
|
+
? p.replace("index.html", "index_html")
|
|
45
|
+
: p;
|
|
43
46
|
files.push({
|
|
44
|
-
name
|
|
47
|
+
name,
|
|
45
48
|
ext,
|
|
46
49
|
size: stat.size,
|
|
47
50
|
isDirectory: stat.isDirectory(),
|
|
@@ -57,9 +60,9 @@ export const getFiles = async (repoPath: string): Promise<FileNode[]> => {
|
|
|
57
60
|
|
|
58
61
|
export const getFileHistory = async (repoPath: string, filePath: string): Promise<Commit[]> => {
|
|
59
62
|
const git = simpleGit(repoPath);
|
|
60
|
-
const stat = await fs.stat(`${
|
|
63
|
+
const stat = await fs.stat(`${filePath}`);
|
|
61
64
|
const isLarge = stat.size > 1024 * 512;
|
|
62
|
-
const history = isLarge ? { all: [] } : await git.log([filePath]);
|
|
65
|
+
const history = isLarge ? { all: [] } : await git.log([filePath.replace(`${repoPath}/`, "")]);
|
|
63
66
|
return history.all.map(collectCommits);
|
|
64
67
|
}
|
|
65
68
|
|