Skip to content

Commit 25979ad

Browse files
committed
Refactor GitHub integration and update work page
- Removed the GitHub page and redirected to the work page. - Integrated GitHub profile and contributions data into the work page. - Updated metadata for the work page to include GitHub information. - Enhanced the work page layout to display GitHub contributions and notable repositories. - Cleaned up unused imports and code in the GitHub page.
1 parent 413c95e commit 25979ad

8 files changed

Lines changed: 387 additions & 390 deletions

File tree

src/lib/data/navItems.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ export const navItems: NavItem[] = [
66
{ href: '/', label: 'Home', iconPath: 'Home' },
77
{ href: '/work', label: 'Work', iconPath: 'Briefcase' },
88
{ href: '/site/meta', label: 'Site Meta', iconPath: 'Info' },
9-
{ href: '/github', label: 'GitHub', iconPath: 'Github' },
109
{ href: '/archive', label: 'Archive', iconPath: 'Archive' }
1110
];

src/lib/helper/siteMeta.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ export const defaultSiteMeta: SiteMetadata = {
4444
* ```
4545
*/
4646
export interface DynamicSiteMetaOptions {
47-
title: string
48-
description?: string
49-
template?: 'default' | 'blog' | 'profile'
50-
url?: string
47+
title: string;
48+
description?: string;
49+
template?: 'default' | 'blog' | 'profile';
50+
url?: string;
5151
}
5252

5353
export function createDynamicSiteMeta(options: DynamicSiteMetaOptions): SiteMetadata {
54-
const siteUrl = options.url || PUBLIC_SITE_URL
54+
const siteUrl = options.url || PUBLIC_SITE_URL;
55+
const title =
56+
options.title === PUBLIC_SITE_TITLE
57+
? PUBLIC_SITE_TITLE
58+
: `${options.title} | ${PUBLIC_SITE_TITLE}`;
5559

5660
return {
57-
title: options.title,
61+
title,
5862
description: options.description || PUBLIC_SITE_DESCRIPTION,
5963
keywords: PUBLIC_SITE_KEYWORDS,
6064
url: siteUrl,
@@ -65,5 +69,5 @@ export function createDynamicSiteMeta(options: DynamicSiteMetaOptions): SiteMeta
6569
})}`,
6670
imageWidth: 1200,
6771
imageHeight: 630
68-
}
72+
};
6973
}

src/routes/+error.svelte

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
import { page } from '$app/stores';
33
import { MetaTags } from '$lib/components/seo';
44
import { Card } from '$lib/components/ui';
5-
import { Home, RefreshCw, FileQuestion, Shield, ServerCrash, AlertTriangle } from '@lucide/svelte';
5+
import {
6+
Home,
7+
RefreshCw,
8+
FileQuestion,
9+
Shield,
10+
ServerCrash,
11+
AlertTriangle
12+
} from '@lucide/svelte';
613
714
// Get error details from page store
815
const status = $derived($page.status);
@@ -29,9 +36,10 @@
2936
return {
3037
icon: Shield,
3138
title: 'Access Denied',
32-
description: 'You don\'t have permission to access this resource. This could be due to authentication requirements or restricted access.',
39+
description:
40+
"You don't have permission to access this resource. This could be due to authentication requirements or restricted access.",
3341
suggestions: [
34-
'Make sure you\'re logged in if required',
42+
"Make sure you're logged in if required",
3543
'The content may be private or restricted',
3644
'Contact the site owner if you believe this is an error'
3745
],
@@ -42,26 +50,38 @@
4250
return {
4351
icon: ServerCrash,
4452
title: 'Something Went Wrong',
45-
description: 'An internal error occurred while processing your request. This is usually temporary.',
53+
description:
54+
'An internal error occurred while processing your request. This is usually temporary.',
4655
suggestions: [
4756
'Try refreshing the page',
4857
'Clear your browser cache',
4958
'The issue has been logged and will be investigated'
5059
],
51-
primaryAction: { label: 'Try Again', href: null, icon: RefreshCw, action: () => window.location.reload() },
60+
primaryAction: {
61+
label: 'Try Again',
62+
href: null,
63+
icon: RefreshCw,
64+
action: () => window.location.reload()
65+
},
5266
secondaryAction: { label: 'Go to Homepage', href: '/', icon: Home }
5367
};
5468
case 503:
5569
return {
5670
icon: AlertTriangle,
5771
title: 'Service Temporarily Unavailable',
58-
description: 'The server is currently unavailable, usually due to maintenance or high load. Please try again shortly.',
72+
description:
73+
'The server is currently unavailable, usually due to maintenance or high load. Please try again shortly.',
5974
suggestions: [
6075
'Wait a few moments and try again',
6176
'The site may be undergoing maintenance',
6277
'Check back in a minute or two'
6378
],
64-
primaryAction: { label: 'Try Again', href: null, icon: RefreshCw, action: () => window.location.reload() },
79+
primaryAction: {
80+
label: 'Try Again',
81+
href: null,
82+
icon: RefreshCw,
83+
action: () => window.location.reload()
84+
},
6585
secondaryAction: { label: 'Go to Homepage', href: '/', icon: Home }
6686
};
6787
default:
@@ -75,7 +95,12 @@
7595
'If the problem persists, please contact support'
7696
],
7797
primaryAction: { label: 'Go to Homepage', href: '/', icon: Home },
78-
secondaryAction: { label: 'Try Again', href: null, icon: RefreshCw, action: () => window.location.reload() }
98+
secondaryAction: {
99+
label: 'Try Again',
100+
href: null,
101+
icon: RefreshCw,
102+
action: () => window.location.reload()
103+
}
79104
};
80105
}
81106
});
@@ -98,7 +123,9 @@
98123
<div class="text-center">
99124
<!-- Icon with status code -->
100125
<div class="mb-6 flex flex-col items-center">
101-
<div class="mb-4 rounded-full bg-primary-100 p-6 text-primary-600 dark:bg-primary-900/30 dark:text-primary-400">
126+
<div
127+
class="mb-4 rounded-full bg-primary-100 p-6 text-primary-600 dark:bg-primary-900/30 dark:text-primary-400"
128+
>
102129
{#if errorConfig.icon === FileQuestion}
103130
<FileQuestion class="h-16 w-16" />
104131
{:else if errorConfig.icon === Shield}
@@ -127,9 +154,7 @@
127154
<!-- Show additional error message if available and meaningful -->
128155
{#if errorMessage && !errorMessage.includes('Internal Error') && status !== 404}
129156
<div class="mb-6 rounded-lg bg-red-50 p-4 text-left dark:bg-red-900/20">
130-
<p class="text-sm font-medium text-red-800 dark:text-red-200">
131-
Error details:
132-
</p>
157+
<p class="text-sm font-medium text-red-800 dark:text-red-200">Error details:</p>
133158
<p class="mt-1 font-mono text-sm text-red-700 dark:text-red-300">
134159
{errorMessage}
135160
</p>
@@ -139,9 +164,7 @@
139164
<!-- Suggestions -->
140165
{#if errorConfig.suggestions.length > 0}
141166
<div class="mb-8 text-left">
142-
<p class="mb-3 text-sm font-medium text-ink-600 dark:text-ink-400">
143-
What you can try:
144-
</p>
167+
<p class="mb-3 text-sm font-medium text-ink-600 dark:text-ink-400">What you can try:</p>
145168
<ul class="space-y-2">
146169
{#each errorConfig.suggestions as suggestion}
147170
<li class="flex items-start gap-2 text-sm text-ink-700 dark:text-ink-300">
@@ -226,10 +249,10 @@
226249
Archive
227250
</a>
228251
<a
229-
href="/github"
252+
href="/work"
230253
class="rounded-lg bg-canvas-100 px-4 py-2 text-sm text-ink-700 transition-colors hover:bg-canvas-200 dark:bg-canvas-800 dark:text-ink-300 dark:hover:bg-canvas-700"
231254
>
232-
GitHub
255+
Work
233256
</a>
234257
<a
235258
href="/site/meta"

src/routes/+page.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { PageLoad } from './$types';
22
import { createDynamicSiteMeta } from '$lib/helper/siteMeta';
3+
import { PUBLIC_SITE_TITLE } from '$env/static/public';
34
import {
45
fetchMusicStatus,
56
fetchKibunStatus,
@@ -13,19 +14,20 @@ import {
1314
export const load: PageLoad = async ({ fetch, parent }) => {
1415
const { profile } = await parent();
1516

16-
const [musicStatus, kibunStatus, latestPost, tangledRepos, documents, supporters, popfeedReview] = await Promise.allSettled([
17-
fetchMusicStatus(fetch),
18-
fetchKibunStatus(fetch),
19-
fetchLatestBlueskyPost(fetch),
20-
fetchTangledRepos(fetch),
21-
fetchRecentDocuments(5, fetch),
22-
fetchAllSupporters(),
23-
fetchRecentPopfeedReviews(fetch)
24-
]);
17+
const [musicStatus, kibunStatus, latestPost, tangledRepos, documents, supporters, popfeedReview] =
18+
await Promise.allSettled([
19+
fetchMusicStatus(fetch),
20+
fetchKibunStatus(fetch),
21+
fetchLatestBlueskyPost(fetch),
22+
fetchTangledRepos(fetch),
23+
fetchRecentDocuments(5, fetch),
24+
fetchAllSupporters(),
25+
fetchRecentPopfeedReviews(fetch)
26+
]);
2527

2628
// Create page metadata with dynamic OG
2729
const meta = createDynamicSiteMeta({
28-
title: "Ewan's Corner",
30+
title: PUBLIC_SITE_TITLE,
2931
description: 'personal site, blog, and digital garden'
3032
});
3133

0 commit comments

Comments
 (0)