Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03f74a8181 | |||
| 405fdf297c | |||
| 5b6b6e479f | |||
| 04344808bd | |||
| 6ec27345c3 | |||
| 5e02443409 | |||
| 8184d42942 | |||
| 04dfecc099 | |||
| ec10d45fd0 | |||
| ceb70c7049 | |||
| 4dbc5d12a3 | |||
| b55c3a0e31 | |||
| e63abf03ef | |||
| a7e7e5b0e8 | |||
| 96724d0016 | |||
| 30b2e980c0 |
@@ -31,12 +31,11 @@ jobs:
|
|||||||
uses: actions/cache@v5
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules/.cache
|
.astro
|
||||||
.astro/cache
|
node_modules/.vite
|
||||||
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-${{ github.sha }}
|
key: ${{ runner.os }}-astro-${{ hashFiles('**/*.astro', 'astro.config.mjs') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-
|
${{ runner.os }}-astro-
|
||||||
${{ runner.os }}-astro-cache-
|
|
||||||
|
|
||||||
- name: Lint Code
|
- name: Lint Code
|
||||||
run: bun run lint
|
run: bun run lint
|
||||||
|
|||||||
@@ -31,12 +31,11 @@ jobs:
|
|||||||
uses: actions/cache@v5
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules/.cache
|
.astro
|
||||||
.astro/cache
|
node_modules/.vite
|
||||||
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-${{ github.sha }}
|
key: ${{ runner.os }}-astro-${{ hashFiles('**/*.astro', 'astro.config.mjs') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-
|
${{ runner.os }}-astro-
|
||||||
${{ runner.os }}-astro-cache-
|
|
||||||
|
|
||||||
- name: Lint Code
|
- name: Lint Code
|
||||||
run: bun run lint
|
run: bun run lint
|
||||||
|
|||||||
@@ -33,12 +33,11 @@ jobs:
|
|||||||
uses: actions/cache@v5
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules/.cache
|
.astro
|
||||||
.astro/cache
|
node_modules/.vite
|
||||||
key: ${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-${{ github.sha }}
|
key: ${{ runner.os }}-astro-${{ hashFiles('**/*.astro', 'astro.config.mjs') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-astro-cache-${{ hashFiles('**/bun.lockb') }}-
|
${{ runner.os }}-astro-
|
||||||
${{ runner.os }}-astro-cache-
|
|
||||||
|
|
||||||
- name: Lint Code
|
- name: Lint Code
|
||||||
run: bun run lint
|
run: bun run lint
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ WORKDIR /app
|
|||||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||||
COPY --from=build /app/dist /app/dist
|
COPY --from=build /app/dist /app/dist
|
||||||
|
|
||||||
LABEL version="3.1.0"
|
LABEL version="3.6.0"
|
||||||
LABEL description="Astro based personal website"
|
LABEL description="Astro based personal website"
|
||||||
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
import node from '@astrojs/node';
|
import node from '@astrojs/node';
|
||||||
import partytown from '@astrojs/partytown';
|
|
||||||
import react from '@astrojs/react';
|
import react from '@astrojs/react';
|
||||||
import sitemap from '@astrojs/sitemap';
|
import sitemap from '@astrojs/sitemap';
|
||||||
|
|
||||||
@@ -14,6 +13,8 @@ import { getSiteURL } from './src/support/url';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: getSiteURL(),
|
site: getSiteURL(),
|
||||||
|
|
||||||
|
security: { csp: true },
|
||||||
|
|
||||||
image: {
|
image: {
|
||||||
remotePatterns: [
|
remotePatterns: [
|
||||||
{ protocol: 'https', hostname: '*.alexlebens.net' },
|
{ protocol: 'https', hostname: '*.alexlebens.net' },
|
||||||
@@ -28,7 +29,6 @@ export default defineConfig({
|
|||||||
prefetch: true,
|
prefetch: true,
|
||||||
|
|
||||||
integrations: [
|
integrations: [
|
||||||
partytown(),
|
|
||||||
react(),
|
react(),
|
||||||
sitemap(),
|
sitemap(),
|
||||||
icon({
|
icon({
|
||||||
|
|||||||
14
bun.lock
14
bun.lock
@@ -7,7 +7,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.9.7",
|
"@astrojs/check": "^0.9.7",
|
||||||
"@astrojs/node": "^10.0.0",
|
"@astrojs/node": "^10.0.0",
|
||||||
"@astrojs/partytown": "^2.1.5",
|
|
||||||
"@astrojs/react": "^5.0.0",
|
"@astrojs/react": "^5.0.0",
|
||||||
"@astrojs/rss": "^4.0.17",
|
"@astrojs/rss": "^4.0.17",
|
||||||
"@astrojs/sitemap": "^3.7.1",
|
"@astrojs/sitemap": "^3.7.1",
|
||||||
@@ -24,7 +23,8 @@
|
|||||||
"@types/unist": "^3.0.3",
|
"@types/unist": "^3.0.3",
|
||||||
"astro": "^6.0.2",
|
"astro": "^6.0.2",
|
||||||
"astro-icon": "^1.1.5",
|
"astro-icon": "^1.1.5",
|
||||||
"markdown-it": "14.1.1",
|
"dayjs": "^1.11.20",
|
||||||
|
"markdown-it": "^14.1.1",
|
||||||
"marked": "^17.0.4",
|
"marked": "^17.0.4",
|
||||||
"marked-shiki": "^1.2.1",
|
"marked-shiki": "^1.2.1",
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
"@eslint-react/eslint-plugin": "^2.13.0",
|
"@eslint-react/eslint-plugin": "^2.13.0",
|
||||||
"@tailwindcss/forms": "^0.5.11",
|
"@tailwindcss/forms": "^0.5.11",
|
||||||
"@tailwindcss/typography": "^0.5.19",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"@types/markdown-it": "14.1.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"eslint": "^10.0.3",
|
"eslint": "^10.0.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-astro": "^1.6.0",
|
"eslint-plugin-astro": "^1.6.0",
|
||||||
@@ -79,8 +79,6 @@
|
|||||||
|
|
||||||
"@astrojs/node": ["@astrojs/node@10.0.0", "", { "dependencies": { "@astrojs/internal-helpers": "0.8.0", "send": "1.2.1", "server-destroy": "1.0.1" }, "peerDependencies": { "astro": "6.0.2" } }, "sha512-MYz73s+U1CxdSLoYlbB9lrgA2ryi6K8ULH2rM3SBQDFbWtXuTFiBAfG8c5BHy75tsSRn2p0rc7jdFiQAzuZOyw=="],
|
"@astrojs/node": ["@astrojs/node@10.0.0", "", { "dependencies": { "@astrojs/internal-helpers": "0.8.0", "send": "1.2.1", "server-destroy": "1.0.1" }, "peerDependencies": { "astro": "6.0.2" } }, "sha512-MYz73s+U1CxdSLoYlbB9lrgA2ryi6K8ULH2rM3SBQDFbWtXuTFiBAfG8c5BHy75tsSRn2p0rc7jdFiQAzuZOyw=="],
|
||||||
|
|
||||||
"@astrojs/partytown": ["@astrojs/partytown@2.1.5", "", { "dependencies": { "@qwik.dev/partytown": "0.11.2", "mrmime": "2.0.1" } }, "sha512-Uo2Uqmvjh/5w08wGoVAspdj14hUoE28uQH8SkzaBMw9bTBNIviEkPi3VkJi+tj1ZYAY9oX7OSkRDJ48QRtMhlw=="],
|
|
||||||
|
|
||||||
"@astrojs/prism": ["@astrojs/prism@4.0.0", "", { "dependencies": { "prismjs": "1.30.0" } }, "sha512-NndtNPpxaGinRpRytljGBvYHpTOwHycSZ/c+lQi5cHvkqqrHKWdkPEhImlODBNmbuB+vyQUNUDXyjzt66CihJg=="],
|
"@astrojs/prism": ["@astrojs/prism@4.0.0", "", { "dependencies": { "prismjs": "1.30.0" } }, "sha512-NndtNPpxaGinRpRytljGBvYHpTOwHycSZ/c+lQi5cHvkqqrHKWdkPEhImlODBNmbuB+vyQUNUDXyjzt66CihJg=="],
|
||||||
|
|
||||||
"@astrojs/react": ["@astrojs/react@5.0.0", "", { "dependencies": { "@astrojs/internal-helpers": "0.8.0", "@vitejs/plugin-react": "5.1.4", "devalue": "5.6.3", "ultrahtml": "1.6.0", "vite": "7.3.1" }, "peerDependencies": { "@types/react": "19.2.14", "@types/react-dom": "19.1.7", "react": "19.2.4", "react-dom": "19.2.4" } }, "sha512-OuM+0QFsoPkvv8ZB57kVLxKOqvR+84GR/Em9lh/tAL4fV4CnpBPDxc++0vd1CipH4o99Is7GribuTHFy3doF6g=="],
|
"@astrojs/react": ["@astrojs/react@5.0.0", "", { "dependencies": { "@astrojs/internal-helpers": "0.8.0", "@vitejs/plugin-react": "5.1.4", "devalue": "5.6.3", "ultrahtml": "1.6.0", "vite": "7.3.1" }, "peerDependencies": { "@types/react": "19.2.14", "@types/react-dom": "19.1.7", "react": "19.2.4", "react-dom": "19.2.4" } }, "sha512-OuM+0QFsoPkvv8ZB57kVLxKOqvR+84GR/Em9lh/tAL4fV4CnpBPDxc++0vd1CipH4o99Is7GribuTHFy3doF6g=="],
|
||||||
@@ -557,8 +555,6 @@
|
|||||||
|
|
||||||
"@playform/pipe": ["@playform/pipe@0.1.4", "", { "dependencies": { "@types/node": "25.0.3", "deepmerge-ts": "7.1.5", "fast-glob": "3.3.3" } }, "sha512-SM3iJ5VHA61NsYMrtvk8DAZwkrpPtBCiJnfWjj1iX6Ke/hnHLqVjTmkXG087UMOa9Z+3J/zUoAkzf3Al6tiS8A=="],
|
"@playform/pipe": ["@playform/pipe@0.1.4", "", { "dependencies": { "@types/node": "25.0.3", "deepmerge-ts": "7.1.5", "fast-glob": "3.3.3" } }, "sha512-SM3iJ5VHA61NsYMrtvk8DAZwkrpPtBCiJnfWjj1iX6Ke/hnHLqVjTmkXG087UMOa9Z+3J/zUoAkzf3Al6tiS8A=="],
|
||||||
|
|
||||||
"@qwik.dev/partytown": ["@qwik.dev/partytown@0.11.2", "", { "dependencies": { "dotenv": "16.6.1" }, "bin": { "partytown": "bin/partytown.cjs" } }, "sha512-795y49CqBiKiwKAD+QBZlzlqEK275hVcazZ7wBPSfgC23L+vWuA7PJmMpgxojOucZHzYi5rAAQ+IP1I3BKVZxw=="],
|
|
||||||
|
|
||||||
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.3", "", {}, "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q=="],
|
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.3", "", {}, "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q=="],
|
||||||
|
|
||||||
"@rollup/plugin-alias": ["@rollup/plugin-alias@3.1.9", "", { "dependencies": { "slash": "3.0.0" }, "peerDependencies": { "rollup": "2.80.0" } }, "sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw=="],
|
"@rollup/plugin-alias": ["@rollup/plugin-alias@3.1.9", "", { "dependencies": { "slash": "3.0.0" }, "peerDependencies": { "rollup": "2.80.0" } }, "sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw=="],
|
||||||
@@ -1039,6 +1035,8 @@
|
|||||||
|
|
||||||
"datatables.net-dt": ["datatables.net-dt@2.3.7", "", { "dependencies": { "datatables.net": "2.3.7", "jquery": "4.0.0" } }, "sha512-OXXIliY5MXnI+284Gt73F+fEdnW2u5y9jiptlvjDDb3YlyqXU4E/YZUB262a068sM/+qakb6RixN1SWn18uF2g=="],
|
"datatables.net-dt": ["datatables.net-dt@2.3.7", "", { "dependencies": { "datatables.net": "2.3.7", "jquery": "4.0.0" } }, "sha512-OXXIliY5MXnI+284Gt73F+fEdnW2u5y9jiptlvjDDb3YlyqXU4E/YZUB262a068sM/+qakb6RixN1SWn18uF2g=="],
|
||||||
|
|
||||||
|
"dayjs": ["dayjs@1.11.20", "", {}, "sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ=="],
|
||||||
|
|
||||||
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||||
|
|
||||||
"decode-bmp": ["decode-bmp@0.2.1", "", { "dependencies": { "@canvas/image-data": "1.1.0", "to-data-view": "1.1.0" } }, "sha512-NiOaGe+GN0KJqi2STf24hfMkFitDUaIoUU3eKvP/wAbLe8o6FuW5n/x7MHPR0HKvBokp6MQY/j7w8lewEeVCIA=="],
|
"decode-bmp": ["decode-bmp@0.2.1", "", { "dependencies": { "@canvas/image-data": "1.1.0", "to-data-view": "1.1.0" } }, "sha512-NiOaGe+GN0KJqi2STf24hfMkFitDUaIoUU3eKvP/wAbLe8o6FuW5n/x7MHPR0HKvBokp6MQY/j7w8lewEeVCIA=="],
|
||||||
@@ -1093,8 +1091,6 @@
|
|||||||
|
|
||||||
"dot-case": ["dot-case@3.0.4", "", { "dependencies": { "no-case": "3.0.4", "tslib": "2.8.1" } }, "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w=="],
|
"dot-case": ["dot-case@3.0.4", "", { "dependencies": { "no-case": "3.0.4", "tslib": "2.8.1" } }, "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w=="],
|
||||||
|
|
||||||
"dotenv": ["dotenv@16.6.1", "", {}, "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow=="],
|
|
||||||
|
|
||||||
"dropzone": ["dropzone@6.0.0-beta.2", "", { "dependencies": { "@swc/helpers": "0.2.14", "just-extend": "5.1.1" } }, "sha512-k44yLuFFhRk53M8zP71FaaNzJYIzr99SKmpbO/oZKNslDjNXQsBTdfLs+iONd0U0L94zzlFzRnFdqbLcs7h9fQ=="],
|
"dropzone": ["dropzone@6.0.0-beta.2", "", { "dependencies": { "@swc/helpers": "0.2.14", "just-extend": "5.1.1" } }, "sha512-k44yLuFFhRk53M8zP71FaaNzJYIzr99SKmpbO/oZKNslDjNXQsBTdfLs+iONd0U0L94zzlFzRnFdqbLcs7h9fQ=="],
|
||||||
|
|
||||||
"dset": ["dset@3.1.4", "", {}, "sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA=="],
|
"dset": ["dset@3.1.4", "", {}, "sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA=="],
|
||||||
|
|||||||
102
package.json
102
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "site-profile",
|
"name": "site-profile",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "3.0.0",
|
"version": "3.6.0",
|
||||||
"homepage": "https://www.alexlebens.dev",
|
"homepage": "https://www.alexlebens.dev",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
||||||
@@ -27,57 +27,57 @@
|
|||||||
"lint:fix": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\""
|
"lint:fix": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "0.9.7",
|
"@astrojs/check": "^0.9.7",
|
||||||
"@astrojs/node": "10.0.0",
|
"@astrojs/node": "^10.0.0",
|
||||||
"@astrojs/partytown": "2.1.5",
|
"@astrojs/react": "^5.0.0",
|
||||||
"@astrojs/react": "5.0.0",
|
"@astrojs/rss": "^4.0.17",
|
||||||
"@astrojs/rss": "4.0.17",
|
"@astrojs/sitemap": "^3.7.1",
|
||||||
"@astrojs/sitemap": "3.7.1",
|
"@directus/sdk": "^21.2.0",
|
||||||
"@directus/sdk": "21.2.0",
|
"@giscus/react": "^3.1.0",
|
||||||
"@giscus/react": "3.1.0",
|
"@iconify-json/mdi": "^1.2.3",
|
||||||
"@iconify-json/mdi": "1.2.3",
|
"@iconify-json/pajamas": "^1.2.15",
|
||||||
"@iconify-json/pajamas": "1.2.15",
|
"@iconify-json/simple-icons": "^1.2.73",
|
||||||
"@iconify-json/simple-icons": "1.2.73",
|
"@playform/compress": "^0.2.1",
|
||||||
"@playform/compress": "0.2.1",
|
"@swup/astro": "^1.8.0",
|
||||||
"@swup/astro": "1.8.0",
|
"@tailwindcss/postcss": "^4.2.1",
|
||||||
"@tailwindcss/postcss": "4.2.1",
|
"@tailwindcss/vite": "^4.2.1",
|
||||||
"@tailwindcss/vite": "4.2.1",
|
"@types/react": "^19.2.14",
|
||||||
"@types/react": "19.2.14",
|
"@types/unist": "^3.0.3",
|
||||||
"@types/unist": "3.0.3",
|
"astro": "^6.0.2",
|
||||||
"astro": "6.0.2",
|
"astro-icon": "^1.1.5",
|
||||||
"astro-icon": "1.1.5",
|
"dayjs": "^1.11.20",
|
||||||
"markdown-it": "14.1.1",
|
"markdown-it": "^14.1.1",
|
||||||
"marked": "17.0.4",
|
"marked": "^17.0.4",
|
||||||
"marked-shiki": "1.2.1",
|
"marked-shiki": "^1.2.1",
|
||||||
"mdast-util-to-string": "4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"photoswipe": "5.4.4",
|
"photoswipe": "^5.4.4",
|
||||||
"preline": "4.1.2",
|
"preline": "^4.1.2",
|
||||||
"react": "19.2.4",
|
"react": "^19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "^19.2.4",
|
||||||
"reading-time": "1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
"sharp": "0.34.5",
|
"sharp": "^0.34.5",
|
||||||
"sharp-ico": "0.1.5",
|
"sharp-ico": "^0.1.5",
|
||||||
"shiki": "4.0.2",
|
"shiki": "^4.0.2",
|
||||||
"tailwindcss": "4.2.1",
|
"tailwindcss": "^4.2.1",
|
||||||
"ultrahtml": "1.6.0"
|
"ultrahtml": "^1.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint-react/eslint-plugin": "2.13.0",
|
"@eslint-react/eslint-plugin": "^2.13.0",
|
||||||
"@tailwindcss/forms": "0.5.11",
|
"@tailwindcss/forms": "^0.5.11",
|
||||||
"@tailwindcss/typography": "0.5.19",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"@types/markdown-it": "14.1.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"eslint": "10.0.3",
|
"eslint": "^10.0.3",
|
||||||
"eslint-config-prettier": "10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-astro": "1.6.0",
|
"eslint-plugin-astro": "^1.6.0",
|
||||||
"eslint-plugin-format": "2.0.1",
|
"eslint-plugin-format": "^2.0.1",
|
||||||
"eslint-plugin-react": "7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-plugin-react-hooks": "7.0.1",
|
"eslint-plugin-react-hooks": "^7.0.1",
|
||||||
"eslint-plugin-react-refresh": "0.5.2",
|
"eslint-plugin-react-refresh": "^0.5.2",
|
||||||
"prettier": "3.8.1",
|
"prettier": "^3.8.1",
|
||||||
"prettier-plugin-astro": "0.14.1",
|
"prettier-plugin-astro": "^0.14.1",
|
||||||
"prettier-plugin-tailwindcss": "0.7.2",
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||||
"timeago.js": "4.0.2",
|
"timeago.js": "^4.0.2",
|
||||||
"typescript": "5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "8.57.0"
|
"typescript-eslint": "^8.57.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
User-agent: *
|
|
||||||
Allow: /
|
|
||||||
|
|
||||||
Sitemap: https://www.alexlebens.dev/sitemap-index.xml
|
|
||||||
@@ -55,7 +55,7 @@ const { slug, title, description, logoLight, logoDark, count, publishDate } = As
|
|||||||
</svg>
|
</svg>
|
||||||
{count}
|
{count}
|
||||||
</span>
|
</span>
|
||||||
<span class="inline-flex items-center">
|
<div class="inline-flex items-center">
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
width="16"
|
width="16"
|
||||||
@@ -68,8 +68,10 @@ const { slug, title, description, logoLight, logoDark, count, publishDate } = As
|
|||||||
<circle cx="12" cy="12" r="10"></circle>
|
<circle cx="12" cy="12" r="10"></circle>
|
||||||
<polyline points="12 6 12 12 16 14"></polyline>
|
<polyline points="12 6 12 12 16 14"></polyline>
|
||||||
</svg>
|
</svg>
|
||||||
{publishDate}
|
<span>
|
||||||
</span>
|
{publishDate}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const { dayName, label, icon, temp } = Astro.props;
|
|||||||
---
|
---
|
||||||
|
|
||||||
<div class="smooth-reveal-2 group flex flex-col">
|
<div class="smooth-reveal-2 group flex flex-col">
|
||||||
<div class="card-base w-40">
|
<div class="card-base w-32 sm:w-40">
|
||||||
<div class="p-5 text-center">
|
<div class="p-5 text-center">
|
||||||
<span class="card-text-description block font-bold text-xs uppercase tracking-widest">
|
<span class="card-text-description block font-bold text-xs uppercase tracking-widest">
|
||||||
{dayName}
|
{dayName}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import type { Post } from '@lib/directusTypes';
|
|||||||
import CategoryCard from '@components/cards/CategoryCard.astro';
|
import CategoryCard from '@components/cards/CategoryCard.astro';
|
||||||
import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro';
|
import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro';
|
||||||
import directus from '@lib/directus';
|
import directus from '@lib/directus';
|
||||||
import { timeago } from '@support/time';
|
import { formatFromNow } from '@support/time';
|
||||||
|
|
||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ const categories = (await directus.request(readItems('categories')))
|
|||||||
logoLight={category.logoLight}
|
logoLight={category.logoLight}
|
||||||
logoDark={category.logoDark}
|
logoDark={category.logoDark}
|
||||||
count={postMap.get(category.slug)?.length ?? 0}
|
count={postMap.get(category.slug)?.length ?? 0}
|
||||||
publishDate={timeago(postMap.get(category.slug)?.[0]?.published_date)}
|
publishDate={formatFromNow(postMap.get(category.slug)?.[0]?.published_date)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -106,7 +106,7 @@ const categories = (await directus.request(readItems('categories')))
|
|||||||
logoLight={global.all_logoLight}
|
logoLight={global.all_logoLight}
|
||||||
logoDark={global.all_logoDark}
|
logoDark={global.all_logoDark}
|
||||||
count={posts.length}
|
count={posts.length}
|
||||||
publishDate={timeago(posts[0]?.published_date)}
|
publishDate={formatFromNow(posts[0]?.published_date)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,34 +1,13 @@
|
|||||||
import { format, register } from 'timeago.js';
|
import dayjs from 'dayjs';
|
||||||
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
|
|
||||||
const TimeAgoConfiguration: string[][] = [
|
dayjs.extend(relativeTime);
|
||||||
['today', 'today'],
|
|
||||||
['%s seconds ago', 'in %s seconds'],
|
|
||||||
['1 minute ago', 'in 1 minute'],
|
|
||||||
['%s minutes ago', 'in %s minutes'],
|
|
||||||
['1 hour ago', 'in 1 hour'],
|
|
||||||
['%s hours ago', 'in %s hours'],
|
|
||||||
['1 day ago', 'in 1 day'],
|
|
||||||
['%s days ago', 'in %s days'],
|
|
||||||
['1 week ago', 'in 1 week'],
|
|
||||||
['%s weeks ago', 'in %s weeks'],
|
|
||||||
['1 month ago', 'in 1 month'],
|
|
||||||
['%s months ago', 'in %s months'],
|
|
||||||
['1 year ago', 'in 1 year'],
|
|
||||||
['%s years ago', 'in %s years'],
|
|
||||||
];
|
|
||||||
|
|
||||||
function timeago(date?: Date): string {
|
function formatFromNow(date: Date | null): string {
|
||||||
if (!date) {
|
if (!date) {
|
||||||
return 'today';
|
return 'none';
|
||||||
}
|
}
|
||||||
|
return dayjs(date).fromNow()
|
||||||
const localeFunc = (number: number, index: number, _?: number): [string, string] => {
|
|
||||||
return TimeAgoConfiguration[index] as [string, string];
|
|
||||||
};
|
|
||||||
|
|
||||||
register('timeago', localeFunc);
|
|
||||||
|
|
||||||
return format(date, 'timeago');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDate(date: Date): string {
|
function formatDate(date: Date): string {
|
||||||
@@ -46,4 +25,4 @@ function formatShortDate(date: Date): string {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export { formatDate, formatShortDate, timeago };
|
export { formatFromNow, formatDate, formatShortDate, };
|
||||||
|
|||||||
Reference in New Issue
Block a user