feat: add international page and update card component
- Introduced a new international page with dynamic content loading. - Updated Card component to display article date if available. - Removed unused about and contact pages. - Cleaned up package-lock.json by removing unnecessary dependencies.
This commit is contained in:
17
package-lock.json
generated
17
package-lock.json
generated
@@ -9,10 +9,8 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fontsource/fira-mono": "^4.5.10",
|
"@fontsource/fira-mono": "^4.5.10",
|
||||||
"@neoconfetti/svelte": "^1.0.0",
|
|
||||||
"@sveltejs/adapter-auto": "^1.0.0",
|
"@sveltejs/adapter-auto": "^1.0.0",
|
||||||
"@sveltejs/adapter-node": "^1.0.0",
|
"@sveltejs/adapter-node": "^1.0.0",
|
||||||
"@sveltejs/adapter-static": "^1.0.0",
|
|
||||||
"@sveltejs/kit": "^1.0.0",
|
"@sveltejs/kit": "^1.0.0",
|
||||||
"@types/cookie": "^0.5.1",
|
"@types/cookie": "^0.5.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||||
@@ -481,12 +479,6 @@
|
|||||||
"@jridgewell/sourcemap-codec": "1.4.14"
|
"@jridgewell/sourcemap-codec": "1.4.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@neoconfetti/svelte": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@neoconfetti/svelte/-/svelte-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-SmksyaJAdSlMa9cTidVSIqYo1qti+WTsviNDwgjNVm+KQ3DRP2Df9umDIzC4vCcpEYY+chQe0i2IKnLw03AT8Q==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/@nodelib/fs.scandir": {
|
"node_modules/@nodelib/fs.scandir": {
|
||||||
"version": "2.1.5",
|
"version": "2.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||||
@@ -647,15 +639,6 @@
|
|||||||
"@sveltejs/kit": "^1.0.0"
|
"@sveltejs/kit": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/adapter-static": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-1.0.6.tgz",
|
|
||||||
"integrity": "sha512-gTus2jW6bEQAZoT1MdmPHWZZmcb6dfLWc0r6dFHnbzSDZ68kifqQ1E+dZDOMF7aXeRV91sgnPuAn2MtpinVdlA==",
|
|
||||||
"dev": true,
|
|
||||||
"peerDependencies": {
|
|
||||||
"@sveltejs/kit": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sveltejs/kit": {
|
"node_modules/@sveltejs/kit": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.10.0.tgz",
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
<img src="{article.image}" class="image" alt='' />
|
<img src="{article.image}" class="image" alt='' />
|
||||||
{/if}
|
{/if}
|
||||||
<h2>{article.title}</h2>
|
<h2>{article.title}</h2>
|
||||||
|
{#if article.date}
|
||||||
|
{new Date(article.date).toLocaleDateString("fr-FR")}
|
||||||
|
{/if}
|
||||||
{#if article.description}
|
{#if article.description}
|
||||||
<p>{article.description}</p>
|
<p>{article.description}</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Binary file not shown.
23
src/lib/international.ts
Normal file
23
src/lib/international.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import type { create_ssr_component } from 'svelte/internal';
|
||||||
|
|
||||||
|
export type Mdsvex = {
|
||||||
|
metadata: {
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
date?: string;
|
||||||
|
tags?: string[];
|
||||||
|
image?: string;
|
||||||
|
};
|
||||||
|
default: ReturnType<typeof create_ssr_component>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const items = new Map(
|
||||||
|
Object.entries(
|
||||||
|
import.meta.glob<Mdsvex>('../routes/international/*/*{.md,.svelte,+page.md.index.svelte}')
|
||||||
|
).map(([path, load]) => [
|
||||||
|
path
|
||||||
|
.replace(/(\+page\.md|\.svelte|\/index\.md|\/index\.svelte)$/, '')
|
||||||
|
.replace(/^\.\.\/routes/, ''),
|
||||||
|
load
|
||||||
|
])
|
||||||
|
);
|
||||||
@@ -17,17 +17,14 @@
|
|||||||
<li aria-current={$page.url.pathname === '/' ? 'page' : undefined}>
|
<li aria-current={$page.url.pathname === '/' ? 'page' : undefined}>
|
||||||
<a href="/">Home</a>
|
<a href="/">Home</a>
|
||||||
</li>
|
</li>
|
||||||
<li aria-current={$page.url.pathname === '/about' ? 'page' : undefined}>
|
|
||||||
<a href="/about">About</a>
|
|
||||||
</li>
|
|
||||||
<li aria-current={$page.url.pathname.startsWith('/projects') ? 'page' : undefined}>
|
<li aria-current={$page.url.pathname.startsWith('/projects') ? 'page' : undefined}>
|
||||||
<a href="/projects">Projects</a>
|
<a href="/projects">Projects</a>
|
||||||
</li>
|
</li>
|
||||||
<li aria-current={$page.url.pathname.startsWith('/shs') ? 'page' : undefined}>
|
<li aria-current={$page.url.pathname.startsWith('/shs') ? 'page' : undefined}>
|
||||||
<a href="/shs">SHS</a>
|
<a href="/shs">SHS</a>
|
||||||
</li>
|
</li>
|
||||||
<li aria-current={$page.url.pathname.startsWith('/contact') ? 'page' : undefined}>
|
<li aria-current={$page.url.pathname.startsWith('/international') ? 'page' : undefined}>
|
||||||
<a href="/contact">Contact</a>
|
<a href="/international">International</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<svelte:head>
|
|
||||||
<title>About me</title>
|
|
||||||
<meta name="description" content="About me" />
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<div class="text-column">
|
|
||||||
<h1>About me</h1>
|
|
||||||
</div>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<h1>Work in progress</h1>
|
|
||||||
12
src/routes/international/+page.server.ts
Normal file
12
src/routes/international/+page.server.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { items } from '$lib/international';
|
||||||
|
import type { PageServerLoad } from './$types';
|
||||||
|
|
||||||
|
export const load: PageServerLoad = async () => ({
|
||||||
|
data: await Promise.all(
|
||||||
|
[...items.entries()].map(async ([path, load]) =>
|
||||||
|
load().then(({ metadata }) => ({ path, ...metadata }))
|
||||||
|
)
|
||||||
|
).then((data) =>
|
||||||
|
data.sort(({ date: a }, { date: z }) => new Date(z ?? 0).getTime() - new Date(a ?? 0).getTime())
|
||||||
|
)
|
||||||
|
});
|
||||||
34
src/routes/international/+page.svelte
Normal file
34
src/routes/international/+page.svelte
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import Card from '$lib/components/Card.svelte';
|
||||||
|
import type { PageData } from './$types';
|
||||||
|
|
||||||
|
export let data: PageData;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>International</title>
|
||||||
|
<meta name="description" content="international" />
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1>International</h1>
|
||||||
|
|
||||||
|
<p>This is the international page.</p>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<section class="card_list">
|
||||||
|
{#each data.data as article}
|
||||||
|
<Card {article} />
|
||||||
|
{/each}
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.card_list {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||||
|
gap: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
5
src/routes/international/+page.ts
Normal file
5
src/routes/international/+page.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
|
export const load: PageLoad = ({ data }) => ({
|
||||||
|
...data
|
||||||
|
});
|
||||||
16
src/routes/international/trips/+page.md
Normal file
16
src/routes/international/trips/+page.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
title: 👨💻 Travel Journal
|
||||||
|
date: 2024-10-24
|
||||||
|
description: Travel Journal
|
||||||
|
tags:
|
||||||
|
- travel
|
||||||
|
- journal
|
||||||
|
---
|
||||||
|
|
||||||
|
<div style="position: relative; width: 100%; height: 0; padding-top: 56.2500%;
|
||||||
|
padding-bottom: 0; box-shadow: 0 2px 8px 0 rgba(63,69,81,0.16); margin-top: 1.6em; margin-bottom: 0.9em; overflow: hidden;
|
||||||
|
border-radius: 8px; will-change: transform;">
|
||||||
|
<iframe loading="lazy" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0; border: none; padding: 0;margin: 0;"
|
||||||
|
src="https://www.canva.com/design/DAGI_IOWeMs/IrYKO0p7yfpkWyAWE2p74A/view?embed" allowfullscreen="allowfullscreen" allow="fullscreen">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
@@ -4,7 +4,10 @@ date: 2022-09-08
|
|||||||
description: A dashboard for can7
|
description: A dashboard for can7
|
||||||
tags:
|
tags:
|
||||||
- web
|
- web
|
||||||
- php
|
- js
|
||||||
- laravel
|
- sveltekit
|
||||||
image: /img/net7.png
|
- shadcn
|
||||||
|
image: /img/can7.png
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<img src="/img/can7.png" alt="drawing" width="100%" style="border-radius: 10px">
|
||||||
@@ -8,3 +8,5 @@ tags:
|
|||||||
- tailwind
|
- tailwind
|
||||||
image: /img/net7.png
|
image: /img/net7.png
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<img src="/img/net7.png" alt="net7" width="100%" style="border-radius: 10px">
|
||||||
BIN
static/img/can7.png
Normal file
BIN
static/img/can7.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
Reference in New Issue
Block a user