Compare commits
1 Commits
main
...
4b08604f0c
| Author | SHA1 | Date | |
|---|---|---|---|
|
4b08604f0c
|
@@ -62,7 +62,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: kubernetes
|
||||
driver-opts: |
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: kubernetes
|
||||
driver-opts: |
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
@@ -22,7 +22,7 @@ WORKDIR /app
|
||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/dist /app/dist
|
||||
|
||||
LABEL version="2.21.0"
|
||||
LABEL version="2.19.0"
|
||||
LABEL description="Astro based personal website"
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "site-profile",
|
||||
"type": "module",
|
||||
"version": "2.21.0",
|
||||
"version": "2.19.0",
|
||||
"homepage": "https://www.alexlebens.dev",
|
||||
"bugs": {
|
||||
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
||||
|
||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -28,7 +28,7 @@ importers:
|
||||
version: 3.7.0
|
||||
'@directus/sdk':
|
||||
specifier: ^21.1.0
|
||||
version: 21.2.0
|
||||
version: 21.1.0
|
||||
'@giscus/react':
|
||||
specifier: ^3.1.0
|
||||
version: 3.1.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
@@ -803,8 +803,8 @@ packages:
|
||||
resolution: {integrity: sha512-VERIM64vtTP1C4mxQ5thVT9fK0apjPFobqybMtA1UdUujWka24ERHbRHFGmpbbhp73MhV+KSsHQH9C6uOTdEQA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@directus/sdk@21.2.0':
|
||||
resolution: {integrity: sha512-IrP6vpXqW0WYuwMcKa19odYZDVdTtBL4+0TaZeUGoNWgvncPcuTYVEtX4z93TEPfbFoSD0IwPx0gbhQ7YNbTGg==}
|
||||
'@directus/sdk@21.1.0':
|
||||
resolution: {integrity: sha512-Ig8zZAQDbc7QMIM54N+x71C04lni9MN9yalNAezjDjFdNknTJzupDY7V5cb+kOJL8GsqDE9Bg8xq8xCmkDVs5A==}
|
||||
engines: {node: '>=22'}
|
||||
|
||||
'@dprint/formatter@0.5.1':
|
||||
@@ -6796,7 +6796,7 @@ snapshots:
|
||||
dependencies:
|
||||
fontkitten: 1.0.2
|
||||
|
||||
'@directus/sdk@21.2.0': {}
|
||||
'@directus/sdk@21.1.0': {}
|
||||
|
||||
'@dprint/formatter@0.5.1': {}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { timeago } from '@support/time';
|
||||
const posts = await directus.request(
|
||||
readItems('posts', {
|
||||
filter: { published: { _eq: true } },
|
||||
fields: ['*', 'category.slug'],
|
||||
fields: ['*'],
|
||||
sort: ['-published_date'],
|
||||
})
|
||||
);
|
||||
@@ -31,16 +31,13 @@ const layoutPattern = [
|
||||
const postMap: Map<string, Post[]> = posts
|
||||
.sort((a: Post, b: Post) => b.published_date.valueOf() - a.published_date.valueOf())
|
||||
.reduce((acc, obj) => {
|
||||
const categorySlug = obj.category?.slug;
|
||||
if (!categorySlug) return acc;
|
||||
|
||||
let posts = acc.get(categorySlug);
|
||||
let posts = acc.get(obj.category);
|
||||
if (!posts) {
|
||||
posts = [];
|
||||
}
|
||||
posts.push(obj);
|
||||
|
||||
acc.set(categorySlug, posts);
|
||||
acc.set(obj.category, posts);
|
||||
|
||||
return acc;
|
||||
}, new Map<string, Post[]>());
|
||||
|
||||
@@ -68,51 +68,67 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`;
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body class="bg-background selection:bg-yellow-400 m-0 p-0 overflow-hidden">
|
||||
<body class="bg-background selection:bg-yellow-400 m-0 p-0 overflow-x-hidden">
|
||||
|
||||
<!-- Sliding backgrounds -->
|
||||
<div class="bg"/>
|
||||
<div class="bg bg2"/>
|
||||
<div class="bg bg3"/>
|
||||
|
||||
<!-- Fixed header -->
|
||||
<Header />
|
||||
<!-- Layout -->
|
||||
<div class="grow w-full max-w-(--breakpoint-2xl) px-4 sm:px-6 lg:px-8 py-20 mx-auto">
|
||||
|
||||
<!-- Content -->
|
||||
<div class="mask-container w-screen h-screen overflow-y-auto overflow-x-hidden">
|
||||
<main class="pt-20">
|
||||
<Header />
|
||||
|
||||
<main class="has-js scroll-fade-container min-h-screen">
|
||||
<slot />
|
||||
|
||||
<Footer />
|
||||
|
||||
</main>
|
||||
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
document.addEventListener('astro:page-load', () => {
|
||||
const onScroll = () => {
|
||||
document.documentElement.style.setProperty('--scroll-offset', `${window.scrollY}px`);
|
||||
document.documentElement.classList.add('has-js');
|
||||
};
|
||||
|
||||
window.removeEventListener('scroll', onScroll);
|
||||
window.addEventListener('scroll', onScroll, { passive: true });
|
||||
|
||||
onScroll();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* Fade away content below header when scrolling */
|
||||
.mask-container {
|
||||
.has-js .scroll-fade-container {
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent 0px,
|
||||
transparent 90px,
|
||||
black 140px,
|
||||
transparent 16px,
|
||||
black 80px,
|
||||
black 100%
|
||||
);
|
||||
|
||||
mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent 0px,
|
||||
transparent 90px,
|
||||
black 140px,
|
||||
transparent 16px,
|
||||
black 60px,
|
||||
black 100%
|
||||
);
|
||||
|
||||
-webkit-mask-size: 100vw 100vh;
|
||||
-webkit-mask-repeat: no-repeat;
|
||||
|
||||
-webkit-mask-position-y: var(--scroll-offset);
|
||||
mask-position-y: var(--scroll-offset);
|
||||
}
|
||||
|
||||
/* Background that creates the "glimmer" effect */
|
||||
|
||||
@@ -37,7 +37,7 @@ export type Post = {
|
||||
title: string;
|
||||
description: string;
|
||||
tags: string[];
|
||||
category: Category;
|
||||
category: string;
|
||||
selected: boolean;
|
||||
published: boolean;
|
||||
content: string;
|
||||
|
||||
@@ -17,9 +17,7 @@ import { getDirectusImageURL } from '@/support/url';
|
||||
const post = Astro.props;
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await directus.request(readItems('posts', {
|
||||
fields: ['*', 'category.*'],
|
||||
}));
|
||||
const posts = await directus.request(readItems('posts'));
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.slug },
|
||||
props: post,
|
||||
@@ -27,7 +25,12 @@ export async function getStaticPaths() {
|
||||
}
|
||||
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
const category = post.category;
|
||||
const [category] = post.category ? await directus.request(
|
||||
readItems('categories', {
|
||||
filter: { slug: { _eq: post.category },},
|
||||
limit: 1,
|
||||
}))
|
||||
: [];
|
||||
|
||||
const readingTime = getReadingTime(post.content || '');
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ const global = await directus.request(readSingleton('site_global'));
|
||||
const posts = await directus.request(
|
||||
readItems('posts', {
|
||||
filter: { published: { _eq: true } },
|
||||
fields: ['*', 'category.slug'],
|
||||
fields: ['*'],
|
||||
sort: ['-published_date'],
|
||||
})
|
||||
);
|
||||
@@ -30,7 +30,7 @@ const posts = await directus.request(
|
||||
const categoriesPosts = posts
|
||||
.sort((a: Post, b: Post) => b.published_date.valueOf() - a.published_date.valueOf())
|
||||
.filter((b) => {
|
||||
return b.category?.slug === category.slug;
|
||||
return b.category === category.slug;
|
||||
});
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user