Compare commits
200 Commits
c79631cf7d
...
2.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b116a05df | |||
|
849ca78598
|
|||
| 8377aefaf7 | |||
| 3f5682f80c | |||
| ae84560ddd | |||
|
1f7253d954
|
|||
| b6dfc738f1 | |||
| 63cbcdf39b | |||
| 10c4f9c768 | |||
| 880bafd41e | |||
| 3ebc36174b | |||
| 0abd1a2465 | |||
|
f2b27a01bf
|
|||
|
503cb401fc
|
|||
| a45a4d7dd7 | |||
| 6d3f3a49ab | |||
| 197ad63ada | |||
| 4c4421c8a8 | |||
| d0ff16c8dc | |||
| 9678b3c718 | |||
| 7fafa5c4cf | |||
| a909743feb | |||
|
f116173cb8
|
|||
| ce62de8883 | |||
|
94f2779463
|
|||
| ed3cf80921 | |||
|
63aa6bfdbc
|
|||
| 4343124c3f | |||
|
a48063a694
|
|||
| e476efb96b | |||
| a99201138e | |||
|
9ef86e71dc
|
|||
| 5cd59cd1ff | |||
|
d5cf6fe130
|
|||
| 91136e2e54 | |||
|
7b915cf021
|
|||
| 807b8dd9b9 | |||
|
76c6933682
|
|||
| bd34eb6f75 | |||
|
c8d9def6dc
|
|||
| 5fb2ff16c6 | |||
|
9a86ea4053
|
|||
| 49969e27b0 | |||
| bf73905658 | |||
| 56d841a335 | |||
| 95432d9059 | |||
| c2bf64c6cc | |||
| 1f3fed93a1 | |||
| 754f6a22f0 | |||
| 4203b63893 | |||
| 4d7886b93c | |||
| c7d3ca7252 | |||
| a0f83c874c | |||
| 22860c4714 | |||
| 9b8a7077a7 | |||
| 8bfc744bdb | |||
| d386afa15e | |||
| 3fe324d4c2 | |||
|
a02d417c83
|
|||
|
0d53376c80
|
|||
| a5abfe0d1c | |||
|
3fcf9a0703
|
|||
| 00b63a5bea | |||
| d9860106b1 | |||
| 83940a28ab | |||
|
4baa2bed51
|
|||
| 19a9588919 | |||
|
3c8d3992cf
|
|||
| fb8f642c52 | |||
| fde397386c | |||
| b7f76c5847 | |||
| b3bb769c47 | |||
| f34f4b2532 | |||
| 94f5082729 | |||
| 5e9765f4d7 | |||
|
ac4bc16913
|
|||
| daaca66f42 | |||
| 6fb7846d23 | |||
|
167491fe8d
|
|||
| 1cda8fac20 | |||
| dbf7ae54a4 | |||
|
a857b64029
|
|||
|
6b867ec092
|
|||
| 3e24f3bb4f | |||
|
0c02c71693
|
|||
| 025a5b38aa | |||
|
cdaa3af76c
|
|||
| e87c89afac | |||
|
a00e188f86
|
|||
| bc5f023883 | |||
| 5e272108d4 | |||
| babf0d40cd | |||
| 3925f35c47 | |||
| 3f2c6da690 | |||
| 01ee8fac98 | |||
| c8306e414b | |||
| 42d3891c6b | |||
|
21c08d6853
|
|||
| 6aa62ad76d | |||
|
a95908736b
|
|||
| 6ddec3a558 | |||
|
24a20c4a7e
|
|||
| ecfc907744 | |||
|
44d4837b8e
|
|||
| 6b46e943e3 | |||
|
606424972a
|
|||
| d2a8c007e5 | |||
|
3ac2a5ea1f
|
|||
| 7ef13d8437 | |||
|
4ed5ab769c
|
|||
| ec31419b81 | |||
|
083a5e77da
|
|||
| 4c065f99ab | |||
|
f6cccca140
|
|||
| eedddca9a1 | |||
|
556647977f
|
|||
| d1f189818f | |||
|
5c461d64e2
|
|||
| 6371705b9c | |||
|
92aa4a614c
|
|||
| 6e20d4b8c8 | |||
|
f187c341f6
|
|||
| 16cf8ae2d1 | |||
|
d07b8ab73e
|
|||
| 52ba1108c0 | |||
|
54601905da
|
|||
| 88713b9738 | |||
| 83817cc1b6 | |||
|
0ef1a97f51
|
|||
|
a84e7a1675
|
|||
| fcffbffc02 | |||
|
a2af3015a2
|
|||
| e64e72df0e | |||
|
17dbf719a5
|
|||
| ecb3a2be8b | |||
|
2e0fbff172
|
|||
| cd4bbdea50 | |||
|
98608fba4d
|
|||
| 859d892ba9 | |||
| 797a12f1b6 | |||
|
2ef4429901
|
|||
|
f071535034
|
|||
| 119c570771 | |||
|
c474ed52c1
|
|||
| 4b24da83cb | |||
|
892a333e0e
|
|||
| ab4630fdd1 | |||
|
c318eb9fbb
|
|||
| 310d9779fe | |||
|
63134978b9
|
|||
| 099c4fb251 | |||
|
fa4f31b933
|
|||
| 835ba15cc7 | |||
| eb74233bfb | |||
|
1bb1b0571e
|
|||
|
f569a12edb
|
|||
| 3caee230f2 | |||
|
282d909cfd
|
|||
| 7548131847 | |||
|
ddf42a2d09
|
|||
| f88195b97d | |||
|
daf5acc335
|
|||
| b2246f6858 | |||
|
e424616e12
|
|||
| da20872a1e | |||
|
b43dff833f
|
|||
| 9248b76d8e | |||
|
019413a325
|
|||
| d94e490846 | |||
|
0d6e21618b
|
|||
| 0b03499f81 | |||
|
f9a62cad1c
|
|||
| 2014d0b87a | |||
| 24f237b795 | |||
|
1c985bca47
|
|||
|
291d436c1f
|
|||
| 08c8cb15ca | |||
|
d2b01a7bd3
|
|||
| aa75da2ecb | |||
|
0093b92b23
|
|||
| 6e0253f849 | |||
| 06ada51c0f | |||
|
1cf72e72b5
|
|||
|
181d4b56ac
|
|||
| c5870eba4a | |||
| 8242f153d8 | |||
| 117d2567e5 | |||
| a400c3187c | |||
|
15fb351504
|
|||
| fb492a1028 | |||
|
c427c5ddb7
|
|||
| 9a686eb9f5 | |||
|
2e0e52bdf9
|
|||
| f7a2bb1205 | |||
|
90b00872ee
|
|||
| 7dd5778c89 | |||
|
a062974f45
|
|||
| a7a14dfce5 | |||
|
51cdbd8b0b
|
|||
| f0e52d2f20 |
@@ -1,4 +1,4 @@
|
||||
name: release-image
|
||||
name: release-image-gitea
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -8,8 +8,35 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-js
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10.x
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24.13.1
|
||||
cache: pnpm
|
||||
|
||||
- name: Install Dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Lint Code
|
||||
run: pnpm lint
|
||||
|
||||
- name: Build Project
|
||||
run: pnpm build
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-js
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -21,13 +48,6 @@ jobs:
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.REPOSITORY_TOKEN }}
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY_HOST }}
|
||||
username: ${{ vars.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_SECRET }}
|
||||
|
||||
- name: Create Kubeconfig
|
||||
run: |
|
||||
mkdir $HOME/.kube
|
||||
@@ -55,9 +75,23 @@ jobs:
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=sha,format=long
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
images: |
|
||||
${{ vars.REPOSITORY_HOST }}/${{ gitea.repository }}
|
||||
${{ vars.REGISTRY_HOST }}/images/site-profile
|
||||
|
||||
- name: Get Version Info
|
||||
id: version
|
||||
run: |
|
||||
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
|
||||
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
if git describe --tags --exact-match HEAD 2>/dev/null; then
|
||||
echo "is_release=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "is_release=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v6
|
||||
@@ -67,6 +101,10 @@ jobs:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
COMMIT_SHA=${{ steps.version.outputs.commit }}
|
||||
IS_RELEASE=${{ steps.version.outputs.is_release }}
|
||||
file: ./Dockerfile
|
||||
|
||||
- name: ntfy Success
|
||||
136
.gitea/workflows/release-image-harbor.yml
Normal file
136
.gitea/workflows/release-image-harbor.yml
Normal file
@@ -0,0 +1,136 @@
|
||||
name: release-image-harbor
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 2.*
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-js
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10.x
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24.13.1
|
||||
cache: pnpm
|
||||
|
||||
- name: Install Dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Lint Code
|
||||
run: pnpm lint
|
||||
|
||||
- name: Build Project
|
||||
run: pnpm build
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-js
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY_HOST }}
|
||||
username: ${{ vars.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_SECRET }}
|
||||
|
||||
- name: Create Kubeconfig
|
||||
run: |
|
||||
mkdir $HOME/.kube
|
||||
echo "${{ secrets.KUBECONFIG_BUILDX }}" > $HOME/.kube/config
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: kubernetes
|
||||
driver-opts: |
|
||||
namespace=gitea
|
||||
qemu.install=true
|
||||
buildkitd-config-inline: |
|
||||
[registry."docker.io"]
|
||||
mirrors = ["harbor.alexlebens.net/proxy-hub.docker/"]
|
||||
|
||||
- name: Available Platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
|
||||
- name: Extract Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=sha,format=long
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
images: |
|
||||
${{ vars.REGISTRY_HOST }}/images/site-profile
|
||||
|
||||
- name: Get Version Info
|
||||
id: version
|
||||
run: |
|
||||
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
|
||||
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
if git describe --tags --exact-match HEAD 2>/dev/null; then
|
||||
echo "is_release=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "is_release=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
COMMIT_SHA=${{ steps.version.outputs.commit }}
|
||||
IS_RELEASE=${{ steps.version.outputs.is_release }}
|
||||
file: ./Dockerfile
|
||||
|
||||
- name: ntfy Success
|
||||
uses: niniyas/ntfy-action@master
|
||||
if: success()
|
||||
with:
|
||||
url: '${{ secrets.NTFY_URL }}'
|
||||
topic: '${{ secrets.NTFY_TOPIC }}'
|
||||
title: 'Release Success - Site Profile'
|
||||
priority: 3
|
||||
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
||||
tags: action,successfully,completed
|
||||
details: 'Image for Site Profile has been released!'
|
||||
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
||||
|
||||
- name: ntfy Failed
|
||||
uses: niniyas/ntfy-action@master
|
||||
if: failure()
|
||||
with:
|
||||
url: '${{ secrets.NTFY_URL }}'
|
||||
topic: '${{ secrets.NTFY_TOPIC }}'
|
||||
title: 'Release Failure - Site Profile'
|
||||
priority: 4
|
||||
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
||||
tags: action,failed
|
||||
details: 'Image for Site Profile has failed to be released.'
|
||||
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
||||
actions: '[{"action": "view", "label": "Open Gitea", "url": "https://gitea.alexlebens.dev/alexlebens/site-profile/actions?workflow=release-image.yml", "clear": true}]'
|
||||
image: true
|
||||
@@ -13,7 +13,7 @@ on:
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/renovatebot/renovate:42
|
||||
container: ghcr.io/renovatebot/renovate:43
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24.11.1
|
||||
node-version: 24.13.1
|
||||
cache: pnpm
|
||||
|
||||
- name: Install Dependencies
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,8 +1,5 @@
|
||||
ARG REGISTRY=docker.io
|
||||
FROM ${REGISTRY}/node:24.11.1-alpine3.22 AS base
|
||||
|
||||
LABEL version="2.1.2"
|
||||
LABEL description="Astro based personal website"
|
||||
FROM ${REGISTRY}/node:24.13.0-alpine AS base
|
||||
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
@@ -29,8 +26,11 @@ COPY --from=build /app/dist /app/dist
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
ENV SITE_URL=https://www.alexlebens.dev
|
||||
ENV DIRECTUS_URL=https://directus.alexlebens.dev
|
||||
ENV DIRECTUS_URL=https://directus.alexlebens.net
|
||||
ENV PORT=4321
|
||||
|
||||
LABEL version="2.6.0"
|
||||
LABEL description="Astro based personal website"
|
||||
|
||||
EXPOSE $PORT
|
||||
CMD ["node", "./dist/server/entry.mjs"]
|
||||
|
||||
20
README.md
20
README.md
@@ -2,29 +2,19 @@
|
||||
|
||||
Personal site used for information about myself and blog.
|
||||
|
||||
## Features
|
||||
|
||||
- 🐈 Simple And Beautiful
|
||||
- 🖥️️ Responsive And Light/Dark mode
|
||||
- 🐛 SiteMap & RSS Feed
|
||||
- 🐝 Category Support
|
||||
- 🐜 SEO and Responsiveness
|
||||
- 🪲 Markdown And MDX
|
||||
- 🏂🏾 Page Compression & Image Optimization
|
||||
|
||||
### Development Commands
|
||||
## Development
|
||||
|
||||
With dependencies installed, you can utilize the following npm scripts to manage your project's development lifecycle:
|
||||
|
||||
- `pnpm run dev`: Starts a local development server with hot reloading enabled.
|
||||
- `pnpm run preview`: Serves your build output locally for preview before deployment.
|
||||
- `pnpm run build`: Bundles your site into static files for production.
|
||||
- `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.
|
||||
|
||||
For detailed help with Astro CLI commands, visit [Astro's documentation](https://docs.astro.build/en/reference/cli-reference/).
|
||||
|
||||
## Thanks
|
||||
|
||||
Thanks https://github.com/mearashadowfax/ScrewFast, https://github.com/godruoyi/gblog/tree/gblog-template
|
||||
Thanks https://github.com/godruoyi/gblog/tree/gblog-template, https://github.com/mearashadowfax/ScrewFast,
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { defineConfig, passthroughImageService, sharpImageService } from 'astro/config';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
import mdx from '@astrojs/mdx';
|
||||
import node from '@astrojs/node';
|
||||
import partytown from '@astrojs/partytown';
|
||||
import react from '@astrojs/react';
|
||||
@@ -9,8 +8,6 @@ import sitemap from '@astrojs/sitemap';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import icon from 'astro-icon';
|
||||
import swup from '@swup/astro';
|
||||
import rehypePrettyCode from 'rehype-pretty-code';
|
||||
import { transformerCopyButton } from '@rehype-pretty/transformers';
|
||||
|
||||
const getSiteURL = () => {
|
||||
if (process.env.SITE_URL) {
|
||||
@@ -31,7 +28,6 @@ export default defineConfig({
|
||||
prefetch: true,
|
||||
|
||||
integrations: [
|
||||
mdx(),
|
||||
partytown(),
|
||||
react(),
|
||||
sitemap(),
|
||||
@@ -67,24 +63,6 @@ export default defineConfig({
|
||||
|
||||
markdown: {
|
||||
syntaxHighlight: false,
|
||||
rehypePlugins: [
|
||||
[
|
||||
rehypePrettyCode,
|
||||
{
|
||||
theme: {
|
||||
light: 'github-light',
|
||||
dark: 'github-dark-dimmed',
|
||||
},
|
||||
keepBackground: false,
|
||||
transformers: [
|
||||
transformerCopyButton({
|
||||
visibility: 'always',
|
||||
feedbackDuration: 2500,
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
|
||||
plugins: {
|
||||
|
||||
57
package.json
57
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "site-profile",
|
||||
"type": "module",
|
||||
"version": "2.1.2",
|
||||
"version": "2.6.0",
|
||||
"homepage": "https://www.alexlebens.dev",
|
||||
"bugs": {
|
||||
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
||||
@@ -28,57 +28,56 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.6",
|
||||
"@astrojs/mdx": "^4.3.13",
|
||||
"@astrojs/node": "^9.5.1",
|
||||
"@astrojs/node": "^9.5.2",
|
||||
"@astrojs/partytown": "^2.1.4",
|
||||
"@astrojs/react": "^4.4.2",
|
||||
"@astrojs/rss": "^4.0.14",
|
||||
"@astrojs/sitemap": "^3.6.0",
|
||||
"@directus/sdk": "^20.3.0",
|
||||
"@astrojs/rss": "^4.0.15",
|
||||
"@astrojs/sitemap": "^3.7.0",
|
||||
"@directus/sdk": "^21.1.0",
|
||||
"@giscus/react": "^3.1.0",
|
||||
"@iconify-json/mdi": "^1.2.3",
|
||||
"@iconify-json/pajamas": "^1.2.15",
|
||||
"@iconify-json/simple-icons": "^1.2.62",
|
||||
"@playform/compress": "^0.2.0",
|
||||
"@rehype-pretty/transformers": "^0.13.2",
|
||||
"@swup/astro": "1.7.0",
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"@types/react": "^19.2.7",
|
||||
"@iconify-json/simple-icons": "^1.2.70",
|
||||
"@playform/compress": "^0.2.1",
|
||||
"@swup/astro": "^1.7.0",
|
||||
"@tailwindcss/postcss": "^4.1.18",
|
||||
"@tailwindcss/vite": "^4.1.18",
|
||||
"@types/react": "^19.2.13",
|
||||
"@types/unist": "^3.0.3",
|
||||
"astro": "^5.16.5",
|
||||
"astro": "^5.17.1",
|
||||
"astro-compressor": "^1.2.0",
|
||||
"astro-icon": "^1.1.5",
|
||||
"marked": "^17.0.1",
|
||||
"marked-shiki": "^1.2.1",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"motion": "^12.23.26",
|
||||
"preline": "^3.2.3",
|
||||
"react": "^19.2.1",
|
||||
"react-dom": "^19.2.1",
|
||||
"motion": "^12.34.0",
|
||||
"preline": "^4.0.1",
|
||||
"react": "^19.2.4",
|
||||
"react-dom": "^19.2.4",
|
||||
"reading-time": "^1.5.0",
|
||||
"rehype-pretty-code": "^0.14.1",
|
||||
"sharp": "^0.34.5",
|
||||
"sharp-ico": "^0.1.5",
|
||||
"shiki": "^3.19.0",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"shiki": "^3.22.0",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"ultrahtml": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint-react/eslint-plugin": "^2.3.13",
|
||||
"@tailwindcss/forms": "^0.5.10",
|
||||
"@eslint-react/eslint-plugin": "^2.12.4",
|
||||
"@tailwindcss/forms": "^0.5.11",
|
||||
"@tailwindcss/typography": "^0.5.19",
|
||||
"astro-icon": "^1.1.5",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint": "^10.0.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-astro": "^1.5.0",
|
||||
"eslint-plugin-format": "^1.1.0",
|
||||
"eslint-plugin-format": "^1.4.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.24",
|
||||
"prettier": "^3.7.4",
|
||||
"eslint-plugin-react-refresh": "^0.5.0",
|
||||
"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.49.0"
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.55.0"
|
||||
}
|
||||
}
|
||||
|
||||
4347
pnpm-lock.yaml
generated
4347
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -16,14 +16,14 @@ const currentYear = new Date().getFullYear();
|
||||
transition:animate="none"
|
||||
>
|
||||
<div class="relative px-4 pt-16 pb-12 sm:px-6">
|
||||
<div class="mx-auto max-w-[85rem]">
|
||||
<div class="mx-auto max-w-340">
|
||||
<div class="grid grid-cols-1 gap-10 md:grid-cols-12">
|
||||
<!-- Brand section -->
|
||||
<div class="col-span-1 md:col-span-3">
|
||||
<a href="/" class="group inline-block">
|
||||
<div class="flex items-center">
|
||||
<div class="mx-auto aspect-square overflow-hidden rounded-lg">
|
||||
<BrandLogo class="max-h-[40px] max-w-[40px] rounded-full" />
|
||||
<BrandLogo class="max-h-10 max-w-10 rounded-full" />
|
||||
</div>
|
||||
|
||||
<span class="ml-3 text-xl font-bold text-neutral-800 dark:text-neutral-200">
|
||||
|
||||
@@ -33,7 +33,7 @@ const currentPath = pathname.slice(1);
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<svg
|
||||
class="hs-collapse-open:hidden h-[1.25rem] w-[1.25rem] flex-shrink-0"
|
||||
class="hs-collapse-open:hidden h-5 w-5 shrink-0"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -48,7 +48,7 @@ const currentPath = pathname.slice(1);
|
||||
<line x1="3" x2="21" y1="18" y2="18"></line>
|
||||
</svg>
|
||||
<svg
|
||||
class="hs-collapse-open:block hidden h-[1.25rem] w-[1.25rem] flex-shrink-0"
|
||||
class="hs-collapse-open:block hidden h-5 w-5 shrink-0"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
|
||||
@@ -12,10 +12,10 @@ const { posts } = Astro.props;
|
||||
<section class="mx-auto mb-10 max-w-[85rem] px-4 py-8 sm:px-6 lg:px-8 2xl:max-w-full">
|
||||
<div class="text-left">
|
||||
<h2
|
||||
id="selected-articel"
|
||||
class="smooth-reveal-2 mb-4 text-5xl font-extrabold tracking-tight text-balance text-neutral-800 dark:text-neutral-200"
|
||||
id="recent-articles"
|
||||
class="smooth-reveal-2 mb-10 text-5xl font-extrabold tracking-tight text-balance text-neutral-800 dark:text-neutral-200"
|
||||
>
|
||||
Older Articles
|
||||
Recent Posts
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -10,12 +10,11 @@ interface Props {
|
||||
}
|
||||
|
||||
const { posts } = Astro.props;
|
||||
const blogPosts = posts.slice(0, 5);
|
||||
---
|
||||
|
||||
<section class="smooth-reveal">
|
||||
{
|
||||
blogPosts.map((b, index) =>
|
||||
posts.map((b, index) =>
|
||||
index % 2 === 0 ? (
|
||||
<BlogLeftSection
|
||||
title={b.title}
|
||||
@@ -15,11 +15,12 @@ const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
||||
const bgColorClasses =
|
||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
||||
const sizeClasses = 'h-30 w-100 md:w-[300px]';
|
||||
---
|
||||
|
||||
<div class={`${baseClasses}`}>
|
||||
<a
|
||||
class={`rounded-xl duration-300 transition-all h-30 ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
||||
class={`rounded-xl duration-300 transition-all ${sizeClasses} ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
||||
href={url}
|
||||
data-astro-prefetch
|
||||
>
|
||||
|
||||
52
src/components/ui/images/ImageTheme.astro
Normal file
52
src/components/ui/images/ImageTheme.astro
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
import { Image } from 'astro:assets';
|
||||
import { blurStyle } from '@support/image';
|
||||
|
||||
const { srcLight, srcDark, alt, style, disableBlur, width, height } = Astro.props;
|
||||
|
||||
const showBlur = !disableBlur;
|
||||
|
||||
const blurLight = (srcLight?.fsPath && showBlur) ? await blurStyle(srcLight.fsPath) : {};
|
||||
const blurDark = (srcDark?.fsPath && showBlur) ? await blurStyle(srcDark.fsPath) : {};
|
||||
---
|
||||
|
||||
<div class="themed-image-container">
|
||||
<Image
|
||||
src={srcLight}
|
||||
alt={alt}
|
||||
class={`light-logo ${style}`}
|
||||
style={blurLight}
|
||||
inferSize={true}
|
||||
width={width}
|
||||
height={height}
|
||||
/>
|
||||
|
||||
<Image
|
||||
src={srcDark}
|
||||
alt={alt}
|
||||
class={`dark-logo ${style}`}
|
||||
style={blurDark}
|
||||
inferSize={true}
|
||||
width={width}
|
||||
height={height}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.themed-image-container {
|
||||
display: grid;
|
||||
grid-template-areas: "stack";
|
||||
}
|
||||
|
||||
.themed-image-container :global(img) {
|
||||
grid-area: stack;
|
||||
}
|
||||
|
||||
:global(.dark) .light-logo {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:global(.dark) .dark-logo {
|
||||
display: block !important;
|
||||
}
|
||||
</style>
|
||||
16
src/components/ui/logos/Logo.astro
Normal file
16
src/components/ui/logos/Logo.astro
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
import ImageTheme from '@components/ui/images/ImageTheme.astro';
|
||||
|
||||
const { srcLight, srcDark, alt } = Astro.props;
|
||||
---
|
||||
|
||||
<ImageTheme
|
||||
srcLight={srcLight}
|
||||
srcDark={srcDark}
|
||||
alt={alt}
|
||||
style='color: transparent; width: 48px; height: 48px; object-fit: contain; max-height: 100%; max-width: 100%;'
|
||||
draggable="false"
|
||||
loading="lazy"
|
||||
width="48"
|
||||
height="48"
|
||||
/>
|
||||
71
src/components/ui/sections/Applications.astro
Normal file
71
src/components/ui/sections/Applications.astro
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import { readItems } from '@directus/sdk';
|
||||
import Logo from '@components/ui/logos/Logo.astro';
|
||||
|
||||
import type { Application } from '@lib/directusTypes';
|
||||
|
||||
import directus from '@lib/directus';
|
||||
|
||||
const applications = await directus.request(
|
||||
readItems('site_applications', {
|
||||
fields: ['*'],
|
||||
sort: ['-isActive'],
|
||||
})
|
||||
);
|
||||
|
||||
const baseClasses = 'smooth-reveal-cards rounded-xl flex flex-col group group-hover';
|
||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
||||
const bgColorClasses =
|
||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
||||
---
|
||||
|
||||
<section class:list={['flex flex-col gap-4', Astro.props.className]}>
|
||||
<div class="grid grid-cols-1 gap-3 md:grid-cols-2 print:flex print:flex-col">
|
||||
{
|
||||
applications.map((application: Application) => {
|
||||
return (
|
||||
<div class={`${baseClasses}`}>
|
||||
<a
|
||||
class={`rounded-xl transition-all duration-300 ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
||||
href={application.url}
|
||||
>
|
||||
<div class="p-4 md:p-10">
|
||||
<div class="flex items-center">
|
||||
<Logo
|
||||
srcLight={application.logoUrl}
|
||||
srcDark={application.logoUrl}
|
||||
alt={`Logo of ${application.name}`}
|
||||
/>
|
||||
<h3 class="text-lg font-bold text-gray-800 dark:text-white ml-4">
|
||||
{application.name}
|
||||
</h3>
|
||||
</div>
|
||||
<p class="mt-2 text-gray-500 dark:text-neutral-400">{application.description}</p>
|
||||
<ul class="mt-1 flex list-disc flex-col gap-2 text-sm text-gray-500 dark:text-neutral-400 [&>li]:ml-4">
|
||||
{application.highlights.map((highlight) => {
|
||||
return <li class="marker:text-yellow-500">{highlight}</li>;
|
||||
})}
|
||||
</ul>
|
||||
<div class="ml-6 flex">
|
||||
<div
|
||||
class="group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
>
|
||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-11 items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
||||
<Icon
|
||||
name="mdi:keyboard-arrow-right"
|
||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,10 +1,12 @@
|
||||
---
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import { readItems } from '@directus/sdk';
|
||||
import Logo from '@components/ui/logos/Logo.astro';
|
||||
|
||||
import type { Education } from '@lib/directusTypes';
|
||||
|
||||
import directus from '@lib/directus';
|
||||
import { getDirectusImageURL } from '@lib/directusFunctions';
|
||||
|
||||
const education = await directus.request(
|
||||
readItems('site_education', {
|
||||
@@ -20,7 +22,7 @@ const certificate = await directus.request(
|
||||
})
|
||||
);
|
||||
|
||||
const baseClasses = ' rounded-xl flex flex-col';
|
||||
const baseClasses = 'rounded-xl flex flex-col group group-hover';
|
||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
||||
const bgColorClasses =
|
||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
||||
@@ -35,47 +37,50 @@ const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shado
|
||||
</h3>
|
||||
<div class="ml-8">
|
||||
<h4 class="smooth-reveal-1 pt-5 text-2xl font-semibold text-neutral-800 dark:text-neutral-200">
|
||||
University
|
||||
College
|
||||
</h4>
|
||||
<ul class="space-y-4 py-3">
|
||||
{
|
||||
education.map(({ institution, area, url }) => {
|
||||
return (
|
||||
<div class="smooth-reveal-cards mt-4 grid grid-cols-3 gap-4 rounded-xl">
|
||||
<div>
|
||||
<div
|
||||
class={`p-4 transition-all duration-300 md:p-5 ${shadowClasses} ${bgColorClasses} ${baseClasses} ${borderClasses}`}
|
||||
<div class="grid md:grid-cols-2 sm:grid-cols-1 gap-4">
|
||||
{
|
||||
education.map(({ institution, area, url, graduationDate, logo, logoDark }) => {
|
||||
return (
|
||||
<div class="smooth-reveal-cards mt-4 rounded-xl">
|
||||
<a
|
||||
class={`p-4 md:p-6 transition-all duration-300 ${shadowClasses} ${bgColorClasses} ${baseClasses} ${borderClasses}`}
|
||||
href={url}
|
||||
>
|
||||
<h3 class="flex flex-row text-lg font-bold text-neutral-800 dark:text-neutral-200">
|
||||
<Icon
|
||||
name="mdi:university-outline"
|
||||
class="mr-2 h-3 w-3 translate-y-1 md:h-5 md:w-5"
|
||||
<div class="flex items-center">
|
||||
<Logo
|
||||
srcLight={getDirectusImageURL(logo)}
|
||||
srcDark={getDirectusImageURL(logoDark)}
|
||||
alt={`Logo of ${institution}`}
|
||||
/>
|
||||
{institution}
|
||||
</h3>
|
||||
<p class="mt-2 ml-7 text-xs font-medium text-neutral-600 uppercase dark:text-neutral-400">
|
||||
{area}
|
||||
<h3 class="text-lg font-bold text-neutral-800 dark:text-neutral-200 ml-4">
|
||||
{institution}
|
||||
</h3>
|
||||
</div>
|
||||
<p class="ml-16 text-xs font-medium text-neutral-600 uppercase dark:text-neutral-400">
|
||||
{area} - {new Date(graduationDate).getFullYear()}
|
||||
</p>
|
||||
<div class="ml-6 flex">
|
||||
<a
|
||||
class="group group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
href={url}
|
||||
<div
|
||||
class="group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
>
|
||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-[44px] items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-11 items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
||||
<Icon
|
||||
name="mdi:keyboard-arrow-right"
|
||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
}
|
||||
);
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -86,42 +91,43 @@ const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shado
|
||||
Certificates
|
||||
</h4>
|
||||
<ul class="space-y-4 py-3">
|
||||
{certificate.map(({ name, issuer, url }) => {
|
||||
return (
|
||||
<div class="smooth-reveal-cards mt-4 grid grid-cols-3 gap-4 rounded-xl">
|
||||
<div>
|
||||
<div
|
||||
class={`p-4 transition-all duration-300 md:p-5 ${shadowClasses} ${bgColorClasses} ${baseClasses} ${borderClasses}`}
|
||||
<div class="grid md:grid-cols-2 sm:grid-cols-1 gap-4">
|
||||
{certificate.map(({ name, issuer, issuerDate, url, logoName }) => {
|
||||
return (
|
||||
<div class="smooth-reveal-cards mt-4 rounded-xl">
|
||||
<a
|
||||
class={`p-4 md:p-6 transition-all duration-300 ${shadowClasses} ${bgColorClasses} ${baseClasses} ${borderClasses}`}
|
||||
href={url}
|
||||
>
|
||||
<h3 class="flex flex-row text-lg font-bold text-neutral-800 dark:text-neutral-200">
|
||||
<Icon
|
||||
name="mdi:script-text-outline"
|
||||
class="mr-2 h-3 w-3 translate-y-1 md:h-5 md:w-5"
|
||||
/>
|
||||
{name}
|
||||
</h3>
|
||||
<p class="mt-2 ml-7 text-xs font-medium text-neutral-600 uppercase dark:text-neutral-400">
|
||||
{issuer}
|
||||
<div class="flex items-center">
|
||||
<div class="text-neutral-800 dark:text-neutral-200">
|
||||
<Icon name={logoName} class="h-12 w-12" />
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-neutral-800 dark:text-neutral-200 ml-4">
|
||||
{name}
|
||||
</h3>
|
||||
</div>
|
||||
<p class="ml-16 text-xs font-medium text-neutral-600 uppercase dark:text-neutral-400">
|
||||
{issuer} - {new Date(issuerDate).getFullYear()}
|
||||
</p>
|
||||
<div class="ml-6 flex">
|
||||
<a
|
||||
class="group group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
href={url}
|
||||
<div
|
||||
class="group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
>
|
||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-[44px] items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-11 items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
||||
<Icon
|
||||
name="mdi:keyboard-arrow-right"
|
||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ const experiences = await directus.request(
|
||||
---
|
||||
|
||||
<section
|
||||
class:list={['flex flex-col gap-4', Astro.props.className]}
|
||||
class:list={['flex flex-col gap-8', Astro.props.className]}
|
||||
|
||||
>
|
||||
<h3 class="relative smooth-reveal-1 flex w-full items-center gap-3 pb-10 text-5xl text-neutral-800 dark:text-neutral-200">Experience</h3>
|
||||
|
||||
@@ -7,12 +7,12 @@ import FeaturesCard from '@components/ui/cards/FeaturesCard.astro';
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
---
|
||||
|
||||
<section class="mx-auto mb-20 max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||
<section class="mx-auto mb-20 max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||
<div
|
||||
class="flex flex-col items-center justify-center gap-y-2 sm:flex-row sm:gap-x-12 sm:gap-y-0 lg:gap-x-24"
|
||||
>
|
||||
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
|
||||
<div class="grid gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3">
|
||||
<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">
|
||||
<FeaturesCard
|
||||
title="Cloud Engineer"
|
||||
description="Full stack and cloud engineer."
|
||||
@@ -25,6 +25,12 @@ const global = await directus.request(readSingleton('site_global'));
|
||||
url="/categories/homelab/"
|
||||
icon="mdi:home-variant-outline"
|
||||
/>
|
||||
<FeaturesCard
|
||||
title="Documentation"
|
||||
description="Reference and guides for my homelab."
|
||||
url="https://docs.alexlebens.dev"
|
||||
icon="mdi:file-document-multiple"
|
||||
/>
|
||||
<FeaturesCard
|
||||
title="Email"
|
||||
description={`Send me a message.`}
|
||||
|
||||
@@ -15,11 +15,14 @@ interface Props {
|
||||
secondaryBtnURL?: string;
|
||||
src?: any;
|
||||
alt?: string;
|
||||
rounded?: boolean;
|
||||
}
|
||||
|
||||
const roundedClasses = Astro.props.rounded ? "rounded-xl" : null;
|
||||
---
|
||||
|
||||
<section
|
||||
class="mx-auto grid max-w-[85rem] 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"
|
||||
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>
|
||||
<h1
|
||||
@@ -48,7 +51,7 @@ interface Props {
|
||||
<Image
|
||||
src={src}
|
||||
alt={alt}
|
||||
class="h-full w-[420px] scale-100 object-cover object-center"
|
||||
class={`h-full w-[420px] scale-100 object-cover object-center ${roundedClasses}`}
|
||||
draggable="false"
|
||||
loading="eager"
|
||||
format="webp"
|
||||
|
||||
@@ -11,7 +11,7 @@ interface Props {
|
||||
}
|
||||
---
|
||||
|
||||
<section class="lg:px- relative mx-auto mb-20 max-w-[85rem] px-4 pt-30 pb-30 sm:px-6">
|
||||
<section class="lg:px- relative mx-auto mb-20 max-w-340 px-4 pt-30 pb-30 sm:px-6">
|
||||
<div
|
||||
class="smooth-reveal absolute top-[55%] left-0 scale-90 md:top-[20%] xl:top-[25%] xl:left-[10%]"
|
||||
>
|
||||
|
||||
@@ -14,20 +14,17 @@ const posts = await directus.request(
|
||||
);
|
||||
|
||||
const recentPosts = posts
|
||||
.sort((a: Post, b: Post) => b.published_date.getTime() - a.published_date.getTime())
|
||||
.sort((a: Post, b: Post) => (new Date(b.published_date).getTime()) - (new Date(a.published_date).getTime()))
|
||||
.slice(0, 3);
|
||||
---
|
||||
|
||||
<section class="mx-auto mb-20 max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||
<section class="mx-auto mb-20 max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||
<div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14">
|
||||
<h1
|
||||
class="smooth-reveal block text-4xl font-bold text-neutral-800 md:text-5xl md:leading-tight lg:text-5xl dark:text-neutral-200"
|
||||
>
|
||||
Latest Posts
|
||||
</h1>
|
||||
<p class="smooth-reveal mt-1 text-pretty text-neutral-600 dark:text-neutral-300">
|
||||
More recent posts.
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{recentPosts.map((b) => <BlogCard post={b} />)}
|
||||
|
||||
@@ -13,7 +13,7 @@ const projects = await directus.request(
|
||||
})
|
||||
);
|
||||
|
||||
const baseClasses = 'smooth-reveal-cards rounded-xl flex flex-col';
|
||||
const baseClasses = 'smooth-reveal-cards rounded-xl flex flex-col group group-hover';
|
||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
||||
const bgColorClasses =
|
||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
||||
@@ -31,8 +31,9 @@ const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shado
|
||||
projects.map((project: Project) => {
|
||||
return (
|
||||
<div class={`${baseClasses}`}>
|
||||
<div
|
||||
<a
|
||||
class={`rounded-xl transition-all duration-300 ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
||||
href={project.source}
|
||||
>
|
||||
<div class="p-4 md:p-10">
|
||||
<h3 class="text-lg font-bold text-gray-800 dark:text-white">{project.name}</h3>
|
||||
@@ -43,30 +44,21 @@ const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shado
|
||||
})}
|
||||
</ul>
|
||||
<div class="flex">
|
||||
<a
|
||||
<div
|
||||
class="group group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
href={project.url}
|
||||
>
|
||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text text-md relative z-10 mx-auto flex min-h-[44px] items-center font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
||||
<div class="group-hover:text-gitea-primary dark:group-hover:text-gitea-primary transition-text text-md relative z-10 mx-auto flex min-h-11 items-center font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<Icon name="pajamas:gitea" />
|
||||
<span class="relative inline-block overflow-hidden ml-2"> Visit Source </span>
|
||||
<Icon
|
||||
name="mdi:keyboard-arrow-right"
|
||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
class="group group-hover relative ml-auto inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
||||
href={project.source}
|
||||
>
|
||||
<div class="group-hover:text-gitea-primary dark:group-hover:text-gitea-primary transition-text text-md relative z-10 mx-auto flex min-h-[44px] items-center font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
||||
<span class="relative inline-block overflow-hidden"> Source </span>
|
||||
<Icon name="pajamas:gitea" class="ml-2 translate-y-0.5" />
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
|
||||
@@ -54,7 +54,7 @@ const shadowClasses = 'shadow-xs hover:shadow-lg';
|
||||
|
||||
<div class="relative h-1.5 w-full overflow-hidden rounded-full bg-stone-500/20 sm:h-2 dark:bg-stone-500/20">
|
||||
<div
|
||||
class="progress-bar-animate from-steel via-bermuda to-steel absolute top-0 left-0 h-full rounded-full bg-gradient-to-r transition-all duration-1000"
|
||||
class="progress-bar-animate from-steel via-bermuda to-steel absolute top-0 left-0 h-full rounded-full bg-linear-to-r transition-all duration-1000"
|
||||
style={`width: ${skill.level}%`}
|
||||
/>
|
||||
</div>
|
||||
@@ -70,13 +70,13 @@ const shadowClasses = 'shadow-xs hover:shadow-lg';
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Gradient overlays for smooth fade effect -->
|
||||
<!-- Gradient overlays -->
|
||||
<div
|
||||
class="absolute top-0 bottom-0 left-0 z-10 w-12 bg-gradient-to-r from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
||||
class="absolute top-0 bottom-0 left-0 z-10 w-12 bg-linear-to-r from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="absolute top-0 right-0 bottom-0 z-10 w-12 bg-gradient-to-l from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
||||
class="absolute top-0 right-0 bottom-0 z-10 w-12 bg-linear-to-l from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,7 +85,7 @@ const shadowClasses = 'shadow-xs hover:shadow-lg';
|
||||
|
||||
<script>
|
||||
document.addEventListener('astro:page-load', () => {
|
||||
// Create seamless infinite scrolling effect
|
||||
// Create infinite scrolling effect
|
||||
function setupInfiniteScroll() {
|
||||
const cards = document.querySelectorAll('.skill-card');
|
||||
if (!cards.length) return;
|
||||
|
||||
58
src/components/ui/sections/WeatherSection.astro
Normal file
58
src/components/ui/sections/WeatherSection.astro
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
import { getFiveDayForecast } from '@support/weather';
|
||||
|
||||
const { latitude = "44.95", longitude = "-93.09", cityName = "St. Paul, Minnesota" } = Astro.props;
|
||||
const { forecastDays, error } = await getFiveDayForecast(latitude, longitude);
|
||||
|
||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
||||
const bgColorClasses = 'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
||||
---
|
||||
|
||||
<section class="mx-auto mb-20 max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||
<div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14">
|
||||
<h1 class="smooth-reveal block text-4xl font-bold text-neutral-800 md:text-5xl md:leading-tight lg:text-5xl dark:text-neutral-200">
|
||||
Weather in my Area
|
||||
</h1>
|
||||
<div class="smooth-reveal mx-auto mt-5 max-w-3xl text-center">
|
||||
<p class="text-lg text-pretty text-neutral-600 dark:text-neutral-400">
|
||||
5 day forecast for {cityName}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{error ? (
|
||||
<div class={`rounded-xl p-10 text-center text-yellow-500 ${borderClasses} ${bgColorClasses}`}>
|
||||
{error}
|
||||
</div>
|
||||
) : (
|
||||
<div class="flex flex-wrap justify-center gap-4 lg:gap-6">
|
||||
{forecastDays.map((day) => (
|
||||
<div class="smooth-reveal-2 group flex flex-col">
|
||||
<div class={`rounded-xl duration-300 transition-all w-32 md:w-44 ${borderClasses} ${bgColorClasses} ${shadowClasses}`}>
|
||||
<div class="p-4 text-center">
|
||||
<span class="block text-xs font-bold tracking-widest text-neutral-500 uppercase dark:text-neutral-400">
|
||||
{day.dayName}
|
||||
</span>
|
||||
<div class="flex justify-center my-2">
|
||||
<img
|
||||
src={`https://openweathermap.org/img/wn/${day.icon}@2x.png`}
|
||||
alt={day.label}
|
||||
class="h-12 w-12 drop-shadow-sm group-hover:scale-110 transition-transform duration-300"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<span class="group-hover:text-steel dark:group-hover:text-bermuda transition-all duration-300 block text-2xl font-bold text-neutral-600 dark:text-neutral-300">
|
||||
{day.temp}°F
|
||||
</span>
|
||||
<span class="mt-1 block text-xs text-neutral-500 dark:text-neutral-400 capitalize">
|
||||
{day.label}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
@@ -2,47 +2,25 @@ 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 WorkInformation = [
|
||||
{
|
||||
name: 'Tech Startup',
|
||||
position: 'Junior Web Developer',
|
||||
location_type: 'On site',
|
||||
location: 'Auckland, New Zealand',
|
||||
url: 'https://techstartup.com',
|
||||
startDate: '2024-01-01',
|
||||
endDate: null,
|
||||
summary:
|
||||
'Developing and maintaining web applications using JavaScript, HTML, and CSS. Collaborating with the team to implement new features and fix bugs.',
|
||||
highlights: ['Improved website performance by optimizing code'],
|
||||
responsibilities: [
|
||||
'Collaborated with senior developers to design and implement web applications using modern JavaScript frameworks.',
|
||||
'Assisted in debugging and optimizing front-end code to ensure smooth user experiences.',
|
||||
'Participated in code reviews and contributed to improving coding standards within the team.',
|
||||
],
|
||||
achievements: [
|
||||
'Developing and maintaining web applications using JavaScript, HTML, and CSS. Collaborating with the team to implement new features and fix bugs.',
|
||||
],
|
||||
skills: ['React', 'Tailwind', 'GitHub'],
|
||||
},
|
||||
];
|
||||
|
||||
export const NavigationLinks: NavigationLink[] = [
|
||||
{ name: 'Home', url: '/' },
|
||||
{ name: 'Blog', url: '/blog/' },
|
||||
{ name: 'Categories', url: '/categories/' },
|
||||
{ name: 'Apps', url: '/apps/' },
|
||||
{ name: 'About Me', url: '/about/' },
|
||||
];
|
||||
|
||||
export const FooterLinks: NavigationLink[] = [
|
||||
{ name: 'RSS', url: '/rss.xml' },
|
||||
{ name: 'Gitea', url: '/https://gitea.alexlebens.dev' },
|
||||
{ name: 'Gitea', url: 'https://gitea.alexlebens.dev' },
|
||||
{ name: 'Docs', url: 'https://docs.alexlebens.dev' },
|
||||
];
|
||||
|
||||
export const SEO = {
|
||||
|
||||
BIN
src/images/cedar_tree.png
Normal file
BIN
src/images/cedar_tree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 MiB |
@@ -55,13 +55,7 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`;
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-stone-200 selection:bg-yellow-400 selection:text-neutral-700 dark:bg-stone-700">
|
||||
<!-- <div class="fixed inset-0 -z-10">
|
||||
<div
|
||||
class="bg-grid-pattern absolute inset-0 [mask-image:radial-gradient(white,transparent_85%)] bg-[center_top_-1px]"
|
||||
>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="mx-auto w-full max-w-(--breakpoint-2xl) flex-grow px-4 sm:px-6 lg:px-8">
|
||||
<div class="mx-auto w-full max-w-(--breakpoint-2xl) grow px-4 sm:px-6 lg:px-8">
|
||||
<Header />
|
||||
<main class="min-h-screen">
|
||||
<slot />
|
||||
|
||||
@@ -2,7 +2,9 @@ import { createDirectus, rest } from '@directus/sdk';
|
||||
|
||||
import type {
|
||||
Global,
|
||||
Weather,
|
||||
Post,
|
||||
Application,
|
||||
Experience,
|
||||
Education,
|
||||
Certificate,
|
||||
@@ -14,7 +16,9 @@ import { getDirectusURL } from '@lib/directusFunctions';
|
||||
|
||||
type Schema = {
|
||||
site_global: Global;
|
||||
site_weather: Weather;
|
||||
posts: Post[];
|
||||
site_applications: Application;
|
||||
site_experience: Experience;
|
||||
site_education: Education;
|
||||
site_certificate: Certificate;
|
||||
|
||||
@@ -2,7 +2,7 @@ const getDirectusURL = () => {
|
||||
if (process.env.DIRECTUS_URL) {
|
||||
return `https://${process.env.DIRECTUS_URL}`;
|
||||
}
|
||||
return 'https://directus.alexlebens.dev';
|
||||
return 'https://directus.alexlebens.net';
|
||||
};
|
||||
|
||||
async function getDirectusImageURL(image: string) {
|
||||
|
||||
@@ -2,6 +2,9 @@ export type Global = {
|
||||
name: string;
|
||||
about: string;
|
||||
about_description: string;
|
||||
about_blog: string;
|
||||
about_applications: string;
|
||||
about_categories: string;
|
||||
initials: string;
|
||||
email: string;
|
||||
site_url: string;
|
||||
@@ -10,14 +13,23 @@ export type Global = {
|
||||
portrait_alt: string;
|
||||
home_image: string;
|
||||
home_image_alt: string;
|
||||
categories_image: string;
|
||||
categories_image_alt: string;
|
||||
blog_image: string;
|
||||
blog_image_alt: string;
|
||||
categories_image: string;
|
||||
categories_image_alt: string;
|
||||
applications_image: string;
|
||||
applications_image_alt: string;
|
||||
footer_image: string;
|
||||
footer_image_alt: string;
|
||||
};
|
||||
|
||||
export type Weather = {
|
||||
id: string;
|
||||
location: string;
|
||||
latitude: string;
|
||||
longitude: string;
|
||||
}
|
||||
|
||||
export type Post = {
|
||||
slug: string;
|
||||
title: string;
|
||||
@@ -35,6 +47,16 @@ export type Post = {
|
||||
updated_date: Date;
|
||||
};
|
||||
|
||||
export type Application = {
|
||||
id: string;
|
||||
name: string;
|
||||
isActive: boolean;
|
||||
description: string;
|
||||
highlights: string[];
|
||||
url: string;
|
||||
logoUrl: string;
|
||||
};
|
||||
|
||||
export type Experience = {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -58,6 +80,8 @@ export type Education = {
|
||||
area: string;
|
||||
studyType: string;
|
||||
graduationDate: string;
|
||||
logo: string;
|
||||
logoDark: string;
|
||||
};
|
||||
|
||||
export type Certificate = {
|
||||
@@ -66,6 +90,7 @@ export type Certificate = {
|
||||
issuer: string;
|
||||
issuerDate: string;
|
||||
url: string;
|
||||
logoName: string;
|
||||
};
|
||||
|
||||
export type Project = {
|
||||
|
||||
@@ -29,7 +29,7 @@ const global = await directus.request(readSingleton('site_global'));
|
||||
}}
|
||||
>
|
||||
<section class="mt-20 grid place-content-center">
|
||||
<div class="mx-auto max-w-screen-xl px-4 py-8 lg:px-6 lg:py-16">
|
||||
<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
|
||||
|
||||
@@ -11,13 +11,11 @@ import Education from '@components/ui/sections/Education.astro';
|
||||
import portraitImg from '@images/portrait.avif';
|
||||
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
|
||||
const description = 'About me.';
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title="About Me"
|
||||
description={description}
|
||||
description="About me."
|
||||
structuredData={{
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
@@ -25,7 +23,7 @@ const description = 'About me.';
|
||||
'@id': Astro.url.href,
|
||||
url: Astro.url.href,
|
||||
name: `About | ${global.name}`,
|
||||
description: description,
|
||||
description: 'About me.',
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
url: global.site_url,
|
||||
@@ -39,11 +37,12 @@ const description = 'About me.';
|
||||
subTitle={global.about}
|
||||
src={portraitImg}
|
||||
alt={global.portrait_alt}
|
||||
rounded={true}
|
||||
/>
|
||||
|
||||
<section class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
|
||||
<main class="relative grid max-w-7xl gap-12 p-8 max-sm:py-16 md:grid-cols-6 md:p-16 xl:gap-24">
|
||||
<div class="space-y-12 md:col-span-8">
|
||||
<section class="mx-auto max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
|
||||
<main class="relative grid grid-cols-1 md:grid-cols-6 gap-12 p-8 md:p-16 xl:gap-24 max-w-7xl mx-auto">
|
||||
<div class="space-y-12 col-span-1 md:col-span-6">
|
||||
<Experience className="smooth-reveal-2" />
|
||||
<Education className="smooth-reveal-2 mt-30" />
|
||||
<Projects className="smooth-reveal-2 mt-30" />
|
||||
|
||||
66
src/pages/apps.astro
Normal file
66
src/pages/apps.astro
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
import { readSingleton } from '@directus/sdk';
|
||||
|
||||
import directus from '@lib/directus';
|
||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
||||
import Applications from '@components/ui/sections/Applications.astro';
|
||||
import applicationImg from '@images/cedar_tree.png';
|
||||
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title="Applications"
|
||||
description={global.about_applications}
|
||||
structuredData={{
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
inLanguage: 'en-US',
|
||||
'@id': Astro.url.href,
|
||||
url: Astro.url.href,
|
||||
name: `Applications | ${global.name}`,
|
||||
description: global.about_applications,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
url: global.site_url,
|
||||
name: global.name,
|
||||
description: global.about,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<HeroSection
|
||||
title="Applications"
|
||||
subTitle={global.about_applications}
|
||||
src={applicationImg}
|
||||
alt={global.applications_image_alt}
|
||||
/>
|
||||
|
||||
<section class="mx-auto max-w-340 px-4 sm:px-6 lg:px-8 lg:py-14 pb-10">
|
||||
<main class="relative grid grid-cols-1 md:grid-cols-6 gap-12 p-2 md:p-16 xl:gap-24 max-w-7xl mx-auto">
|
||||
<div class="space-y-12 col-span-1 md:col-span-6">
|
||||
<Applications className="smooth-reveal-2" />
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
</BaseLayout>
|
||||
|
||||
<script>
|
||||
// Add smooth reveal animations for content after loading
|
||||
document.addEventListener('astro:page-load', () => {
|
||||
const animateContent = () => {
|
||||
// Animate group 1
|
||||
const smoothReveal = document.querySelectorAll('.smooth-reveal');
|
||||
smoothReveal.forEach((el, index) => {
|
||||
setTimeout(
|
||||
() => {
|
||||
el.classList.add('animate-reveal');
|
||||
},
|
||||
50 + index * 100
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
animateContent();
|
||||
});
|
||||
</script>
|
||||
@@ -4,6 +4,9 @@ import getReadingTime from 'reading-time';
|
||||
import { readItems, readSingleton } from '@directus/sdk';
|
||||
|
||||
import directus from '@lib/directus';
|
||||
import { marked } from 'marked';
|
||||
import markedShiki from 'marked-shiki';
|
||||
import { createHighlighter } from 'shiki';
|
||||
import { getDirectusImageURL } from '@lib/directusFunctions';
|
||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||
import Image from '@components/ui/images/Image.astro';
|
||||
@@ -23,6 +26,24 @@ const category: CollectionEntry<'categories'> = (await getCollection('categories
|
||||
.filter((c) => c.slug === post.category)
|
||||
.pop() as CollectionEntry<'categories'>;
|
||||
const readingTime = getReadingTime(post.content);
|
||||
|
||||
const highlighter = await createHighlighter({
|
||||
themes: ['github-light', 'github-dark', 'monokai'],
|
||||
langs: ['typescript', 'python', 'css', 'html', 'yaml', 'bash', 'json'],
|
||||
});
|
||||
marked.use(markedShiki({
|
||||
highlight(code, lang) {
|
||||
return highlighter.codeToHtml(code, {
|
||||
lang: lang || 'plaintext',
|
||||
themes: {
|
||||
light: 'github-light',
|
||||
dark: 'github-dark',
|
||||
},
|
||||
defaultColor: false,
|
||||
});
|
||||
}
|
||||
}));
|
||||
const content = marked.parse(post.content);
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
@@ -124,9 +145,9 @@ const readingTime = getReadingTime(post.content);
|
||||
</div>
|
||||
|
||||
<article
|
||||
class="prose prose-blog sm:prose-lg dark:prose-invert max-w-none text-justify text-neutral-800 dark:text-neutral-200"
|
||||
class="prose prose-blog sm:prose-lg dark:prose-invert max-w-none text-neutral-800 dark:text-neutral-200"
|
||||
>
|
||||
<div set:html={post.content} />
|
||||
<div set:html={content} />
|
||||
</article>
|
||||
|
||||
<div
|
||||
|
||||
@@ -5,8 +5,8 @@ import type { Post } from '@lib/directusTypes';
|
||||
|
||||
import directus from '@lib/directus';
|
||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||
import BlogRecentCard from '@components/blog/BlogRecentCard.astro';
|
||||
import BlogFeaturedArticle from '@components/blog/BlogFeaturedArticle.astro';
|
||||
import BlogSelectedArticles from '@components/blog/BlogSelectedArticles.astro';
|
||||
import BlogRecentArticles from '@components/blog/BlogRecentArticles.astro';
|
||||
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
||||
import blogImg from '@images/autumn_tree.png';
|
||||
|
||||
@@ -18,15 +18,15 @@ const posts = await directus.request(
|
||||
sort: ['-published_date'],
|
||||
})
|
||||
);
|
||||
const selectedPosts: Post[] = posts.filter((p) => p.selected);
|
||||
|
||||
const description =
|
||||
"Sharing what I've learned, one post at a time. I hope you find something useful.";
|
||||
const selectedPosts: Post[] = posts.filter((p) => p.selected).slice(0, 4);
|
||||
const recentPosts: Post[] = posts.filter(
|
||||
(p) => !selectedPosts.some((selected) => selected.slug === p.slug)
|
||||
).slice(0, 6);
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title="Blog"
|
||||
description={description}
|
||||
description={global.about_blog}
|
||||
structuredData={{
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
@@ -34,7 +34,7 @@ const description =
|
||||
'@id': Astro.url.href,
|
||||
url: Astro.url.href,
|
||||
name: `Blog | ${global.name}`,
|
||||
description: description,
|
||||
description: global.about_blog,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
url: global.site_url,
|
||||
@@ -43,10 +43,10 @@ const description =
|
||||
},
|
||||
}}
|
||||
>
|
||||
<HeroSection title="Blog" subTitle={description} src={blogImg} alt={global.blog_image_alt} />
|
||||
<HeroSection title="Blog" subTitle={global.about_blog} src={blogImg} alt={global.blog_image_alt} />
|
||||
|
||||
<BlogRecentCard posts={posts} />
|
||||
<BlogFeaturedArticle posts={selectedPosts} />
|
||||
<BlogSelectedArticles posts={selectedPosts} />
|
||||
<BlogRecentArticles posts={recentPosts} />
|
||||
</BaseLayout>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -73,14 +73,11 @@ const categories = (await getCollection('categories'))
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const description =
|
||||
'Here are some of the general categories that I am interested in, including homelabs, technology, and Minnesota.';
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title="All Categories"
|
||||
description={description}
|
||||
description={global.about_categories}
|
||||
structuredData={{
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
@@ -88,7 +85,7 @@ const description =
|
||||
'@id': Astro.url.href,
|
||||
url: Astro.url.href,
|
||||
name: `All Categories | ${global.name}`,
|
||||
description: description,
|
||||
description: global.about_categories,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
url: global.site_url,
|
||||
@@ -99,7 +96,7 @@ const description =
|
||||
>
|
||||
<HeroSection
|
||||
title="Categories"
|
||||
subTitle={description}
|
||||
subTitle={global.about_categories}
|
||||
src={categoryImg}
|
||||
alt={global.categories_image_alt}
|
||||
/>
|
||||
|
||||
@@ -5,19 +5,18 @@ import directus from '@lib/directus';
|
||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
||||
import FeaturesSection from '@components/ui/sections/FeaturesSection.astro';
|
||||
import WeatherSection from '@components/ui/sections/WeatherSection.astro';
|
||||
import LatestPosts from '@components/ui/sections/LatestPosts.astro';
|
||||
import HeroSectionAlt from '@components/ui/sections/HeroSectionAlt.astro';
|
||||
import homeImg from '@images/autumn_mountain.png';
|
||||
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
|
||||
const description =
|
||||
'Engineering the cloud by day, homelab by night, and exploring Minnesota in between.';
|
||||
const weather = await directus.request(readSingleton('site_weather'));
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title="Home"
|
||||
description={description}
|
||||
description={global.about_description}
|
||||
structuredData={{
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
@@ -25,7 +24,7 @@ const description =
|
||||
'@id': Astro.url.href,
|
||||
url: Astro.url.href,
|
||||
name: `Home | ${global.name}`,
|
||||
description: description,
|
||||
description: global.about_description,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
url: global.site_url,
|
||||
@@ -36,7 +35,7 @@ const description =
|
||||
>
|
||||
<HeroSection
|
||||
title={`Hello, I'm <span class="text-steel dark:text-steel">Alex Lebens</span>`}
|
||||
subTitle={description}
|
||||
subTitle={global.about_description}
|
||||
primaryBtn="About Me"
|
||||
primaryBtnURL="/about"
|
||||
src={homeImg}
|
||||
@@ -45,6 +44,12 @@ const description =
|
||||
|
||||
<FeaturesSection />
|
||||
|
||||
<WeatherSection
|
||||
latitude={weather.latitude}
|
||||
longitude={weather.longitude}
|
||||
cityName={weather.location}
|
||||
/>
|
||||
|
||||
<LatestPosts />
|
||||
|
||||
<HeroSectionAlt
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// copy from https://github.com/delucis/astro-blog-full-text-rss
|
||||
// see https://github.com/delucis/astro-blog-full-text-rss/blob/latest/src/pages/rss.xml.ts
|
||||
// get more context
|
||||
// From https://github.com/delucis/astro-blog-full-text-rss
|
||||
|
||||
import { getContainerRenderer as getMDXRenderer } from '@astrojs/mdx';
|
||||
import rss, { type RSSFeedItem } from '@astrojs/rss';
|
||||
import type { APIContext } from 'astro';
|
||||
import { transform, walk } from 'ultrahtml';
|
||||
@@ -14,13 +11,11 @@ import directus from '@lib/directus';
|
||||
const global = await directus.request(readSingleton('site_global'));
|
||||
|
||||
export async function GET(context: APIContext) {
|
||||
// Get the URL to prepend to relative site links. Based on `site` in `astro.config.mjs`.
|
||||
let baseUrl = context.site?.href || global.site_url;
|
||||
if (baseUrl.at(-1) === '/') {
|
||||
baseUrl = baseUrl.slice(0, -1);
|
||||
}
|
||||
|
||||
// Load the content collection entries to add to our RSS feed.
|
||||
const posts = await directus.request(
|
||||
readItems('posts', {
|
||||
filter: { published: { _eq: true } },
|
||||
@@ -48,7 +43,6 @@ export async function GET(context: APIContext) {
|
||||
feedItems.push({ ...post, link: `/blog/${post.slug}/`, content });
|
||||
}
|
||||
|
||||
// Return our RSS feed XML response.
|
||||
return rss({
|
||||
title: global.name,
|
||||
description: global.about,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/* https://tailwindcss.com/docs/dark-mode */
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
|
||||
/* Add custom colors */
|
||||
/* Custom colors */
|
||||
@theme {
|
||||
--color-midnight: #0c354d;
|
||||
--color-turquoise: #0da797;
|
||||
@@ -60,6 +60,30 @@
|
||||
color var(--theme-transition),
|
||||
border-color var(--theme-transition);
|
||||
}
|
||||
|
||||
/* Shiki syntax highlighting */
|
||||
:root {
|
||||
--shiki-fg: var(--shiki-light);
|
||||
--shiki-bg: var(--color-neutral-200);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--shiki-fg: var(--shiki-dark);
|
||||
--shiki-bg: var(--color-neutral-800);
|
||||
}
|
||||
|
||||
pre.shiki {
|
||||
background-color: var(--shiki-bg) !important;
|
||||
color: var(--shiki-fg) !important;
|
||||
}
|
||||
|
||||
pre.shiki span {
|
||||
color: var(--shiki-light);
|
||||
}
|
||||
|
||||
.dark pre.shiki span {
|
||||
color: var(--shiki-dark) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Content reveal animations */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from 'node:fs/promises';
|
||||
|
||||
export interface BlurImageMetadata {
|
||||
interface BlurImageMetadata {
|
||||
/**
|
||||
* The width of the origin image
|
||||
*/
|
||||
@@ -23,7 +23,7 @@ export interface BlurImageMetadata {
|
||||
blurHeight: number;
|
||||
}
|
||||
|
||||
export async function blurStyle(filePath: string) {
|
||||
async function blurStyle(filePath: string) {
|
||||
const image = await blurImageMetadata(filePath);
|
||||
const svg = blurImageSVG(image);
|
||||
return {
|
||||
@@ -64,3 +64,5 @@ async function blurImageMetadata(filepath: string): Promise<BlurImageMetadata> {
|
||||
|
||||
return { blurDataURL, blurHeight, blurWidth, width, height };
|
||||
}
|
||||
|
||||
export { blurStyle };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { join } from 'node:path';
|
||||
|
||||
export function resolveFilePath(path: string) {
|
||||
function resolveFilePath(path: string) {
|
||||
if (path.startsWith('/')) {
|
||||
return resolveFilePathPublic(path);
|
||||
}
|
||||
@@ -8,12 +8,14 @@ export function resolveFilePath(path: string) {
|
||||
return resolveFilePathInternal(path);
|
||||
}
|
||||
|
||||
export function resolveFilePathPublic(path: string) {
|
||||
function resolveFilePathPublic(path: string) {
|
||||
return join(process.cwd(), path);
|
||||
}
|
||||
|
||||
export function resolveFilePathInternal(path: string) {
|
||||
function resolveFilePathInternal(path: string) {
|
||||
const normalizePath = path.startsWith('@') ? path.replace('@', '') : path;
|
||||
|
||||
return join(process.cwd(), 'src/', normalizePath);
|
||||
}
|
||||
|
||||
export { resolveFilePath, resolveFilePathPublic, resolveFilePathInternal };
|
||||
|
||||
67
src/support/weather.ts
Normal file
67
src/support/weather.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
interface DayForecast {
|
||||
date: string;
|
||||
temp: number;
|
||||
code: number;
|
||||
label: string;
|
||||
icon: string;
|
||||
dayName: string;
|
||||
}
|
||||
|
||||
interface WeatherResult {
|
||||
forecastDays: DayForecast[];
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
const getWeatherInfo = (code: number) => {
|
||||
if (code === 0) return { label: 'Clear', icon: '01d' };
|
||||
if (code >= 1 && code <= 3) return { label: 'Partly Cloudy', icon: '02d' };
|
||||
if (code === 45 || code === 48) return { label: 'Foggy', icon: '50d' };
|
||||
if (code >= 51 && code <= 55) return { label: 'Drizzle', icon: '09d' };
|
||||
if (code >= 61 && code <= 65) return { label: 'Rainy', icon: '10d' };
|
||||
if (code === 66 || code === 67) return { label: 'Freezing Rain', icon: '13d' };
|
||||
if (code >= 71 && code <= 75) return { label: 'Snowy', icon: '13d' };
|
||||
if (code === 77) return { label: 'Snow Grains', icon: '13d' };
|
||||
if (code >= 80 && code <= 82) return { label: 'Showers', icon: '09d' };
|
||||
if (code === 85 || code === 86) return { label: 'Snow Showers', icon: '13d' };
|
||||
if (code >= 95 && code <= 99) return { label: 'Stormy', icon: '11d' };
|
||||
|
||||
return { label: 'Unknown', icon: '03d' };
|
||||
};
|
||||
|
||||
const getDayName = (dateStr: string) => {
|
||||
return new Date(dateStr).toLocaleDateString('en-US', { weekday: 'short' });
|
||||
};
|
||||
|
||||
async function getFiveDayForecast(latitude: string, longitude: string): Promise<WeatherResult> {
|
||||
const url = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&daily=weather_code,temperature_2m_max&timezone=auto&temperature_unit=fahrenheit`;
|
||||
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) throw new Error("Weather service unavailable");
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
const forecastDays = data.daily.time.map((date: string, index: number): DayForecast => {
|
||||
const code = data.daily.weather_code[index];
|
||||
const info = getWeatherInfo(code);
|
||||
|
||||
return {
|
||||
date,
|
||||
temp: Math.round(data.daily.temperature_2m_max[index]),
|
||||
code,
|
||||
label: info.label,
|
||||
icon: info.icon,
|
||||
dayName: getDayName(date)
|
||||
};
|
||||
}).slice(0, 5);
|
||||
|
||||
return { forecastDays, error: null };
|
||||
} catch (e: unknown) {
|
||||
return {
|
||||
forecastDays: [],
|
||||
error: e instanceof Error ? e.message : "An unexpected error occurred"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export { getFiveDayForecast };
|
||||
Reference in New Issue
Block a user