Compare commits

..

36 Commits

Author SHA1 Message Date
113f42ca21 feat: setup node
All checks were successful
test-build / guarddog (push) Successful in 25s
renovate / renovate (push) Successful in 59s
test-build / build (push) Successful in 1m31s
release-image-gitea / build (push) Successful in 1m33s
release-image-harbor / build (push) Successful in 1m48s
release-image-gitea / release (push) Successful in 3m53s
release-image-harbor / release (push) Successful in 4m40s
2026-03-11 01:09:20 -05:00
1f2820e4b4 feat: convert to bun
Some checks failed
test-build / guarddog (push) Successful in 19s
renovate / renovate (push) Successful in 53s
test-build / build (push) Failing after 1m20s
2026-03-11 01:03:51 -05:00
dc088306ce feat: update workflow to major version
All checks were successful
test-build / guarddog (push) Successful in 13s
renovate / renovate (push) Successful in 40s
test-build / build (push) Successful in 1m57s
2026-03-11 00:15:25 -05:00
f6c1cf1bf5 chore(deps): update deps
All checks were successful
renovate / renovate (push) Successful in 30s
test-build / guarddog (push) Successful in 25s
test-build / build (push) Successful in 2m10s
2026-03-11 00:00:51 -05:00
962f354208 feat: release 3.0.0, major astro update to 6.0
Some checks failed
renovate / renovate (push) Successful in 44s
test-build / guarddog (push) Successful in 1m6s
test-build / build (push) Has been cancelled
2026-03-10 23:58:53 -05:00
bf43212afc Merge pull request 'fix(deps): update astro monorepo (major)' (#376) from renovate/major-astro-monorepo into main
Some checks failed
test-build / guarddog (push) Successful in 21s
renovate / renovate (push) Successful in 36s
test-build / build (push) Failing after 3m19s
Reviewed-on: #376
2026-03-11 04:55:31 +00:00
ef810efd24 fix(deps): update astro monorepo
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
test-build / guarddog (pull_request) Successful in 19s
test-build / build (pull_request) Successful in 1m31s
2026-03-11 04:53:28 +00:00
b8379bbc38 feat: reduce scale effect
All checks were successful
test-build / guarddog (push) Successful in 24s
renovate / renovate (push) Successful in 41s
test-build / build (push) Successful in 3m2s
2026-03-10 23:40:28 -05:00
e2f5bbbe9c feat: hide cards on small screens
Some checks failed
test-build / guarddog (push) Successful in 19s
renovate / renovate (push) Successful in 50s
test-build / build (push) Failing after 1m38s
2026-03-10 23:30:23 -05:00
f030da549e feat: add gap to distinguish 2026-03-10 23:11:45 -05:00
2fbc9a764f feat: move all categories card to bottom of category section
All checks were successful
test-build / guarddog (push) Successful in 18s
renovate / renovate (push) Successful in 32s
test-build / build (push) Successful in 1m43s
2026-03-10 23:08:43 -05:00
940342cc3f feat: move all posts to bottom of recent section 2026-03-10 22:57:38 -05:00
05d7ad6557 feat: consistent gaps and margins 2026-03-10 22:54:41 -05:00
31621e4f7e feat: simplify layout of the features cards 2026-03-10 22:48:17 -05:00
6156012c00 feat: markdown support for rss 2026-03-10 22:37:55 -05:00
af6554985e chore(deps): update deps 2026-03-10 22:37:09 -05:00
e25a3d0189 feat: change responsive height of image 2026-03-10 22:27:15 -05:00
18c2b54f65 feat: use metadata snippet for blog cards 2026-03-10 22:27:15 -05:00
265fd4f2cb feat: refactor how blog cards layout, add metadata, better responsiveness 2026-03-10 22:27:15 -05:00
cc8bade886 feat: move post metadata to snippet component 2026-03-10 22:27:15 -05:00
c92fb72a73 Merge pull request 'chore(deps): update dependency @iconify-json/simple-icons to v1.2.73' (#375) from renovate/iconify-json-simple-icons-1.x-lockfile into main
All checks were successful
test-build / guarddog (push) Successful in 25s
test-build / build (push) Successful in 4m16s
renovate / renovate (push) Successful in 1m29s
2026-03-10 21:24:46 +00:00
5da828f5a7 chore(deps): update dependency @iconify-json/simple-icons to v1.2.73
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
test-build / guarddog (pull_request) Successful in 31s
test-build / build (pull_request) Successful in 2m26s
2026-03-10 21:24:34 +00:00
f30f5cf933 Merge pull request 'chore(deps): update astro monorepo' (#374) from renovate/astro-monorepo into main
Some checks failed
test-build / guarddog (push) Successful in 20s
renovate / renovate (push) Has been cancelled
test-build / build (push) Has been cancelled
2026-03-10 21:24:12 +00:00
48231fc441 chore(deps): update astro monorepo
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
test-build / guarddog (pull_request) Successful in 33s
test-build / build (pull_request) Successful in 6m24s
2026-03-10 21:23:54 +00:00
d42ba08041 feat: minor tweaks
All checks were successful
test-build / guarddog (push) Successful in 23s
renovate / renovate (push) Successful in 1m0s
test-build / build (push) Successful in 1m54s
2026-03-09 23:17:02 -05:00
fa618b0524 feat: add margin to bring in the content 2026-03-09 23:17:02 -05:00
0a17e3b8af feat: remove unused properties 2026-03-09 23:17:01 -05:00
341453510f feat: redo layout, smaller and with logo 2026-03-09 23:17:01 -05:00
c9cb15f201 feat: convert hero section to use randomly selected images stored in directus 2026-03-09 23:17:01 -05:00
74e9aff4cc Merge pull request 'chore(deps): update dependency typescript-eslint to v8.57.0' (#373) from renovate/typescript-eslint-monorepo into main
All checks were successful
test-build / guarddog (push) Successful in 35s
test-build / build (push) Successful in 3m0s
renovate / renovate (push) Successful in 1m24s
Reviewed-on: #373
2026-03-09 22:28:39 +00:00
d48d61ce91 chore(deps): update dependency typescript-eslint to v8.57.0
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
test-build / guarddog (pull_request) Successful in 32s
test-build / build (pull_request) Successful in 1m31s
2026-03-09 22:00:16 +00:00
68f179456a feat: reword titles and descriptions
Some checks failed
renovate / renovate (push) Successful in 1m30s
test-build / guarddog (push) Successful in 19s
test-build / build (push) Has been cancelled
2026-03-09 16:58:34 -05:00
568220d39c feat: adjust layout of recent posts 2026-03-09 16:58:34 -05:00
9dfcf6f006 feat: make cards fixed height 2026-03-09 16:58:34 -05:00
62886ba2b3 Merge pull request 'chore(deps): update dependency shiki to v4.0.2' (#372) from renovate/shiki-monorepo into main
All checks were successful
renovate / renovate (push) Successful in 1m9s
test-build / guarddog (push) Successful in 48s
test-build / build (push) Successful in 2m2s
2026-03-09 21:18:05 +00:00
90bc982371 chore(deps): update dependency shiki to v4.0.2
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
test-build / guarddog (pull_request) Successful in 26s
test-build / build (pull_request) Successful in 2m4s
2026-03-09 21:17:55 +00:00
46 changed files with 3414 additions and 13037 deletions

View File

@@ -3,7 +3,7 @@ name: release-image-gitea
on:
push:
tags:
- 2.*
- 3.*
workflow_dispatch:
@@ -14,19 +14,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
version: 10.x
bun-version: 1.3.10
- name: Set up Node.js
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 24.14.0
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile
- name: Cache Astro Build Cache
uses: actions/cache@v5
@@ -34,16 +33,16 @@ jobs:
path: |
node_modules/.cache
.astro/cache
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-astro-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-
${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-
${{ runner.os }}-astro-cache-
- name: Lint Code
run: pnpm lint
run: bun run lint
- name: Build Project
run: pnpm build
run: bun run build
release:
runs-on: ubuntu-js

View File

@@ -3,7 +3,7 @@ name: release-image-harbor
on:
push:
tags:
- 2.*
- 3.*
workflow_dispatch:
@@ -14,19 +14,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
version: 10.x
bun-version: 1.3.10
- name: Set up Node.js
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 24.14.0
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile
- name: Cache Astro Build Cache
uses: actions/cache@v5
@@ -34,16 +33,16 @@ jobs:
path: |
node_modules/.cache
.astro/cache
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-astro-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-
${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-
${{ runner.os }}-astro-cache-
- name: Lint Code
run: pnpm lint
run: bun run lint
- name: Build Project
run: pnpm build
run: bun run build
release:
runs-on: ubuntu-js

View File

@@ -16,19 +16,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
version: 10.x
bun-version: 1.3.10
- name: Set up Node.js
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 24.14.0
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile
- name: Cache Astro Build Cache
uses: actions/cache@v5
@@ -36,16 +35,16 @@ jobs:
path: |
node_modules/.cache
.astro/cache
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-astro-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-
${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-
${{ runner.os }}-astro-cache-
- name: Lint Code
run: pnpm lint
run: bun run lint
- name: Build Project
run: pnpm build
run: bun run build
- name: ntfy Failed
uses: niniyas/ntfy-action@master

2
.gitignore vendored
View File

@@ -10,8 +10,6 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env

3
.npmrc
View File

@@ -1,3 +0,0 @@
registry=https://registry.npmjs.org/
engine-strict=true
save-exact=true

View File

@@ -1,32 +1,30 @@
FROM docker.io/node:24.14.0-alpine AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM dhi.io/bun:1.3.10-debian13-dev AS builder
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
COPY package.json bun.lock ./
FROM builder AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
bun install --production --frozen-lockfile
FROM prod-deps AS build-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM builder AS build-deps
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
bun install --frozen-lockfile
FROM build-deps AS build
COPY . .
RUN pnpm run build
RUN bun run build
FROM dhi.io/node:24.14.0 AS runtime
FROM dhi.io/bun:1.3.10-alpine3.22 AS runtime
WORKDIR /app
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
LABEL version="2.25.0"
LABEL version="3.1.0"
LABEL description="Astro based personal website"
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE $PORT
CMD ["node", "./dist/server/entry.mjs"]
CMD ["bun", "run", "./dist/server/entry.mjs"]

View File

@@ -7,9 +7,8 @@ Personal site used for information about myself and blog.
With dependencies installed, you can utilize the following npm scripts to manage your project's development lifecycle:
- `pnpm build`: Bundles your site into static files for production.
- `pnpm dev`: Starts a local development server with hot reloading enabled.
- `pnpm preview`: Serves your build output locally for preview before deployment.
- `bun run build`: Bundles your site into static files for production.
- `bun run dev`: Starts a local development server with hot reloading enabled.
For detailed help with Astro CLI commands, visit [Astro's documentation](https://docs.astro.build/en/reference/cli-reference/).

2942
bun.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "site-profile",
"type": "module",
"version": "2.25.0",
"version": "3.0.0",
"homepage": "https://www.alexlebens.dev",
"bugs": {
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
@@ -27,55 +27,57 @@
"lint:fix": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\""
},
"dependencies": {
"@astrojs/check": "^0.9.6",
"@astrojs/node": "^9.5.4",
"@astrojs/partytown": "^2.1.4",
"@astrojs/react": "^4.4.2",
"@astrojs/rss": "^4.0.15",
"@astrojs/sitemap": "^3.7.0",
"@directus/sdk": "^21.2.0",
"@giscus/react": "^3.1.0",
"@iconify-json/mdi": "^1.2.3",
"@iconify-json/pajamas": "^1.2.15",
"@iconify-json/simple-icons": "^1.2.72",
"@playform/compress": "^0.2.1",
"@swup/astro": "^1.8.0",
"@tailwindcss/postcss": "^4.2.1",
"@tailwindcss/vite": "^4.2.1",
"@types/react": "^19.2.14",
"@types/unist": "^3.0.3",
"astro": "^5.18.0",
"astro-icon": "^1.1.5",
"marked": "^17.0.4",
"marked-shiki": "^1.2.1",
"mdast-util-to-string": "^4.0.0",
"photoswipe": "^5.4.4",
"preline": "^4.1.2",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"reading-time": "^1.5.0",
"sharp": "^0.34.5",
"sharp-ico": "^0.1.5",
"shiki": "^4.0.1",
"tailwindcss": "^4.2.1",
"ultrahtml": "^1.6.0"
"@astrojs/check": "0.9.7",
"@astrojs/node": "10.0.0",
"@astrojs/partytown": "2.1.5",
"@astrojs/react": "5.0.0",
"@astrojs/rss": "4.0.17",
"@astrojs/sitemap": "3.7.1",
"@directus/sdk": "21.2.0",
"@giscus/react": "3.1.0",
"@iconify-json/mdi": "1.2.3",
"@iconify-json/pajamas": "1.2.15",
"@iconify-json/simple-icons": "1.2.73",
"@playform/compress": "0.2.1",
"@swup/astro": "1.8.0",
"@tailwindcss/postcss": "4.2.1",
"@tailwindcss/vite": "4.2.1",
"@types/react": "19.2.14",
"@types/unist": "3.0.3",
"astro": "6.0.2",
"astro-icon": "1.1.5",
"markdown-it": "14.1.1",
"marked": "17.0.4",
"marked-shiki": "1.2.1",
"mdast-util-to-string": "4.0.0",
"photoswipe": "5.4.4",
"preline": "4.1.2",
"react": "19.2.4",
"react-dom": "19.2.4",
"reading-time": "1.5.0",
"sharp": "0.34.5",
"sharp-ico": "0.1.5",
"shiki": "4.0.2",
"tailwindcss": "4.2.1",
"ultrahtml": "1.6.0"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^2.13.0",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/typography": "^0.5.19",
"eslint": "^10.0.3",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-astro": "^1.6.0",
"eslint-plugin-format": "^2.0.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"prettier": "^3.8.1",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.7.2",
"timeago.js": "^4.0.2",
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.1"
"@eslint-react/eslint-plugin": "2.13.0",
"@tailwindcss/forms": "0.5.11",
"@tailwindcss/typography": "0.5.19",
"@types/markdown-it": "14.1.2",
"eslint": "10.0.3",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-astro": "1.6.0",
"eslint-plugin-format": "2.0.1",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-refresh": "0.5.2",
"prettier": "3.8.1",
"prettier-plugin-astro": "0.14.1",
"prettier-plugin-tailwindcss": "0.7.2",
"timeago.js": "4.0.2",
"typescript": "5.9.3",
"typescript-eslint": "8.57.0"
}
}

12606
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +0,0 @@
onlyBuiltDependencies:
- swup

View File

@@ -0,0 +1,15 @@
---
import { Icon } from 'astro-icon/components';
---
<div class="button-base button-bg-teal inline-flex shrink-0 rounded-lg gap-x-2">
<div class="button-text-title flex relative items-center text-center">
<span class="mr-2">
Read More
</span>
<Icon
name="mdi:keyboard-arrow-right"
class="button-hover-arrow"
/>
</div>
</div>

View File

@@ -1,10 +1,9 @@
---
import { Icon } from 'astro-icon/components';
import { Image } from 'astro:assets';
import type { Post } from '@lib/directusTypes';
import { formatDate } from '@support/time';
import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro';
import { getDirectusImageURL } from '@/support/url';
interface Props {
@@ -16,13 +15,13 @@ const { post } = Astro.props;
<div class="smooth-reveal-cards group flex flex-col">
<a
class="card-base border-none!"
class="card-base border-none! h-full flex flex-col"
href={`/blog/${post.slug}/`}
data-astro-prefetch
>
<div class="relative shrink-0 rounded-t-xl w-full overflow-hidden before:absolute before:inset-x-0 before:z-1 before:size-full">
<Image
class="rounded-t-xl h-auto w-full"
class="rounded-t-xl h-64 w-full object-cover"
src={getDirectusImageURL(post.image)}
alt={post.image_alt}
draggable="false"
@@ -31,25 +30,17 @@ const { post } = Astro.props;
inferSize={true}
/>
</div>
<div class="rounded-xl p-4 md:p-5">
<h3 class="card-text-title text-xl">
{post.title}
</h3>
<div class="ml-6 flex">
<div class="relative inline-block w-full">
<div class="card-text-title card-hover-text-title flex relative items-center mx-auto min-h-11 sm:mx-0 sm:mt-4">
<span class="relative inline-block overflow-hidden ml-2">
Read more
</span>
<Icon
name="mdi:keyboard-arrow-right"
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)}
</p>
</div>
</div>
<div class="flex flex-col flex-1 rounded-xl p-4 md:p-5 mx-1 mb-2">
<div class="flex flex-row items-center mb-8">
<h3 class="card-text-title card-hover-text-title text-2xl">
{post.title}
</h3>
</div>
<div class="mt-auto">
<PostMetadataSnippet
enableCategoryLink={false}
post={post}
/>
</div>
</div>
</a>

View File

@@ -1,62 +1,53 @@
---
import { Icon } from 'astro-icon/components';
import { Image } from 'astro:assets';
import { formatDate } from '@support/time';
import type { Post } from '@lib/directusTypes';
import ReadMoreButton from '@components/buttons/ReadMoreButton.astro';
import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro';
import { getDirectusImageURL } from '@/support/url';
interface Props {
title: string;
subTitle: string;
url: string;
pubDate: Date,
img: string;
imgAlt: string;
post: Post;
}
const { title, subTitle, url, pubDate, img, imgAlt } = Astro.props;
const { post } = Astro.props;
---
<div class="smooth-reveal flex flex-col px-4 py-10 mx-auto w-full">
<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 w-full md:px-8 md:py-8"
href={url}
class="md:card-base-hidden group md:grid md:grid-cols-2 lg:grid lg:grid-cols-2 gap-8 xl:gap-16 w-full md:px-8 md:py-8"
href={`/blog/${post.slug}`}
data-astro-prefetch
>
<div>
<div class="h-full">
<Image
class="rounded-2xl rounded-b-none md:rounded-2xl md:shadow-2xl w-full h-full sm:max-h-80 md:max-h-90 object-cover"
src={getDirectusImageURL(img)}
alt={imgAlt}
class="rounded-2xl rounded-b-none md:rounded-2xl md:shadow-2xl w-full h-full object-cover"
src={getDirectusImageURL(post.image)}
alt={post.image_alt}
draggable="false"
loading="lazy"
width="850"
height="420"
inferSize={true}
/>
</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">
{title}
<div class="flex flex-col justify-center 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 gap-4">
<h2 class="card-text-header">
{post.title}
</h2>
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose mb-8">
{subTitle}
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose">
{post.description}
</p>
<div class="flex items-center justify-between w-full">
<div class="button-base button-bg-teal inline-flex rounded-lg gap-x-2">
<div class="button-text-title flex relative items-center text-center">
<span class="mr-2">
Read More
</span>
<Icon
name="mdi:keyboard-arrow-right"
class="button-hover-arrow"
/>
</div>
<div class="flex md:flex-col-reverse lg:flex-row items-center md:items-start lg:items-center justify-between w-full md:gap-4">
<div class="hidden md:block shrink-0 mt-4">
<ReadMoreButton/>
</div>
<div class="mt-2 lg:mt-4">
<PostMetadataSnippet
post={post}
enableCategoryLink={false}
/>
</div>
<span class="card-text-description text-sm ml-auto">
{formatDate(pubDate)}
</span>
</div>
</div>
</a>
</div>

View File

@@ -1,104 +1,86 @@
---
import { Icon } from 'astro-icon/components';
import { Image } from 'astro:assets';
import { formatDate } from '@support/time';
import type { Post } from '@lib/directusTypes';
import ReadMoreButton from '@components/buttons/ReadMoreButton.astro';
import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro';
import { getDirectusImageURL } from '@/support/url';
interface Props {
title: string;
subTitle: string;
url: string;
pubDate: Date;
imgOne: string;
imgOneAlt: string;
imgTwo?: string;
imgTwoAlt?: string;
post: Post;
}
const { title, subTitle, url, pubDate, imgOne, imgOneAlt, imgTwo, imgTwoAlt } = Astro.props;
const { post } = Astro.props;
---
<div class="smooth-reveal flex flex-col px-4 py-10 mx-auto w-full">
<a
class="md:card-base-hidden group flex flex-col-reverse md:grid md:items-center md:grid-cols-2 lg:grid lg:grid-cols-2 md:gap-8 xl:gap-16 w-full md:px-8 md:py-8"
href={url}
href={`/blog/${post.slug}`}
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">
{title}
<div class="flex flex-col 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 gap-4">
<h2 class="card-text-header">
{post.title}
</h2>
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose mb-8">
{subTitle}
<p class="card-text-title font-light text-pretty sm:text-lg max-w-prose">
{post.description}
</p>
<div class="flex items-center justify-between w-full">
<div class="button-base button-bg-teal inline-flex rounded-lg gap-x-2">
<div class="button-text-title flex relative items-center text-center">
<span class="mr-2">
Read More
</span>
<Icon
name="mdi:keyboard-arrow-right"
class="button-hover-arrow"
/>
</div>
<div class="flex md:flex-col-reverse lg:flex-row items-center md:items-start lg:items-center justify-between w-full md:gap-4">
<div class="hidden md:block shrink-0 mt-4">
<ReadMoreButton/>
</div>
<div class="mt-2 lg:mt-4">
<PostMetadataSnippet
post={post}
enableCategoryLink={false}
/>
</div>
<span class="card-text-description text-sm ml-auto">
{formatDate(pubDate)}
</span>
</div>
</div>
{!imgTwo ? (
<div>
{!post.image_second ? (
<div class="h-full">
<Image
class="rounded-2xl rounded-b-none md:rounded-2xl md:shadow-2xl w-full h-full sm:max-h-80 md:max-h-90 object-cover"
src={getDirectusImageURL(imgOne)}
alt={imgOneAlt}
src={getDirectusImageURL(post.image)}
alt={post.image_alt}
draggable="false"
loading="lazy"
width="850"
height="420"
inferSize={true}
/>
</div>
) : (
<>
<div class="h-full">
<div class="md:hidden">
<Image
class="rounded-2xl rounded-b-none shadow-2xl w-full h-full sm:max-h-80 object-cover"
src={getDirectusImageURL(imgOne)}
alt={imgOneAlt}
src={getDirectusImageURL(post.image)}
alt={post.image_alt}
draggable="false"
loading="lazy"
width="850"
height="420"
inferSize={true}
/>
</div>
<div class="hidden md:flex md:items-start">
<Image
class="rounded-xl z-10 shadow-2xl w-3/5 h-full object-cover"
src={getDirectusImageURL(imgOne)}
alt={imgOneAlt}
src={getDirectusImageURL(post.image)}
alt={post.image_alt}
draggable="false"
loading="lazy"
width="600"
height="310"
inferSize={true}
/>
<Image
class="rounded-xl shadow-2xl w-3/5 h-full -ml-16 mt-12 object-cover"
src={getDirectusImageURL(imgTwo)}
alt={imgTwoAlt}
src={getDirectusImageURL(post.image_second)}
alt={post.image_second_alt}
draggable="false"
loading="lazy"
width="600"
height="310"
inferSize={true}
/>
</div>
</>
</div>
)}
</a>
</div>

View File

@@ -15,7 +15,7 @@ interface Props {
const { url, title, description, logoLight, logoDark, count, publishDate } = Astro.props;
---
<div class="smooth-reveal flex flex-col mx-auto w-full">
<div class="smooth-reveal-cards flex flex-col mx-auto w-full">
<a
class="card-base flex flex-col h-full min-h-55"
href={url}

View File

@@ -0,0 +1,44 @@
---
import ReadMoreButton from '@components/buttons/ReadMoreButton.astro';
import Logo from '@components/images/Logo.astro';
import { getDirectusImageURL } from '@/support/url';
interface Props {
title: string;
subTitle: string;
url: string;
logoLight: string;
logoDark?: string;
}
const { title, subTitle, url, logoLight, logoDark} = Astro.props;
---
<div class="smooth-reveal w-full mx-auto">
<a
class="card-base group flex flex-row items-center justify-between w-full p-8 gap-6 md:gap-8"
href={url}
data-astro-prefetch
>
<div class="flex flex-row items-center ml-4">
<div class="card-hover-icon-scale shrink-0 mr-3">
<Logo
srcLight={getDirectusImageURL(logoLight)}
srcDark={getDirectusImageURL(logoDark!)}
alt={`Logo of ${title}`}
/>
</div>
<div class="flex flex-col gap-3 text-left ml-4">
<h2 class="card-text-header text-2xl md:text-3xl">
{title}
</h2>
<p class="card-text-title font-light text-pretty text-lg max-w-3xl">
{subTitle}
</p>
</div>
</div>
<div class="hidden md:block shrink-0 mr-4">
<ReadMoreButton/>
</div>
</a>
</div>

View File

@@ -10,7 +10,7 @@ const { dayName, label, icon, temp } = Astro.props;
---
<div class="smooth-reveal-2 group flex flex-col">
<div class="card-base w-32 md:w-40">
<div class="card-base w-40">
<div class="p-5 text-center">
<span class="card-text-description block font-bold text-xs uppercase tracking-widest">
{dayName}

View File

@@ -1,31 +0,0 @@
---
import { readItems, readSingleton } from '@directus/sdk';
import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro';
import directus from '@lib/directus';
import { timeago } from '@support/time';
const global = await directus.request(readSingleton('site_global'));
const posts = await directus.request(
readItems('posts', {
filter: { published: { _eq: true } },
fields: ['*'],
sort: ['-published_date'],
})
);
---
<section class:list={['mx-auto px-4 py-10 sm:px-6 lg:px-8 lg:py-14 lg:pt-10 2xl:max-w-full', Astro.props.className]}>
<div class="grid grid-cols-1">
<LargeCategoryCard
title="All Categories"
description="Here you can forgoe the organization and just look at everything I have posted"
url="/all"
logoLight={global.all_logoLight}
logoDark={global.all_logoDark}
count={posts.length}
publishDate={timeago(posts[0]?.published_date)}
/>
</div>
</section>

View File

@@ -1,20 +0,0 @@
---
import { readSingleton } from '@directus/sdk';
import LargeInvisibleCard from '@components/cards/LargeInvisibleCard.astro';
import directus from '@lib/directus';
const global = await directus.request(readSingleton('site_global'));
---
<section class:list={['mx-auto px-4 py-10 sm:px-6 lg:px-8 lg:py-14 lg:pt-10 2xl:max-w-full', Astro.props.className]}>
<div class="grid grid-cols-1">
<LargeInvisibleCard
title="All Posts"
subTitle="Browse all articles from every category"
url="/all"
img={global.all_image}
imgAlt={global.all_image_alt}
/>
</div>
</section>

View File

@@ -1,16 +1,19 @@
---
import { readItems } from '@directus/sdk';
import { readItems, readSingleton } from '@directus/sdk';
import type { Post } from '@lib/directusTypes';
import CategoryCard from '@components/cards/CategoryCard.astro';
import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro';
import directus from '@lib/directus';
import { timeago } from '@support/time';
const global = await directus.request(readSingleton('site_global'));
const posts = await directus.request(
readItems('posts', {
filter: { published: { _eq: true } },
fields: ['*', 'category.slug'],
fields: ['*', { category: ['*'] }],
sort: ['-published_date'],
})
);
@@ -95,5 +98,16 @@ const categories = (await directus.request(readItems('categories')))
</div>
);
})}
<div class="col-span-full mt-8">
<LargeCategoryCard
title="All Posts"
description="Here you can forgoe the organization and browse everything I've posted"
url="/all"
logoLight={global.all_logoLight}
logoDark={global.all_logoDark}
count={posts.length}
publishDate={timeago(posts[0]?.published_date)}
/>
</div>
</div>
</section>

View File

@@ -7,10 +7,10 @@ import directus from '@lib/directus';
const global = await directus.request(readSingleton('site_global'));
---
<section class="max-w-340 2xl:max-w-full px-4 sm:px-6 lg:px-8 py-10 lg:py-14 mx-auto mb-2 md:mb-8">
<div class="flex flex-col sm:flex-row items-center justify-center gap-y-2 sm:gap-x-12 sm:gap-y-0 lg:gap-x-24">
<div class="max-w-5xl sm:px-6 lg:px-8">
<div class="flex flex-wrap gap-6 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 justify-center">
<section class="max-w-340 2xl:max-w-full px-4 py-10 mx-auto mb-2 md:mb-8">
<div class="flex items-center justify-center">
<div class="max-w-5xl">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 lg:gap-6">
<FeaturesCard
title="Cloud Engineer"
description="Full stack and cloud engineer."

View File

@@ -1,8 +1,13 @@
---
import { Image } from 'astro:assets';
import { readItems } from '@directus/sdk';
import type { HeaderImage } from '@lib/directusTypes';
import GoLinkPrimaryButton from '@components/buttons/GoLinkPrimaryButton.astro';
import GoLinkSecondaryButton from '@components/buttons/GoLinkSecondaryButton.astro';
import directus from '@lib/directus';
import { getDirectusImageURL } from '@/support/url';
interface Props {
title: string;
@@ -11,18 +16,24 @@ interface Props {
primaryBtnURL?: string;
secondaryBtn?: string;
secondaryBtnURL?: string;
src?: any;
alt?: string;
rounded?: boolean;
}
const { title, subTitle, primaryBtn, primaryBtnURL, secondaryBtn, secondaryBtnURL, src, alt } = Astro.props;
const { title, subTitle, primaryBtn, primaryBtnURL, secondaryBtn, secondaryBtnURL } = Astro.props;
const roundedClasses = Astro.props.rounded ? "rounded-2xl" : null;
const imagesData = ((await directus.request(
readItems('header_images', {
fields: ['*'],
})
)) as unknown) as HeaderImage[];
const images = await Promise.all(imagesData.map(async (img) => ({
...img,
src: await getDirectusImageURL(img.image)
})));
---
<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">
<div>
<section class="grid md:grid-cols-2 md:items-center gap-4 md:gap-8 max-w-340 2xl:max-w-full px-4 py-14 sm:px-6 lg:px-8">
<div class="md:ml-12">
<h1 class="smooth-reveal card-text-header block lg:text-7xl">
<Fragment set:html={title} />
</h1>
@@ -36,22 +47,54 @@ const roundedClasses = Astro.props.rounded ? "rounded-2xl" : null;
{secondaryBtn && <GoLinkSecondaryButton title={secondaryBtn} url={secondaryBtnURL} />}
</div>
</div>
<div class="smooth-reveal-fade md:block w-full hidden">
<div class="flex justify-center w-full top-12 md:ml-4 overflow-hidden">
{src && alt && (
<Image
src={src}
alt={alt}
class={`h-full w-105 scale-100 object-cover object-center ${roundedClasses}`}
draggable="false"
loading="eager"
format="webp"
quality="low"
widths={[840]}
inferSize={true}
/>
)}
<div class="smooth-reveal-fade md:block w-full hidden md:mr-12">
<div
class="flex justify-center w-full top-12 md:ml-4 overflow-hidden no-js-fallback"
id="hero-image-container"
>
{images.map((img, index) => (
<div
class="hero-image hidden justify-center w-full h-full"
data-index={index}
>
<Image
class="h-full w-105 scale-100 object-cover object-center"
src={img.src}
alt={img.image_alt}
draggable="false"
loading="eager"
format="webp"
widths={[840]}
inferSize={true}
/>
</div>
))}
</div>
<style>
.no-js-fallback .hero-image:first-child {
display: flex !important;
}
</style>
<script is:inline>
document.getElementById('hero-image-container')?.classList.remove('no-js-fallback');
</script>
</div>
</section>
<script>
document.addEventListener('astro:page-load', () => {
const container = document.getElementById('hero-image-container');
if (container) {
const images = container.querySelectorAll('.hero-image');
images.forEach(img => {
img.classList.remove('flex');
img.classList.add('hidden');
});
if (images.length > 0) {
const randomIndex = Math.floor(Math.random() * images.length);
images[randomIndex].classList.remove('hidden');
images[randomIndex].classList.add('flex');
}
}
});
</script>

View File

@@ -1,7 +1,11 @@
---
import { readSingleton } from '@directus/sdk';
import type { Post } from '@lib/directusTypes';
import BlogCard from '@components/cards/BlogCard.astro';
import LargeLinkCard from '@components/cards/LargeLinkCard.astro';
import directus from '@lib/directus';
interface Props {
posts: Post[];
@@ -9,6 +13,8 @@ interface Props {
subTitle?: string;
}
const global = await directus.request(readSingleton('site_global'));
const { posts, title, subTitle } = Astro.props;
---
@@ -23,11 +29,18 @@ const { posts, title, subTitle } = Astro.props;
</span>
</div>
</div>
<div class="columns-1 sm:columns-2 lg:columns-3 gap-6">
{posts.map((b) => (
<div class="break-inside-avoid mb-6">
<BlogCard post={b} />
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
{posts.map((b) =>
<BlogCard post={b} />
)}
<div class="col-span-full">
<LargeLinkCard
title="All Posts"
subTitle="Catch up on everything I've written"
url="/all"
logoLight={global.all_logoLight}
logoDark={global.all_logoDark}
/>
</div>
))}
</div>
</div>
</section>

View File

@@ -13,24 +13,8 @@ const { posts } = Astro.props;
<section class="smooth-reveal flex flex-col gap-4 md:mb-20">
{posts.map((post, index) => index % 2 === 0 ? (
<LargeBlogLeftCard
title={post.title}
subTitle={post.description}
url={`/blog/${post.slug}`}
pubDate={post.published_date}
img={post.image}
imgAlt={post.image_alt}
/>
<LargeBlogLeftCard post={post}/>
) : (
<LargeBlogRightCard
title={post.title}
subTitle={post.description}
url={`/blog/${post.slug}`}
pubDate={post.published_date}
imgOne={post.image}
imgOneAlt={post.image_alt}
imgTwo={post?.image_second}
imgTwoAlt={post?.image_second_alt}
/>
<LargeBlogRightCard post={post}/>
))}
</section>

View File

@@ -20,17 +20,19 @@ const { forecastDays, error } = await getFiveDayForecast(latitude, longitude, ti
</div>
{error ? (
<div class="card-base p-10 text-accent text-center">
{error}
Sorry, {error.toLowerCase}
</div>
) : (
<div class="flex flex-wrap justify-center gap-4 lg:gap-6">
{forecastDays.map((forecastDay) => (
<WeatherCard
dayName={forecastDay.dayName}
label={forecastDay.label}
icon={forecastDay.icon}
temp={forecastDay.temp}
/>
{forecastDays.map((forecastDay, index) => (
<div class={index === 3 ? "hidden min-[800px]:block" : index >= 4 ? "hidden min-[1100px]:block" : ""}>
<WeatherCard
dayName={forecastDay.dayName}
label={forecastDay.label}
icon={forecastDay.icon}
temp={forecastDay.temp}
/>
</div>
))}
</div>
)}

View File

@@ -0,0 +1,81 @@
---
import getReadingTime from 'reading-time';
import type { Post } from '@lib/directusTypes';
import Logo from '@components/images/Logo.astro';
import { formatShortDate, formatDate } from '@support/time';
import { getDirectusImageURL } from '@/support/url';
interface Props {
post: Post;
enableCategoryLink?: boolean;
dateFormat?: 'short' | 'long';
}
const { post, enableCategoryLink = true, dateFormat = 'short' } = Astro.props;
const readingTime = getReadingTime(post.content || '');
---
<ol class="flex items-center justify-start card-text-description text-sm whitespace-nowrap gap-2 sm:gap-0 overflow-hidden">
{post.category && (
<li class="inline-flex items-center">
{enableCategoryLink ? (
<a
class="inline-flex items-center hover:card-hover-text-description overflow-hidden"
href={`/categories/${post.category.slug}`}
data-astro-prefetch
>
<div class="flex flex-row items-center shrink-0">
<div class="mr-2">
<Logo
srcLight={getDirectusImageURL(post.category.logoLight)}
srcDark={getDirectusImageURL(post.category.logoDark)}
alt={`Logo of ${post.category.title}`}
width={18}
height={18}
/>
</div>
{post.category.title}
</div>
</a>
) : (
<div class="inline-flex items-center overflow-hidden">
<div class="flex flex-row items-center shrink-0">
<div class="mr-2">
<Logo
srcLight={getDirectusImageURL(post.category.logoLight)}
srcDark={getDirectusImageURL(post.category.logoDark)}
alt={`Logo of ${post.category.title}`}
width={18}
height={18}
/>
</div>
{post.category.title}
</div>
</div>
)}
</li>
)}
<li class="inline-flex items-center">
<span class="shrink-0 mx-2">
/
</span>
</li>
<li class="inline-flex items-center">
<span class="shrink-0 overflow-hidden">
{dateFormat === 'short' ? formatShortDate(post.published_date) : formatDate(post.published_date)}
</span>
</li>
<li class="inline-flex items-center">
<span class="shrink-0 mx-2">
/
</span>
</li>
<li class="inline-flex items-center">
<span class="shrink-0 overflow-hidden">
{readingTime.minutes.toPrecision(1)} minutes
</span>
</li>
</ol>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -5,6 +5,7 @@ import type {
Weather,
Post,
Category,
HeaderImage,
Application,
Experience,
Education,
@@ -20,6 +21,7 @@ type Schema = {
site_weather: Weather;
posts: Post[];
categories: Category[];
header_images: HeaderImage[];
site_applications: Application;
site_experience: Experience;
site_education: Education;

View File

@@ -10,20 +10,10 @@ export type Global = {
site_url: string;
rybbit_site_id: string;
logo: string;
portrait: string;
portrait_alt: string;
home_image: string;
home_image_alt: string;
all_image: string;
all_image_alt: string;
all_logoLight: string;
all_logoDark: string;
blog_image: string;
blog_image_alt: string;
categories_image: string;
categories_image_alt: string;
applications_image: string;
applications_image_alt: string;
portrait: string;
portrait_alt: string;
footer_image: string;
footer_image_alt: string;
};
@@ -61,6 +51,12 @@ export type Category = {
logoDark: string;
};
export type HeaderImage = {
id: string;
image: string;
image_alt: string;
};
export type Application = {
id: string;
name: string;

View File

@@ -9,8 +9,6 @@ import SkillsSliderSection from '@components/sections/SkillsSliderSection.astro'
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import portraitImg from '@images/portrait.avif';
const global = await directus.request(readSingleton('site_global'));
---
@@ -37,9 +35,6 @@ const global = await directus.request(readSingleton('site_global'));
<HeroSection
title="About Me"
subTitle={global.about}
src={portraitImg}
alt={global.portrait_alt}
rounded={true}
/>
<section class="max-w-7xl px-4 sm:px-6 lg:px-8 py-10 lg:py-14 mx-auto">

View File

@@ -10,7 +10,7 @@ const global = await directus.request(readSingleton('site_global'));
const posts = await directus.request(
readItems('posts', {
filter: { published: { _eq: true } },
fields: ['*'],
fields: ['*', { category: ['*'] }],
sort: ['-published_date'],
})
);
@@ -37,18 +37,16 @@ const posts = await directus.request(
<HeaderSection
title="All Posts"
subTitle="Browse all articles from every category."
subTitle="Browse all posts from every category."
btnExists
btnTitle="To Categories"
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="columns-1 sm:columns-2 lg:columns-3 gap-6">
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
{posts.map((b) =>
<div class="break-inside-avoid mb-6">
<BlogCard post={b} />
</div>
<BlogCard post={b} />
)}
</div>
</section>

View File

@@ -6,8 +6,6 @@ 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';
const global = await directus.request(readSingleton('site_global'));
---
@@ -34,8 +32,6 @@ const global = await directus.request(readSingleton('site_global'));
<HeroSection
title="Applications"
subTitle={global.about_applications}
src={applicationImg}
alt={global.applications_image_alt}
/>
<ApplicationSection className="smooth-reveal-2" />

View File

@@ -1,7 +1,6 @@
---
import { Image } from 'astro:assets';
import getReadingTime from 'reading-time';
import { marked } from 'marked';
import markedShiki from 'marked-shiki';
import { createHighlighter } from 'shiki';
@@ -9,17 +8,16 @@ import { readItems, readSingleton } from '@directus/sdk';
import 'photoswipe/style.css';
import SocialShareButton from '@components/buttons/SocialShareButton.astro';
import Logo from '@components/images/Logo.astro';
import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import { formatDate } from '@support/time';
import { getDirectusImageURL } from '@/support/url';
const post = Astro.props;
export async function getStaticPaths() {
const posts = await directus.request(readItems('posts', {
fields: ['*', 'category.*'],
fields: ['*', { category: ['*'] }],
}));
return posts.map((post) => ({
params: { slug: post.slug },
@@ -28,9 +26,6 @@ export async function getStaticPaths() {
}
const global = await directus.request(readSingleton('site_global'));
const category = post.category;
const readingTime = getReadingTime(post.content || '');
const highlighter = await createHighlighter({
themes: ['github-light', 'github-dark'],
@@ -101,46 +96,12 @@ const content = marked.parse(post.content || '');
<h2 class="card-text-header block">
{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">
{category && (
<li class="inline-flex items-center">
<a
class="inline-flex items-center text-secondary hover:text-secondary-hover text-sm transition-all duration-300"
href=`/categories/${category.slug}`
data-astro-prefetch
>
<div class="flex flex-row items-center shrink-0">
<div class="mr-2">
<Logo
srcLight={getDirectusImageURL(category.logoLight)}
srcDark={getDirectusImageURL(category.logoDark)}
alt={`Logo of ${category.title}`}
width = 18,
height = 18,
/>
</div>
{category.title}
</div>
</a>
<span class="shrink-0 text-secondary text-sm mx-2 sm:mx-4">
/
</span>
</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>
<li class="inline-flex items-center">
<span class="shrink-0 text-secondary text-sm">
{readingTime.minutes.toPrecision(1)} minutes to read
</span>
</li>
</ol>
<div class="mt-4 sm:mt-6">
<PostMetadataSnippet
post={post}
dateFormat='long'
/>
</div>
</div>
<div class="border-t border-divider mt-10 mb-10"/>

View File

@@ -6,17 +6,14 @@ import type { Post } from '@lib/directusTypes';
import HeroSection from '@components/sections/HeroSection.astro';
import SelectedPostsSection from '@components/sections/SelectedPostsSection.astro';
import RecentPostsSection from '@components/sections/RecentPostsSection.astro';
import AllPostsSection from '@components/sections/AllPostsSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import blogImg from '@images/autumn_tree.png';
const global = await directus.request(readSingleton('site_global'));
const posts = await directus.request(
readItems('posts', {
filter: { published: { _eq: true } },
fields: ['*'],
fields: ['*', { category: ['*'] }],
sort: ['-published_date'],
})
);
@@ -50,8 +47,6 @@ const recentPosts: Post[] = posts.filter(
<HeroSection
title="Blog"
subTitle={global.about_blog}
src={blogImg}
alt={global.blog_image_alt}
/>
<SelectedPostsSection posts={selectedPosts} />
@@ -61,8 +56,6 @@ const recentPosts: Post[] = posts.filter(
title="Recent Posts"
/>
<AllPostsSection />
</BaseLayout>
<script>

View File

@@ -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: ['*', { category: ['*'] }],
sort: ['-published_date'],
})
);

View File

@@ -3,12 +3,9 @@ import { readSingleton } from '@directus/sdk';
import HeroSection from '@components/sections/HeroSection.astro';
import CategorySection from '@components/sections/CategorySection.astro';
import AllCategoriesSection from '@components/sections/AllCategoriesSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus';
import categoryImg from '@images/autumn_bench.png';
const global = await directus.request(readSingleton('site_global'));
---
@@ -35,14 +32,10 @@ const global = await directus.request(readSingleton('site_global'));
<HeroSection
title="Categories"
subTitle={global.about_categories}
src={categoryImg}
alt={global.categories_image_alt}
/>
<CategorySection />
<AllCategoriesSection />
</BaseLayout>
<script>

View File

@@ -7,19 +7,16 @@ 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 AllPostsSection from '@components/sections/AllPostsSection.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';
const global = await directus.request(readSingleton('site_global'));
const weather = await directus.request(readSingleton('site_weather'));
const posts = await directus.request(
readItems('posts', {
filter: { published: { _eq: true } },
fields: ['*'],
fields: ['*', { category: ['*'] }],
sort: ['-published_date'],
})
);
@@ -54,8 +51,6 @@ const recentPosts = posts
subTitle={global.about_description}
primaryBtn="About Me"
primaryBtnURL="/about"
src={homeImg}
alt={global.home_image_alt}
/>
<FeatureSection />
@@ -74,8 +69,6 @@ const recentPosts = posts
subTitle="Checkout my most recent thoughts here"
/>
<AllPostsSection />
<GiteaSection
title="Follow me on Gitea"
subTitle="I love open source and have my code availabile on my Gitea server."

View File

@@ -4,6 +4,8 @@ import rss, { type RSSFeedItem } from '@astrojs/rss';
import type { APIContext } from 'astro';
import { transform, walk } from 'ultrahtml';
import sanitize from 'ultrahtml/transformers/sanitize';
import MarkdownIt from 'markdown-it';
import { readItems, readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
@@ -12,6 +14,8 @@ const global = await directus.request(readSingleton('site_global'));
export async function GET(context: APIContext) {
let baseUrl = context.site?.href || global.site_url;
const parser = new MarkdownIt();
if (baseUrl.at(-1) === '/') {
baseUrl = baseUrl.slice(0, -1);
}
@@ -26,7 +30,7 @@ export async function GET(context: APIContext) {
const feedItems: RSSFeedItem[] = [];
for (const post of posts) {
const content = await transform(post.content.replace(/^<!DOCTYPE html>/, ''), [
const content = await transform(parser.render(post.content), [
async (node) => {
await walk(node, (node) => {
if (node.name === 'a' && node.attributes.href?.startsWith('/')) {

View File

@@ -76,7 +76,7 @@
@utility card-hover-icon-scale {
@apply transition-transform duration-300 will-change-transform
drop-shadow-md dark:drop-shadow-xl dark:drop-shadow-neutral-500/60
group-hover:scale-3d group-hover:scale-110
group-hover:scale-3d group-hover:scale-105
}
@utility card-text-header {
@@ -127,6 +127,11 @@
@apply text-secondary
}
@utility card-hover-text-description {
@apply transition-all duration-300
text-secondary-hover
}
/* Misc */
@utility nav-base {
@apply border border-neutral-100 dark:border-stone-500/20

View File

@@ -39,4 +39,11 @@ function formatDate(date: Date): string {
})
}
export { formatDate, timeago };
function formatShortDate(date: Date): string {
return new Date(date).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
})
}
export { formatDate, formatShortDate, timeago };

View File

@@ -6,7 +6,7 @@ const getSiteURL = () => {
return 'https://www.alexlebens.dev';
};
async function getDirectusImageURL(image: string) {
function getDirectusImageURL(image: string) {
return `${getDirectusURL()}/assets/${image}`;
}