Compare commits
17 Commits
a84d72d0d8
...
2.20.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 95ea235f9f | |||
| fe6604a5d9 | |||
| 2c2077053b | |||
| e7c660c142 | |||
| f4676d151f | |||
| ed0a691442 | |||
| 2aa17cd9c7 | |||
|
48991d411d
|
|||
|
724c85332f
|
|||
| bb4b9600e8 | |||
| 42c24882ff | |||
|
daef38d80d
|
|||
|
e4de55fab3
|
|||
| afa1f36285 | |||
| 93df739ea1 | |||
|
667950f053
|
|||
|
14402954f5
|
@@ -42,14 +42,14 @@ jobs:
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ vars.REPOSITORY_HOST }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.REPOSITORY_TOKEN }}
|
||||
|
||||
- name: Login to Docker
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ vars.DH_REGISTRY }}
|
||||
username: ${{ secrets.DH_USERNAME }}
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
driver: kubernetes
|
||||
driver-opts: |
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
@@ -42,14 +42,14 @@ jobs:
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY_HOST }}
|
||||
username: ${{ vars.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_SECRET }}
|
||||
|
||||
- name: Login to Docker
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ vars.DH_REGISTRY }}
|
||||
username: ${{ secrets.DH_USERNAME }}
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
driver: kubernetes
|
||||
driver-opts: |
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
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.19.0"
|
||||
LABEL version="2.20.1"
|
||||
LABEL description="Astro based personal website"
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "site-profile",
|
||||
"type": "module",
|
||||
"version": "2.19.0",
|
||||
"version": "2.20.1",
|
||||
"homepage": "https://www.alexlebens.dev",
|
||||
"bugs": {
|
||||
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
||||
|
||||
22
pnpm-lock.yaml
generated
22
pnpm-lock.yaml
generated
@@ -28,7 +28,7 @@ importers:
|
||||
version: 3.7.0
|
||||
'@directus/sdk':
|
||||
specifier: ^21.1.0
|
||||
version: 21.1.0
|
||||
version: 21.2.0
|
||||
'@giscus/react':
|
||||
specifier: ^3.1.0
|
||||
version: 3.1.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
@@ -67,10 +67,10 @@ importers:
|
||||
version: 1.1.5
|
||||
marked:
|
||||
specifier: ^17.0.3
|
||||
version: 17.0.3
|
||||
version: 17.0.4
|
||||
marked-shiki:
|
||||
specifier: ^1.2.1
|
||||
version: 1.2.1(marked@17.0.3)(shiki@4.0.1)
|
||||
version: 1.2.1(marked@17.0.4)(shiki@4.0.1)
|
||||
mdast-util-to-string:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
@@ -803,8 +803,8 @@ packages:
|
||||
resolution: {integrity: sha512-VERIM64vtTP1C4mxQ5thVT9fK0apjPFobqybMtA1UdUujWka24ERHbRHFGmpbbhp73MhV+KSsHQH9C6uOTdEQA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@directus/sdk@21.1.0':
|
||||
resolution: {integrity: sha512-Ig8zZAQDbc7QMIM54N+x71C04lni9MN9yalNAezjDjFdNknTJzupDY7V5cb+kOJL8GsqDE9Bg8xq8xCmkDVs5A==}
|
||||
'@directus/sdk@21.2.0':
|
||||
resolution: {integrity: sha512-IrP6vpXqW0WYuwMcKa19odYZDVdTtBL4+0TaZeUGoNWgvncPcuTYVEtX4z93TEPfbFoSD0IwPx0gbhQ7YNbTGg==}
|
||||
engines: {node: '>=22'}
|
||||
|
||||
'@dprint/formatter@0.5.1':
|
||||
@@ -4032,8 +4032,8 @@ packages:
|
||||
marked: '>=7.0.0'
|
||||
shiki: '>=1.0.0'
|
||||
|
||||
marked@17.0.3:
|
||||
resolution: {integrity: sha512-jt1v2ObpyOKR8p4XaUJVk3YWRJ5n+i4+rjQopxvV32rSndTJXvIzuUdWWIy/1pFQMkQmvTXawzDNqOH/CUmx6A==}
|
||||
marked@17.0.4:
|
||||
resolution: {integrity: sha512-NOmVMM+KAokHMvjWmC5N/ZOvgmSWuqJB8FoYI019j4ogb/PeRMKoKIjReZ2w3376kkA8dSJIP8uD993Kxc0iRQ==}
|
||||
engines: {node: '>= 20'}
|
||||
hasBin: true
|
||||
|
||||
@@ -6796,7 +6796,7 @@ snapshots:
|
||||
dependencies:
|
||||
fontkitten: 1.0.2
|
||||
|
||||
'@directus/sdk@21.1.0': {}
|
||||
'@directus/sdk@21.2.0': {}
|
||||
|
||||
'@dprint/formatter@0.5.1': {}
|
||||
|
||||
@@ -10387,12 +10387,12 @@ snapshots:
|
||||
|
||||
markdown-table@3.0.4: {}
|
||||
|
||||
marked-shiki@1.2.1(marked@17.0.3)(shiki@4.0.1):
|
||||
marked-shiki@1.2.1(marked@17.0.4)(shiki@4.0.1):
|
||||
dependencies:
|
||||
marked: 17.0.3
|
||||
marked: 17.0.4
|
||||
shiki: 4.0.1
|
||||
|
||||
marked@17.0.3: {}
|
||||
marked@17.0.4: {}
|
||||
|
||||
math-intrinsics@1.1.0: {}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { timeago } from '@support/time';
|
||||
const posts = await directus.request(
|
||||
readItems('posts', {
|
||||
filter: { published: { _eq: true } },
|
||||
fields: ['*'],
|
||||
fields: ['*', 'category.slug'],
|
||||
sort: ['-published_date'],
|
||||
})
|
||||
);
|
||||
@@ -31,13 +31,16 @@ const layoutPattern = [
|
||||
const postMap: Map<string, Post[]> = posts
|
||||
.sort((a: Post, b: Post) => b.published_date.valueOf() - a.published_date.valueOf())
|
||||
.reduce((acc, obj) => {
|
||||
let posts = acc.get(obj.category);
|
||||
const categorySlug = obj.category?.slug;
|
||||
if (!categorySlug) return acc;
|
||||
|
||||
let posts = acc.get(categorySlug);
|
||||
if (!posts) {
|
||||
posts = [];
|
||||
}
|
||||
posts.push(obj);
|
||||
|
||||
acc.set(obj.category, posts);
|
||||
acc.set(categorySlug, posts);
|
||||
|
||||
return acc;
|
||||
}, new Map<string, Post[]>());
|
||||
|
||||
@@ -93,15 +93,26 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`;
|
||||
|
||||
<script>
|
||||
document.addEventListener('astro:page-load', () => {
|
||||
let ticking = false;
|
||||
const onScroll = () => {
|
||||
document.documentElement.style.setProperty('--scroll-offset', `${window.scrollY}px`);
|
||||
document.documentElement.classList.add('has-js');
|
||||
if (!ticking) {
|
||||
window.requestAnimationFrame(() => {
|
||||
document.documentElement.style.setProperty('--scroll-offset', `${window.scrollY}px`);
|
||||
ticking = false;
|
||||
});
|
||||
ticking = true;
|
||||
}
|
||||
};
|
||||
|
||||
window.removeEventListener('scroll', onScroll);
|
||||
window.addEventListener('scroll', onScroll, { passive: true });
|
||||
|
||||
|
||||
onScroll();
|
||||
|
||||
document.documentElement.classList.add('has-js');
|
||||
|
||||
document.addEventListener('astro:before-swap', () => {
|
||||
window.removeEventListener('scroll', onScroll);
|
||||
}, { once: true });
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -129,6 +140,7 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`;
|
||||
|
||||
-webkit-mask-position-y: var(--scroll-offset);
|
||||
mask-position-y: var(--scroll-offset);
|
||||
will-change: mask-position;
|
||||
}
|
||||
|
||||
/* Background that creates the "glimmer" effect */
|
||||
|
||||
@@ -37,7 +37,7 @@ export type Post = {
|
||||
title: string;
|
||||
description: string;
|
||||
tags: string[];
|
||||
category: string;
|
||||
category: Category;
|
||||
selected: boolean;
|
||||
published: boolean;
|
||||
content: string;
|
||||
|
||||
@@ -17,7 +17,9 @@ import { getDirectusImageURL } from '@/support/url';
|
||||
const post = Astro.props;
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await directus.request(readItems('posts'));
|
||||
const posts = await directus.request(readItems('posts', {
|
||||
fields: ['*', 'category.*'],
|
||||
}));
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.slug },
|
||||
props: post,
|
||||
@@ -25,12 +27,7 @@ export async function getStaticPaths() {
|
||||
}
|
||||
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
const [category] = post.category ? await directus.request(
|
||||
readItems('categories', {
|
||||
filter: { slug: { _eq: post.category },},
|
||||
limit: 1,
|
||||
}))
|
||||
: [];
|
||||
const category = post.category;
|
||||
|
||||
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: ['*'],
|
||||
fields: ['*', 'category.slug'],
|
||||
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 === category.slug;
|
||||
return b.category?.slug === category.slug;
|
||||
});
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user