Compare commits

..

1 Commits

Author SHA1 Message Date
51ce59af5d chore(deps): update dependency python to 3.14
Some checks failed
test-build / build (pull_request) Failing after 1m18s
test-build / guarddog (pull_request) Failing after 1m57s
2026-02-18 21:01:30 +00:00
27 changed files with 194 additions and 141 deletions

View File

@@ -25,10 +25,8 @@ jobs:
RENOVATE_ENDPOINT: ${{ vars.INSTANCE_URL }}
RENOVATE_REPOSITORIES: alexlebens/site-profile
RENOVATE_GIT_AUTHOR: Renovate Bot <renovate-bot@alexlebens.net>
RENOVATE_REDIS_URL: ${{ vars.RENOVATE_REDIS_URL }}
LOG_LEVEL: info
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
RENOVATE_GIT_PRIVATE_KEY: ${{ secrets.RENOVATE_GIT_PRIVATE_KEY }}
RENOVATE_GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_COM_TOKEN }}
RENOVATE_REGISTRY_ALIASES: '{"dhi.io": "dhi.io"}'
RENOVATE_HOST_RULES: '[{"matchHost":"dhi.io","hostType":"docker","username":"${{ secrets.RENOVATE_DHI_USER }}","password":"${{ secrets.RENOVATE_DHI_TOKEN }}"}]'
RENOVATE_REDIS_URL: ${{ vars.RENOVATE_REDIS_URL }}

View File

@@ -60,7 +60,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
python-version: '3.14'
- name: Install GuardDog
run: |

View File

@@ -22,11 +22,13 @@ WORKDIR /app
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
LABEL version="2.14.1"
LABEL description="Astro based personal website"
ENV HOST=0.0.0.0
ENV SITE_URL=https://www.alexlebens.dev
ENV DIRECTUS_URL=https://directus.alexlebens.net
ENV PORT=4321
LABEL version="2.12.0"
LABEL description="Astro based personal website"
EXPOSE $PORT
CMD ["node", "./dist/server/entry.mjs"]

View File

@@ -9,16 +9,17 @@ import tailwindcss from '@tailwindcss/vite';
import icon from 'astro-icon';
import swup from '@swup/astro';
import { getSiteURL } from './src/support/url';
const getSiteURL = () => {
if (process.env.SITE_URL) {
return `https://${process.env.SITE_URL}`;
}
return 'http://localhost:4321';
};
export default defineConfig({
site: getSiteURL(),
image: {
remotePatterns: [
{ protocol: 'https', hostname: '*.alexlebens.net' },
{ protocol: 'https', hostname: '*.jsdelivr.net' },
],
service: {
entrypoint: 'astro/assets/services/sharp',
}

View File

@@ -1,7 +1,7 @@
{
"name": "site-profile",
"type": "module",
"version": "2.14.1",
"version": "2.12.0",
"homepage": "https://www.alexlebens.dev",
"bugs": {
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",

View File

@@ -90,7 +90,7 @@ const currentYear = new Date().getFullYear();
</div>
</div>
<!-- Bottom section -->
<div class="border-t border-divider pt-8 mt-12">
<div class="border-t border-neutral-400/30 dark:border-neutral-600/50 pt-8 mt-12">
<div class="flex flex-col md:flex-row items-center justify-between gap-4">
<p class="text-secondary text-sm">
&copy; {currentYear} All rights reserved.

View File

@@ -4,8 +4,7 @@ import { Icon } from 'astro-icon/components';
import type { Post } from '@lib/directusTypes';
import Image from '@components/ui/images/Image.astro';
import { formatDate } from '@support/time';
import { getDirectusImageURL } from '@/support/url';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
post: Post;
@@ -45,7 +44,11 @@ const { post } = Astro.props;
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
/>
<p class="card-text-description text-sm ml-auto">
{formatDate(post.published_date)}
{new Date(post.published_date).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
})}
</p>
</div>
</div>

View File

@@ -2,7 +2,7 @@
import { Icon } from 'astro-icon/components';
import Logo from '@components/ui/logos/Logo.astro';
import { getDirectusImageURL } from '@/support/url';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
topic: string;

View File

@@ -2,7 +2,7 @@
import { Icon } from 'astro-icon/components';
import Image from '@components/ui/images/Image.astro';
import { getDirectusImageURL } from '@/support/url';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
title: string;
@@ -15,15 +15,15 @@ interface Props {
const { title, subTitle, url, img, imgAlt } = Astro.props;
---
<div class="smooth-reveal flex flex-col px-4 py-10 mx-auto">
<div class="smooth-reveal group">
<a
class="md:card-base-hidden group items-center md:grid md:grid-cols-2 lg:grid lg:grid-cols-2 gap-8 xl:gap-16 max-w-340 2xl:max-w-full md:px-8 md:py-8"
class="card-base-hidden md:grid md:grid-cols-2 lg:grid lg:grid-cols-2 items-center gap-8 xl:gap-16 max-w-340 2xl:max-w-full px-4 sm:px-6 lg:px-8 py-10 sm:py-16 lg:py-14 mx-auto"
href={url}
data-astro-prefetch
>
<div>
<Image
class="rounded-2xl rounded-b-none md:rounded-2xl w-full h-full sm:max-h-80 md:max-h-90 object-cover"
class="rounded-xl w-full h-full sm:max-h-80 md:max-h-90 object-cover"
src={getDirectusImageURL(img)}
alt={imgAlt}
draggable="false"
@@ -32,11 +32,11 @@ const { title, subTitle, url, img, imgAlt } = Astro.props;
height="420"
/>
</div>
<div class="bg-background-card md:bg-transparent group-hover:bg-neutral-100 md:group-hover:bg-transparent dark:group-hover:bg-neutral-800/90 md:dark:group-hover:bg-transparent rounded-b-2xl transition-all duration-300 p-6">
<h2 class="card-text-header mb-2">
<div>
<h2 class="card-text-header mb-4">
{title}
</h2>
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose mb-8">
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose mb-4">
{subTitle}
</p>
<div class="button-base button-bg-teal inline-flex rounded-lg gap-x-2">

View File

@@ -2,7 +2,7 @@
import { Icon } from 'astro-icon/components';
import Image from '@components/ui/images/Image.astro';
import { getDirectusImageURL } from '@/support/url';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
title: string;
@@ -18,17 +18,17 @@ interface Props {
const { title, subTitle, url, single, imgOne, imgOneAlt, imgTwo, imgTwoAlt } = Astro.props;
---
<div class="smooth-reveal flex flex-col px-5 py-10 mx-auto">
<div class="smooth-reveal group">
<a
class="md:card-base-hidden group flex flex-col-reverse md:items-center md:grid md:grid-cols-2 lg:grid lg:grid-cols-2 md:gap-8 xl:gap-16 max-w-340 2xl:max-w-full md:px-8 md:py-8"
class="card-base-hidden items-center lg:grid lg:grid-cols-2 gap-16 max-w-340 2xl:max-w-full px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto"
href={url}
data-astro-prefetch
>
<div class="bg-background-card md:bg-transparent group-hover:bg-neutral-100 md:group-hover:bg-transparent dark:group-hover:bg-neutral-800/90 md:dark:group-hover:bg-transparent rounded-b-2xl transition-all duration-300 p-6">
<h2 class="card-text-header mb-2">
<div>
<h2 class="card-text-header mb-4">
{title}
</h2>
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose mb-8">
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose mb-4">
{subTitle}
</p>
<div class="button-base button-bg-teal inline-flex rounded-lg gap-x-2">
@@ -46,7 +46,7 @@ const { title, subTitle, url, single, imgOne, imgOneAlt, imgTwo, imgTwoAlt } = A
{single ? (
<div>
<Image
class="rounded-2xl rounded-b-none md:rounded-2xl w-full"
class="rounded-xl w-full"
src={getDirectusImageURL(imgOne)}
alt={imgOneAlt}
format="webp"

View File

@@ -18,7 +18,7 @@ const experiences = ((await directus.request(
<h3 class="smooth-reveal card-text-header flex relative items-center w-full gap-3 pb-10">
Experience
</h3>
<ul class="flex flex-col w-full ml-8 pr-8">
<ul class="ml-8 w-full flex flex-col">
{experiences.map((experience: Experience) => {
const startYear = new Date(experience.startDate).getFullYear();
const endYear = experience.endDate != null ? new Date(experience.endDate).getFullYear() : 'Present';
@@ -36,7 +36,7 @@ const experiences = ((await directus.request(
</time>
</header>
<div class="relative flex flex-col sm:col-span-12 pb-6">
<div class="absolute bg-accent -translate-x-[1.71rem] rounded-full h-2 w-2 mt-3"/>
<div class="absolute bg-stone-400 -translate-x-[1.71rem] rounded-full h-2 w-2 mt-4"/>
<h3>
<div
class="inline-flex items-center text-2xl leading-tight font-semibold"
@@ -78,7 +78,7 @@ const experiences = ((await directus.request(
</div>
)}
{(experience.responsibilities || experience.achievements) && (
<div class="relative flex flex-col gap-4 after:absolute after:bottom-0 after:h-12 after:w-full after:bg-linear-to-t after:from-neutral-200 dark:after:from-stone-700 after:content-[''] " :class="expanded ? 'after:hidden' : ''" x-show="expanded" x-collapse.min.50px>
<div class="relative flex flex-col gap-4 max-sm:h-auto! md:after:absolute md:after:bottom-0 md:after:h-12 md:after:w-full md:after:bg-linear-to-t md:after:from-neutral-200 dark:md:after:from-stone-700 md:after:content-[''] " :class="expanded ? 'after:hidden' : ''" x-show="expanded" x-collapse.min.50px>
{experience.responsibilities && (
<div class="flex flex-col gap-1">
<h4 class="text-header font-semibold">
@@ -108,7 +108,7 @@ const experiences = ((await directus.request(
</div>
)}
</div>
<button @click="expanded = ! expanded" class="group/more flex items-center justify-center text-primary hover:text-primary-hover text-xs underline transition-all gap-1.5 w-fit cursor-pointer">
<span x-text="expanded ? 'Show less' : 'Show more'">
Show more
@@ -129,7 +129,7 @@ const experiences = ((await directus.request(
</button>
<ul
class="flex print:hidden flex-wrap gap-2 mt-2"
class="flex print:hidden flex-wrap gap-2"
aria-label="Technologies used"
>
{experience.skills && experience.skills.map(skill => {

View File

@@ -17,7 +17,7 @@ interface Props {
const { title, subTitle, primaryBtn, primaryBtnURL, secondaryBtn, secondaryBtnURL, src, alt } = Astro.props;
const roundedClasses = Astro.props.rounded ? "rounded-2xl" : null;
const roundedClasses = Astro.props.rounded ? "rounded-xl" : null;
---
<section class="mx-auto grid max-w-340 gap-4 px-4 py-14 sm:px-6 md:grid-cols-2 md:items-center md:gap-8 lg:px-8 2xl:max-w-full">

View File

@@ -11,7 +11,7 @@ interface Props {
const { posts } = Astro.props;
---
<section class="smooth-reveal flex flex-col gap-4">
<section class="smooth-reveal">
{posts.map((post, index) => index % 2 === 0 ? (
<LargeBlogLeftCard
title={post.title}

View File

@@ -2,13 +2,13 @@ import { readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
const global = await directus.request(readSingleton('site_global'));
export interface NavigationLink {
name: string;
url: string;
}
const global = await directus.request(readSingleton('site_global'));
export const NavigationLinks: NavigationLink[] = [
{ name: 'Home', url: '/' },
{ name: 'Blog', url: '/blog/' },

View File

@@ -12,7 +12,7 @@ import type {
Skill,
} from '@lib/directusTypes';
import { getDirectusURL } from '@/support/url';
import { getDirectusURL } from '@lib/directusFunctions';
type Schema = {
site_global: Global;

View File

@@ -1,13 +1,12 @@
const getDirectusURL = () => {
if (process.env.DIRECTUS_URL) {
return `https://${process.env.DIRECTUS_URL}`;
}
return 'https://directus.alexlebens.net';
};
const getSiteURL = () => {
return 'https://www.alexlebens.dev';
};
async function getDirectusImageURL(image: string) {
return `${getDirectusURL()}/assets/${image}`;
}
export { getDirectusURL, getSiteURL, getDirectusImageURL };
export { getDirectusURL, getDirectusImageURL };

View File

@@ -1,10 +1,10 @@
---
import { readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
import BaseLayout from '@layouts/BaseLayout.astro';
import GoBackButton from '@/components/buttons/GoBackButton.astro';
import GoHomeButton from '@/components/buttons/GoHomeButton.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
const global = await directus.request(readSingleton('site_global'));
---
@@ -29,36 +29,39 @@ const global = await directus.request(readSingleton('site_global'));
}}
>
<section class="grid place-content-center mt-20">
<div class="max-w-7xl px-4 lg:px-6 py-8 lg:py-16 mx-auto">
<div class="text-center max-w-screen-sm mx-auto">
<section class="mt-20 grid place-content-center">
<div class="mx-auto max-w-7xl px-4 py-8 lg:px-6 lg:py-16">
<div class="mx-auto max-w-screen-sm text-center">
<div class="glitch-wrapper smooth-reveal">
<h1
class="glitch text-header text-9xl font-bold leading-none sm:text-[12rem]"
class="glitch text-9xl leading-none font-bold text-neutral-900 sm:text-[12rem] dark:text-neutral-100"
data-text="404"
>
Not Found
</h1>
</div>
<h1 class="smooth-reveal text-yellow-500 dark:text-yellow-400 text-4xl md:text-5xl font-bold leading-tight tracking-tight text-balance mt-30">
Page Not Found:
<h1
class="text-dark smooth-reveal mb-4 text-7xl font-extrabold text-yellow-500 lg:text-9xl dark:text-yellow-400"
>
{`Page Not Found - ${global.name}`}
</h1>
<h1 class="smooth-reveal card-text-header mt-8 mb-30">
{Astro.url.pathname.replace('/', '')}
</h1>
<div class="smooth-reveal card-base max-w-md p-6 mx-auto mt-16">
<h3 class="card-text-title text-sm tracking-wider uppercase">
<div
class="smooth-reveal mx-auto mt-16 max-w-md rounded-xl bg-neutral-100 p-6 shadow-xs dark:border-neutral-700/50 dark:bg-stone-800"
>
<h3
class="text-sm font-medium tracking-wider text-neutral-500 uppercase dark:text-neutral-400"
>
Did you know?
</h3>
<p
id="fun-fact"
class="text-secondary text-sm mt-4 mb-2"
>
<p class="mt-2 text-sm text-neutral-600 dark:text-neutral-300" id="fun-fact">
The 404 error code originated when CERN's web server displayed room 404 (their server
room) as the error message when a file wasn't found.
</p>
</div>
<div class="smooth-reveal flex flex-col sm:flex-row items-center justify-center gap-4 mt-10">
<div
class="smooth-reveal mt-10 flex flex-col items-center justify-center gap-4 sm:flex-row"
>
<GoBackButton/>
<GoHomeButton url={global.site_url} />
</div>

View File

@@ -1,13 +1,13 @@
---
import { readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
import BaseLayout from '@layouts/BaseLayout.astro';
import HeroSection from '@components/sections/HeroSection.astro';
import ExperienceSection from '@components/sections/ExperienceSection.astro';
import EducationSection from '@components/sections/EducationSection.astro';
import ProjectSection from '@components/sections/ProjectSection.astro';
import SkillsSliderSection from '@components/sections/SkillsSliderSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import portraitImg from '@images/portrait.avif';
@@ -42,7 +42,7 @@ const global = await directus.request(readSingleton('site_global'));
rounded={true}
/>
<section class="max-w-7xl px-4 sm:px-6 lg:px-8 py-10 lg:py-14 mx-auto">
<section class="mx-auto max-w-7xl px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<div class="flex flex-col gap-y-24 md:gap-y-32">
<ExperienceSection className="smooth-reveal" />
<EducationSection className="smooth-reveal" />

View File

@@ -1,10 +1,10 @@
---
import { readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
import BaseLayout from '@layouts/BaseLayout.astro';
import HeroSection from '@components/sections/HeroSection.astro';
import ApplicationSection from '@components/sections/ApplicationSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import applicationImg from '@images/cedar_tree.png';

View File

@@ -10,8 +10,8 @@ import Image from '@components/ui/images/Image.astro';
import SocialShareButton from '@components/buttons/SocialShareButton.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import { formatDate } from '@support/time';
import { getDirectusImageURL } from '@/support/url';
import { getDirectusImageURL } from '@lib/directusFunctions';
import { formatDateTime } from '@support/time';
const post = Astro.props;
@@ -31,7 +31,7 @@ const category: CollectionEntry<'categories'> = (await getCollection('categories
const readingTime = getReadingTime(post.content);
const highlighter = await createHighlighter({
themes: ['github-light', 'github-dark'],
themes: ['github-light', 'github-dark', 'monokai'],
langs: ['typescript', 'python', 'css', 'html', 'yaml', 'bash', 'json'],
});
@@ -68,7 +68,9 @@ const content = marked.parse(post.content);
name: global.name,
description: global.about,
},
image: [],
image: [
// post.data.banner,
],
headline: post.title,
datePublished: post.published_date,
dateModified: post.updated_date,
@@ -82,11 +84,11 @@ const content = marked.parse(post.content);
}}
>
<section class="max-w-6xl px-4 sm:px-6 lg:px-8 pt-8 lg:pt-12 pb-12 mx-auto">
<section class="mx-auto max-w-6xl px-4 pt-8 pb-12 sm:px-6 lg:px-8 lg:pt-12">
<div class="smooth-reveal relative w-full">
<div class="sm:shadow-xs sm:dark:shadow-md rounded-2xl mt-4 sm:mt-0">
<div class="mt-4 rounded-2xl shadow-none sm:mt-0 sm:shadow-sm">
<Image
class="rounded-2xl sm:rounded-b-none w-full max-h-150 object-cover"
class="max-h-[600px] w-full rounded-t-2xl object-cover"
src={getDirectusImageURL(post.image)}
alt={post.image_alt}
draggable="false"
@@ -94,54 +96,81 @@ const content = marked.parse(post.content);
loading="lazy"
inferSize={true}
/>
<div class="sm:bg-background-card rounded-b-2xl px-0 sm:px-6 md:px-10 lg:px-14 py-6">
<div class="text-center sm:text-left mt-4">
<h2 class="card-text-header block">
<div
class="rounded-b-2xl px-0 py-6 sm:bg-neutral-100 sm:px-6 md:px-10 lg:px-14 sm:dark:bg-neutral-900/30"
>
<div class="mb-16">
<h2
class="mb-6 block text-3xl font-bold tracking-tight text-balance text-neutral-800 md:text-4xl lg:text-5xl dark:text-neutral-300"
>
{post.title}
</h2>
<ol class="flex items-center justify-center sm:justify-start whitespace-nowrap gap-2 sm:gap-0 mt-6 sm:mt-4">
<ol class="mt-8 flex items-center whitespace-nowrap">
<li class="inline-flex items-center">
<a
class="inline-flex items-center text-secondary hover:text-secondary-hover text-sm transition-all duration-300"
class="flex items-center text-sm text-neutral-500 transition-all duration-300 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200"
href=`/categories/${category.slug}`
data-astro-prefetch
>
{category?.data?.title}
</a>
<span class="shrink-0 text-secondary text-sm mx-2 sm:mx-4">
/
</span>
<svg
class="mx-2 size-5 flex-shrink-0 text-neutral-500 dark:text-neutral-500"
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path d="M6 13L10 3" stroke="currentColor" stroke-linecap="round"></path>
</svg>
</li>
<li class="inline-flex items-center">
<span class="shrink-0 text-secondary text-sm">
{formatDate(post.published_date)}
</span>
<span class="shrink-0 text-secondary text-sm mx-2 sm:mx-4">
/
</span>
<li
class="inline-flex items-center text-sm text-neutral-500 transition-all duration-300 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200"
>
{formatDateTime(post.published_date)}
<svg
class="mx-2 size-5 flex-shrink-0 text-neutral-500 dark:text-neutral-500"
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path d="M6 13L10 3" stroke="currentColor" stroke-linecap="round"></path>
</svg>
</li>
<li class="inline-flex items-center">
<span class="shrink-0 text-secondary text-sm">
{readingTime.minutes.toPrecision(1)} minutes to read
</span>
<li
class="inline-flex items-center text-sm text-neutral-500 transition-all duration-300 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200"
aria-current="page"
>
{readingTime.minutes.toPrecision(1)} minutes to read
</li>
</ol>
</div>
<div class="border-t border-divider mt-10 mb-10"/>
<article class="text-header prose prose-blog sm:prose-lg dark:prose-invert max-w-none">
<article
class="prose prose-blog sm:prose-lg dark:prose-invert max-w-none text-neutral-800 dark:text-neutral-200"
>
<div set:html={content} />
</article>
<div class="grid sm:flex sm:items-center sm:justify-between gap-y-5 sm:gap-y-0 max-w-5xl mx-auto mt-10 md:mt-14">
<div class="flex flex-wrap sm:flex-nowrap sm:items-center gap-x-2 gap-y-1 sm:gap-y-0">
{post.tags.map((tag: string) => (
<span class="inline-flex items-center button-base bg-cobalt dark:bg-turquoise text-neutral-100 text-xs font-bold rounded-lg gap-x-1.5 px-3 py-1.5">
{tag}
</span>
))}
<div
class="mx-auto mt-10 grid max-w-screen-lg gap-y-5 sm:flex sm:items-center sm:justify-between sm:gap-y-0 md:mt-14"
>
<div class="flex flex-wrap gap-x-2 gap-y-1 sm:flex-nowrap sm:items-center sm:gap-y-0">
{
post.tags.map((tag: string) => (
<span class="bg-steel/30 dark:bg-bermuda/60 inline-flex items-center gap-x-1.5 rounded-lg px-3 py-1.5 text-xs font-medium text-neutral-700 outline-none focus:outline-none focus-visible:ring focus-visible:outline-none dark:text-neutral-200">
{tag}
</span>
))
}
</div>
<SocialShareButton pageTitle={post.title}/>
<SocialShareButton
pageTitle={post.title}
/>
</div>
</div>
</div>

View File

@@ -4,13 +4,11 @@ import { readItems, readSingleton } from '@directus/sdk';
import type { Post } from '@lib/directusTypes';
import HeaderSection from '@components/sections/HeaderSection.astro';
import BlogCard from '@components/cards/BlogCard.astro';
import HeaderSection from '@components/sections/HeaderSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
const { category } = Astro.props;
export async function getStaticPaths() {
const categories = await getCollection('categories');
return categories.map((category) => ({
@@ -19,6 +17,8 @@ export async function getStaticPaths() {
}));
}
const { category } = Astro.props;
const global = await directus.request(readSingleton('site_global'));
const posts = await directus.request(
readItems('posts', {
@@ -62,8 +62,8 @@ const categoriesPosts = posts
btnURL="/categories"
/>
<section class="max-w-340 2xl:max-w-full mb-10 px-4 sm:px-6 lg:px-8 py-8 mx-auto mt-10">
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
<section class="max-w-340 2xl:max-w-full mx-auto mt-10 mb-10 px-4 py-8 sm:px-6 lg:px-8">
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
{categoriesPosts.map((b) =>
<BlogCard post={b} />
)}

View File

@@ -1,10 +1,10 @@
---
import { readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
import BaseLayout from '@layouts/BaseLayout.astro';
import HeroSection from '@components/sections/HeroSection.astro';
import CategorySection from '@components/sections/CategorySection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import categoryImg from '@images/autumn_bench.png';

View File

@@ -3,13 +3,13 @@ import { readSingleton, readItems } from '@directus/sdk';
import type { Post } from '@lib/directusTypes';
import directus from '@lib/directus';
import BaseLayout from '@layouts/BaseLayout.astro';
import HeroSection from '@components/sections/HeroSection.astro';
import FeatureSection from '@components/sections/FeatureSection.astro';
import WeatherSection from '@components/sections/WeatherSection.astro';
import RecentPostsSection from '@components/sections/RecentPostsSection.astro';
import GiteaSection from '@components/sections/GiteaSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import homeImg from '@images/autumn_mountain.png';

View File

@@ -1,14 +1,31 @@
// https://docs.astro.build/en/guides/integrations-guide/sitemap/#usage
import type { APIRoute } from 'astro';
const getRobotsTxt = (sitemapURL: URL) => `\
const robotsTxt = `
User-agent: Googlebot
Disallow:
Allow: /
Crawl-delay: 10
User-agent: Yandex
Disallow:
Allow: /
Crawl-delay: 2
User-agent: archive.org_bot
Disallow:
Allow: /
Crawl-delay: 2
User-agent: *
Allow: /
Sitemap: ${sitemapURL.href}
`;
Sitemap: ${new URL('sitemap-index.xml', import.meta.env.SITE).href}`.trim();
export const GET: APIRoute = ({ site }) => {
const sitemapURL = new URL('sitemap-index.xml', site);
return new Response(getRobotsTxt(sitemapURL));
export const GET: APIRoute = () => {
return new Response(robotsTxt, {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
},
});
};

View File

@@ -9,8 +9,8 @@
/* https://tailwindcss.com/docs/dark-mode */
@custom-variant dark (&:where(.dark, .dark *));
/* Custom colors */
@theme {
/* Custom colors */
--color-midnight: #0c354d;
--color-ocean: #134e70;
@@ -26,24 +26,18 @@
--color-gitea-primary: #609926;
--color-gitea-secondary: #4c7a33;
/* Theme colors */
--color-main: light-dark(var(--color-steel), var(--color-bermuda));
--color-accent: light-dark(var(--color-bronze), var(--color-desert));
--color-active: light-dark(var(--color-orange-500), var(--color-orange-300));
/* Text colors */
--color-header: light-dark(var(--color-neutral-800), var(--color-neutral-200));
--color-primary: light-dark(var(--color-neutral-600), var(--color-neutral-200));
--color-primary-hover: light-dark(var(--color-neutral-800), var(--color-neutral-400));
--color-secondary: light-dark(var(--color-neutral-500), var(--color-neutral-400));
--color-secondary-hover: light-dark(var(--color-neutral-800), var(--color-neutral-200));
/* Object colors */
--color-background: light-dark(var(--color-neutral-200), var(--color-stone-700));
--color-background-accent: light-dark(color-mix(in srgb, var(--color-stone-300) 40%, transparent), color-mix(in srgb, var(--color-stone-800) 20%, transparent));
--color-background-card: light-dark(color-mix(in srgb, var(--color-neutral-100) 80%, transparent), color-mix(in srgb, var(--color-neutral-800) 60%, transparent));
--color-divider: light-dark(color-mix(in srgb, var(--color-neutral-400) 50%, transparent), color-mix(in srgb, var(--color-neutral-500) 50%, transparent));
}
@layer base {

View File

@@ -43,7 +43,7 @@
@utility button-bg-neutral {
@apply transition-all duration-300
border border-neutral-100 dark:border-stone-500/20
bg-background-card hover:bg-neutral-100 dark:hover:bg-neutral-800/90
bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90
}
@utility button-bg-gitea {
@@ -56,13 +56,13 @@
@apply transition-all duration-300
rounded-xl
border border-neutral-100 dark:border-stone-500/20
bg-background-card hover:bg-neutral-100 dark:hover:bg-neutral-800/90
bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90
shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg
}
@utility card-base-hidden {
@apply transition-all duration-300
rounded-2xl
rounded-xl
border border-transparent
hover:bg-neutral-400/20 dark:hover:bg-neutral-800/40
}

View File

@@ -17,6 +17,21 @@ const TimeAgoConfiguration: string[][] = [
['%s years ago', 'in %s years'],
];
function formatDate(date: Date): string {
const year = new Date(date).getFullYear();
const month = String(new Date(date).getMonth() + 1).padStart(2, '0');
const day = String(new Date(date).getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function formatDateTime(date: Date): string {
const hours = String(new Date(date).getHours()).padStart(2, '0');
const minutes = String(new Date(date).getMinutes()).padStart(2, '0');
return `${formatDate(date)} ${hours}:${minutes}`;
}
function timeago(date?: Date): string {
if (!date) {
return 'today';
@@ -31,12 +46,4 @@ function timeago(date?: Date): string {
return format(date, 'timeago');
}
function formatDate(date: Date): string {
return new Date(date).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
})
}
export { formatDate, timeago };
export { formatDate, timeago, formatDateTime };