~repos /website
git clone https://pyrossh.dev/repos/website.git
木 Personal website of pyrossh. Built with astrojs, shiki, vite.
873cce66
—
pyrossh 6 months ago
update repos
- +error.svelte +0 -30
- .vscode/launch.json +0 -11
- .vscode/tasks.json +10 -0
- astro.config.mjs +0 -7
- src/components/Wrapper.astro +2 -2
- src/content.config.ts +7 -0
- src/pages/repos/[...slug]/index.astro +35 -103
- src/pages/repos/[...slug]/index.module.css +48 -55
+error.svelte
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { base } from '$app/paths';
|
|
3
|
-
import { page } from '$app/stores';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<svelte:head>
|
|
7
|
-
<title>pyrossh | {$page.error?.message}</title>
|
|
8
|
-
<meta name="description" content="${$page.error?.message}" />
|
|
9
|
-
</svelte:head>
|
|
10
|
-
|
|
11
|
-
<div class="px-4 mx-auto h-screen">
|
|
12
|
-
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
|
|
13
|
-
<img
|
|
14
|
-
class="my-6"
|
|
15
|
-
src="/favicon.png"
|
|
16
|
-
width="128"
|
|
17
|
-
height="128"
|
|
18
|
-
alt="the Fresh logo: a sliced lemon dripping with juice"
|
|
19
|
-
/>
|
|
20
|
-
<h1 class="text-4xl font-bold">{$page.status} - {$page.error?.message}</h1>
|
|
21
|
-
<p class="my-4">
|
|
22
|
-
{#if $page.status === 404}
|
|
23
|
-
The page you were looking for doesn't exist.
|
|
24
|
-
{:else}
|
|
25
|
-
Something went wrong. Please try again later.
|
|
26
|
-
{/if}
|
|
27
|
-
</p>
|
|
28
|
-
<a href="{base}/" class="underline mt-4"> Go back home </a>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
.vscode/launch.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"command": "./node_modules/.bin/astro dev",
|
|
6
|
-
"name": "Development server",
|
|
7
|
-
"request": "launch",
|
|
8
|
-
"type": "node-terminal"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
.vscode/tasks.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"type": "shell",
|
|
6
|
+
"label": "Dev",
|
|
7
|
+
"command": "bun run dev",
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
}
|
astro.config.mjs
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { defineConfig, fontProviders } from 'astro/config';
|
|
3
|
-
// import node from '@astrojs/node';
|
|
4
3
|
import mdx from '@astrojs/mdx';
|
|
5
4
|
import sitemap from '@astrojs/sitemap';
|
|
6
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
7
5
|
|
|
8
6
|
// https://astro.build/config
|
|
9
7
|
export default defineConfig({
|
|
10
8
|
site: 'https://pyrossh.dev',
|
|
11
|
-
// output: 'server',
|
|
12
9
|
integrations: [
|
|
13
10
|
mdx(),
|
|
14
11
|
sitemap(),
|
|
15
|
-
// node(),
|
|
16
12
|
],
|
|
17
13
|
experimental: {
|
|
18
14
|
fonts: [{
|
|
@@ -21,7 +17,4 @@ export default defineConfig({
|
|
|
21
17
|
cssVariable: "--font-roboto"
|
|
22
18
|
}]
|
|
23
19
|
},
|
|
24
|
-
vite: {
|
|
25
|
-
plugins: [],
|
|
26
|
-
},
|
|
27
20
|
});
|
src/components/Wrapper.astro
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<style>
|
|
6
6
|
div {
|
|
7
7
|
flex: 1;
|
|
8
|
+
width: calc(95ex - (1em * 2));
|
|
8
|
-
/* width: calc(
|
|
9
|
+
/* width: calc(104ex - (1em * 2)); */
|
|
9
|
-
width: calc(104ex - (1em * 2));
|
|
10
10
|
margin-right: auto;
|
|
11
11
|
margin-left: auto;
|
|
12
12
|
padding-left: 1em;
|
src/content.config.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const collections = {
|
|
|
15
15
|
console.log("loading repo " + repoPath)
|
|
16
16
|
const git = simpleGit(repoPath)
|
|
17
17
|
const commits = await git.log();
|
|
18
|
+
const tags = await git.tag();
|
|
19
|
+
const branches = await git.branchLocal();
|
|
20
|
+
|
|
18
21
|
ctx.store.set({
|
|
19
22
|
id: r.title,
|
|
20
23
|
data: {
|
|
@@ -28,6 +31,8 @@ export const collections = {
|
|
|
28
31
|
date: item.date,
|
|
29
32
|
refs: item.refs,
|
|
30
33
|
})),
|
|
34
|
+
branches: branches.all,
|
|
35
|
+
tags: tags,
|
|
31
36
|
},
|
|
32
37
|
rendered: {
|
|
33
38
|
html: fs.existsSync(readmePath) ? await (await import(/* @vite-ignore */readmePath)).compiledContent() : "",
|
|
@@ -48,6 +53,8 @@ export const collections = {
|
|
|
48
53
|
refs: z.string(),
|
|
49
54
|
// diff: z.string(),
|
|
50
55
|
})),
|
|
56
|
+
branches: z.array(z.string()),
|
|
57
|
+
tags: z.array(z.string()),
|
|
51
58
|
}),
|
|
52
59
|
}),
|
|
53
60
|
content: defineCollection({
|
src/pages/repos/[...slug]/index.astro
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { type CollectionEntry, getCollection } from "astro:content";
|
|
3
3
|
import { render } from "astro:content";
|
|
4
4
|
import Layout from "@/layouts/Base.astro";
|
|
5
|
-
import { intlFormatDistance } from "date-fns";
|
|
6
5
|
import Commit from "@/components/Commit.astro";
|
|
7
6
|
import styles from "./index.module.css";
|
|
8
7
|
|
|
@@ -31,110 +30,43 @@ const { Content } = await render(Astro.props);
|
|
|
31
30
|
<h2 class=".expand">{description}</h2>
|
|
32
31
|
<!-- <h2>git@pyrossh.dev:~repos/website.git</h2> -->
|
|
33
32
|
</div>
|
|
33
|
+
<div class={styles.info}>
|
|
34
|
+
<h3>
|
|
35
|
+
git clone
|
|
36
|
+
<a href={`https://pyrossh-repos.s3.ap-south-1.amazonaws.com/${title}`}>
|
|
37
|
+
s3://pyrossh-repos/{title}
|
|
38
|
+
</a>
|
|
39
|
+
</h3>
|
|
40
|
+
<h3>
|
|
41
|
+
wget
|
|
42
|
+
<a
|
|
43
|
+
href={`https://pyrossh-repos.s3.ap-south-1.amazonaws.com/${title}/refs/heads/master/repo.zip`}
|
|
44
|
+
>
|
|
45
|
+
https://pyrossh-repos.s3.ap-south-1.amazonaws.com/{
|
|
46
|
+
title
|
|
47
|
+
}/refs/heads/master/repo.zip
|
|
48
|
+
</a>
|
|
49
|
+
</h3>
|
|
50
|
+
</div>
|
|
34
|
-
<div class={styles.
|
|
51
|
+
<div class={styles.nav}>
|
|
35
52
|
<div>
|
|
36
|
-
<div class="event-list mb-2">
|
|
37
|
-
|
|
53
|
+
<a href={`${title}/commits`}>Commits (view all)</a>
|
|
38
|
-
</div>
|
|
39
54
|
</div>
|
|
40
|
-
<div class={styles.sectionRight}>
|
|
41
|
-
<!-- <div class={styles.left}>
|
|
42
|
-
|
|
55
|
+
<div>|</div>
|
|
43
|
-
|
|
56
|
+
<div>
|
|
44
|
-
<dt>main</dt>
|
|
45
|
-
<dd>
|
|
46
|
-
|
|
57
|
+
<a class="nav-link" href={`/${title}/files`}>Files</a>
|
|
47
|
-
>browse <span
|
|
48
|
-
class="icon icon-caret-right"
|
|
49
|
-
aria-hidden="true"
|
|
50
|
-
><svg
|
|
51
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
-
width="24"
|
|
53
|
-
height="24"
|
|
54
|
-
viewBox="0 0 192 512"
|
|
55
|
-
><path
|
|
56
|
-
d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"
|
|
57
|
-
></path></svg
|
|
58
|
-
>
|
|
59
|
-
</span></a
|
|
60
|
-
>
|
|
61
|
-
<a href="/~pyrossh/website/log" rel="nofollow"
|
|
62
|
-
>log <span class="icon icon-caret-right" aria-hidden="true"
|
|
63
|
-
><svg
|
|
64
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
65
|
-
width="24"
|
|
66
|
-
height="24"
|
|
67
|
-
viewBox="0 0 192 512"
|
|
68
|
-
><path
|
|
69
|
-
d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"
|
|
70
|
-
></path></svg
|
|
71
|
-
>
|
|
72
|
-
</span></a
|
|
73
|
-
>
|
|
74
|
-
</dd>
|
|
75
|
-
</dl>
|
|
76
|
-
</div> -->
|
|
77
|
-
<div class={styles.right}>
|
|
78
|
-
<h3>clone</h3>
|
|
79
|
-
|
|
80
|
-
<dl>
|
|
81
|
-
<dt>read-only</dt>
|
|
82
|
-
<dd>
|
|
83
|
-
<a href={`https://pyrossh.dev/repos/${title}`}>
|
|
84
|
-
https://pyrossh.dev/repos/{title}.git
|
|
85
|
-
</a>
|
|
86
|
-
</dd>
|
|
87
|
-
<dt>read/write</dt>
|
|
88
|
-
<dd>git@pyrossh.dev:~repos/{title}.git</dd>
|
|
89
|
-
</dl>
|
|
90
|
-
<div class={styles.bottom}>
|
|
91
|
-
<a href="/~pyrossh/website/send-email" class={styles.btnPrimary}
|
|
92
|
-
>Prepare a patchset <span
|
|
93
|
-
class="icon icon-caret-right"
|
|
94
|
-
aria-hidden="true"
|
|
95
|
-
><svg
|
|
96
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
97
|
-
width="24"
|
|
98
|
-
height="24"
|
|
99
|
-
viewBox="0 0 192 512"
|
|
100
|
-
><path
|
|
101
|
-
d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"
|
|
102
|
-
></path></svg
|
|
103
|
-
>
|
|
104
|
-
</span></a
|
|
105
|
-
>
|
|
106
|
-
<p class="text-muted text-centered">
|
|
107
|
-
<small>
|
|
108
|
-
Use this or <a href="https://git-send-email.io">git send-email</a>
|
|
109
|
-
to send changes upstream.
|
|
110
|
-
</small>
|
|
111
|
-
</p>
|
|
112
|
-
|
|
58
|
+
</div>
|
|
59
|
+
<div>|</div>
|
|
60
|
+
<div>
|
|
61
|
+
<a class="nav-link" href={`/${title}/branches`}>Branches</a>
|
|
113
|
-
|
|
62
|
+
</div>
|
|
63
|
+
<div>|</div>
|
|
64
|
+
<div>
|
|
65
|
+
<a class="nav-link" href={`/${title}/tags`}>Tags</a>
|
|
114
66
|
</div>
|
|
115
67
|
</div>
|
|
116
|
-
<div class={styles.
|
|
68
|
+
<div class={styles.summary}>
|
|
117
|
-
<ul>
|
|
118
|
-
<li class="nav-item">
|
|
119
|
-
<a class="nav-link active" href={`/${title}`}>Readme</a>
|
|
120
|
-
</li>
|
|
121
|
-
<div>|</div>
|
|
122
|
-
<li class="nav-item">
|
|
123
|
-
<a class="nav-link" href={`/${title}/files`}>Files</a>
|
|
124
|
-
</li>
|
|
125
|
-
<div>|</div>
|
|
126
|
-
<li class="nav-item">
|
|
127
|
-
|
|
69
|
+
{latestCommits.map((commit) => <Commit {...commit} />)}
|
|
128
|
-
</li>
|
|
129
|
-
<div>|</div>
|
|
130
|
-
<li class="nav-item">
|
|
131
|
-
<a class="nav-link" href={`/${title}/branches`}>Branches</a>
|
|
132
|
-
</li>
|
|
133
|
-
<div>|</div>
|
|
134
|
-
<li class="nav-item">
|
|
135
|
-
<a class="nav-link" href={`/${title}/tags`}>Tags</a>
|
|
136
|
-
</li>
|
|
137
|
-
</ul>
|
|
138
70
|
</div>
|
|
139
71
|
<div class="markdown">
|
|
140
72
|
<Content />
|
|
@@ -150,7 +82,7 @@ const { Content } = await render(Astro.props);
|
|
|
150
82
|
}
|
|
151
83
|
}
|
|
152
84
|
|
|
153
|
-
h3 {
|
|
85
|
+
/* h3 {
|
|
154
86
|
font-size: 1.3rem;
|
|
155
87
|
border-bottom: 1px solid var(--color-gray-200);
|
|
156
88
|
padding-bottom: 0.25rem;
|
|
@@ -159,7 +91,7 @@ const { Content } = await render(Astro.props);
|
|
|
159
91
|
font-size: 1rem;
|
|
160
92
|
margin-left: 1rem;
|
|
161
93
|
}
|
|
162
|
-
}
|
|
94
|
+
} */
|
|
163
95
|
|
|
164
96
|
h4 {
|
|
165
97
|
font-size: 1.1rem;
|
src/pages/repos/[...slug]/index.module.css
CHANGED
|
@@ -43,27 +43,23 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.nav {
|
|
46
|
-
margin-bottom: 1rem;
|
|
47
|
-
|
|
48
|
-
ul {
|
|
49
|
-
|
|
46
|
+
display: flex;
|
|
50
|
-
|
|
47
|
+
align-items: center;
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
@media (max-width: 720px) {
|
|
53
|
-
|
|
50
|
+
margin-top: 0.5rem;
|
|
54
|
-
|
|
51
|
+
}
|
|
55
52
|
|
|
56
|
-
|
|
53
|
+
div {
|
|
57
|
-
|
|
54
|
+
padding-right: 0.5rem;
|
|
58
|
-
|
|
55
|
+
}
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
a {
|
|
61
|
-
|
|
58
|
+
font-size: 12pt;
|
|
62
|
-
|
|
59
|
+
padding-right: 0.5rem;
|
|
63
|
-
|
|
60
|
+
color: #65686a;
|
|
64
|
-
|
|
61
|
+
cursor: pointer;
|
|
65
|
-
|
|
62
|
+
color: #ced4da;
|
|
66
|
-
}
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
65
|
|
|
@@ -72,54 +68,51 @@ time {
|
|
|
72
68
|
color: rgb(var(--gray));
|
|
73
69
|
}
|
|
74
70
|
|
|
75
|
-
.
|
|
71
|
+
.info {
|
|
76
|
-
display:
|
|
72
|
+
display: flex;
|
|
77
|
-
|
|
73
|
+
flex-direction: row;
|
|
78
|
-
gap: 12px;
|
|
79
74
|
margin-top: 0.5rem;
|
|
75
|
+
margin-bottom: 0.5rem;
|
|
80
76
|
|
|
81
77
|
@media (max-width: 720px) {
|
|
82
|
-
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 0.5rem;
|
|
83
80
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.sectionRight {
|
|
87
|
-
display: grid;
|
|
88
|
-
grid-template-columns: auto;
|
|
89
|
-
gap: 1rem;
|
|
90
|
-
font-size: 12pt;
|
|
91
|
-
margin-left: 1rem;
|
|
92
|
-
margin-top: 0.5rem;
|
|
93
81
|
|
|
94
|
-
h3
|
|
82
|
+
h3 {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
flex: 1;
|
|
86
|
+
align-items: baseline;
|
|
95
|
-
|
|
87
|
+
background-color: #131618;
|
|
88
|
+
padding: 0.5rem;
|
|
96
|
-
font-size:
|
|
89
|
+
font-size: 12pt;
|
|
97
|
-
border-bottom: 1px solid #495057;
|
|
98
|
-
padding-bottom: .25rem;
|
|
99
|
-
margin-bottom: .5rem;
|
|
100
90
|
font-weight: 400;
|
|
101
|
-
line-height: 1.2;
|
|
102
|
-
}
|
|
103
91
|
|
|
104
|
-
a {
|
|
105
|
-
|
|
92
|
+
&:first-child {
|
|
106
|
-
|
|
93
|
+
margin-right: 1rem;
|
|
107
94
|
|
|
95
|
+
@media (max-width: 720px) {
|
|
96
|
+
margin-right: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
108
|
-
|
|
100
|
+
a {
|
|
109
|
-
display: flex;
|
|
110
|
-
|
|
101
|
+
font-size: 11pt;
|
|
102
|
+
color: var(--color-link);
|
|
103
|
+
margin-left: 0.4rem;
|
|
104
|
+
}
|
|
111
105
|
}
|
|
106
|
+
}
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
.summary {
|
|
114
|
-
|
|
109
|
+
display: grid;
|
|
115
|
-
|
|
110
|
+
grid-template-columns: auto;
|
|
111
|
+
/* gap: 4px; */
|
|
112
|
+
/* margin-top: 0.5rem; */
|
|
116
113
|
|
|
117
|
-
.bottom {
|
|
118
|
-
|
|
114
|
+
@media (max-width: 720px) {
|
|
119
|
-
|
|
115
|
+
grid-template-columns: auto;
|
|
120
|
-
align-items: center;
|
|
121
|
-
margin-top: 1rem;
|
|
122
|
-
}
|
|
123
116
|
}
|
|
124
117
|
}
|
|
125
118
|
|