diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 7772ceb..4dc2549 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -1,8 +1,5 @@ module.exports = { - plugins: [ - require.resolve("prettier-plugin-astro"), - require.resolve("prettier-plugin-tailwindcss"), - ], + plugins: [require.resolve("prettier-plugin-astro")], overrides: [ { files: "*.astro", diff --git a/astro.config.ts b/astro.config.ts index f973049..15e081c 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -1,6 +1,5 @@ import { defineConfig } from "astro/config"; -// https://astro.build/config import tailwind from "@astrojs/tailwind"; // https://astro.build/config @@ -12,6 +11,9 @@ import sitemap from "@astrojs/sitemap"; // https://astro.build/config import compress from "astro-compress"; +// https://astro.build/config +import preact from "@astrojs/preact"; + // https://astro.build/config import prefetch from "@astrojs/prefetch"; import robotsTxt from "astro-robots-txt"; @@ -21,6 +23,8 @@ import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); +// https://astro.build/config + // https://astro.build/config export default defineConfig({ site: "https://xhyrom.dev/", @@ -43,6 +47,7 @@ export default defineConfig({ sitemap: true, }), minify(), + preact(), ], vite: { resolve: { diff --git a/package.json b/package.json index 635b52f..e580e25 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@astrojs/image": "^0.16.9", + "@astrojs/preact": "^2.2.1", "@astrojs/prefetch": "^0.2.3", "@astrojs/sitemap": "^1.3.3", "@astrojs/tailwind": "^3.1.3", @@ -23,6 +24,7 @@ "astro-tooltips": "^0.6.2", "fireworks-js": "^2.10.5", "html-minifier": "^4.0.0", + "preact": "^10.15.1", "tailwindcss": "^3.3.2" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77aacaa..c6b91b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,9 @@ dependencies: '@astrojs/image': specifier: ^0.16.9 version: 0.16.9(astro@2.5.7) + '@astrojs/preact': + specifier: ^2.2.1 + version: 2.2.1(preact@10.15.1) '@astrojs/prefetch': specifier: ^0.2.3 version: 0.2.3 @@ -42,6 +45,9 @@ dependencies: html-minifier: specifier: ^4.0.0 version: 4.0.0 + preact: + specifier: ^10.15.1 + version: 10.15.1 tailwindcss: specifier: ^3.3.2 version: 3.3.2 @@ -142,6 +148,22 @@ packages: - supports-color dev: false + /@astrojs/preact@2.2.1(preact@10.15.1): + resolution: {integrity: sha512-lObgrX/qfK2sEnGDWoyQ8KojFJ54FIKB4TeywWmgj4ZTg0yLnvvOz6ReyPQ8VfR/1MU+vWs22jE4cuZJ/vPnOA==} + engines: {node: '>=16.12.0'} + peerDependencies: + preact: ^10.6.5 + dependencies: + '@babel/core': 7.22.1 + '@babel/plugin-transform-react-jsx': 7.22.3(@babel/core@7.22.1) + '@preact/signals': 1.1.3(preact@10.15.1) + babel-plugin-module-resolver: 5.0.0 + preact: 10.15.1 + preact-render-to-string: 5.2.6(preact@10.15.1) + transitivePeerDependencies: + - supports-color + dev: false + /@astrojs/prefetch@0.2.3: resolution: {integrity: sha512-r51t4fkGcePA6FHFVDD5vC/whhoKWFSaKNug/4Z2FSKZZga9yjb2qDcrul7u32nVDN+30ywZ/RQAmBMrHOmLiw==} dependencies: @@ -723,6 +745,19 @@ packages: resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} dev: false + /@preact/signals-core@1.3.0: + resolution: {integrity: sha512-M+M3ZOtd1dtV/uasyk4SZu1vbfEJ4NeENv0F7F12nijZYedB5wSgbtZcuACyssnTznhF4ctUyrR0dZHuHfyWKA==} + dev: false + + /@preact/signals@1.1.3(preact@10.15.1): + resolution: {integrity: sha512-N09DuAVvc90bBZVRwD+aFhtGyHAmJLhS3IFoawO/bYJRcil4k83nBOchpCEoS0s5+BXBpahgp0Mjf+IOqP57Og==} + peerDependencies: + preact: 10.x + dependencies: + '@preact/signals-core': 1.3.0 + preact: 10.15.1 + dev: false + /@proload/core@0.3.3: resolution: {integrity: sha512-7dAFWsIK84C90AMl24+N/ProHKm4iw0akcnoKjRvbfHifJZBLhaDsDus1QJmhG12lXj4e/uB/8mB/0aduCW+NQ==} dependencies: @@ -1093,6 +1128,17 @@ packages: postcss-value-parser: 4.2.0 dev: false + /babel-plugin-module-resolver@5.0.0: + resolution: {integrity: sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==} + engines: {node: '>= 16'} + dependencies: + find-babel-config: 2.0.0 + glob: 8.1.0 + pkg-up: 3.1.0 + reselect: 4.1.8 + resolve: 1.22.2 + dev: false + /bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} dev: false @@ -1161,6 +1207,12 @@ packages: concat-map: 0.0.1 dev: false + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: false + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -1855,6 +1907,21 @@ packages: dependencies: to-regex-range: 5.0.1 + /find-babel-config@2.0.0: + resolution: {integrity: sha512-dOKT7jvF3hGzlW60Gc3ONox/0rRZ/tz7WCil0bqA1In/3I8f1BctpXahRnEKDySZqci7u+dqq93sZST9fOJpFw==} + engines: {node: '>=16.0.0'} + dependencies: + json5: 2.2.3 + path-exists: 4.0.0 + dev: false + + /find-up@3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: false + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -1958,6 +2025,17 @@ packages: path-is-absolute: 1.0.1 dev: false + /glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: false + /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -2337,6 +2415,14 @@ packages: strip-bom: 3.0.0 dev: false + /locate-path@3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: false + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -2838,6 +2924,13 @@ packages: brace-expansion: 1.1.11 dev: false + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: false + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: false @@ -3022,6 +3115,13 @@ packages: yocto-queue: 1.0.0 dev: false + /p-locate@3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: false + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -3073,6 +3173,11 @@ packages: tslib: 2.5.2 dev: false + /path-exists@3.0.0: + resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + engines: {node: '>=4'} + dev: false + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -3128,6 +3233,13 @@ packages: find-up: 4.1.0 dev: false + /pkg-up@3.1.0: + resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} + engines: {node: '>=8'} + dependencies: + find-up: 3.0.0 + dev: false + /postcss-import@15.1.0(postcss@8.4.24): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} @@ -3206,6 +3318,19 @@ packages: source-map-js: 1.0.2 dev: false + /preact-render-to-string@5.2.6(preact@10.15.1): + resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.15.1 + pretty-format: 3.8.0 + dev: false + + /preact@10.15.1: + resolution: {integrity: sha512-qs2ansoQEwzNiV5eAcRT1p1EC/dmEzaATVDJNiB3g2sRDWdA7b7MurXdJjB2+/WQktGWZwxvDrnuRFbWuIr64g==} + dev: false + /prebuild-install@7.1.1: resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} engines: {node: '>=10'} @@ -3313,6 +3438,10 @@ packages: engines: {node: '>=10.13.0'} hasBin: true + /pretty-format@3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + dev: false + /prismjs@1.29.0: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'} @@ -3456,6 +3585,10 @@ packages: unist-util-visit: 4.1.2 dev: false + /reselect@4.1.8: + resolution: {integrity: sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==} + dev: false + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} diff --git a/src/components/widgets/Navbar.astro b/src/components/widgets/Navbar.astro index ab91347..3394b95 100644 --- a/src/components/widgets/Navbar.astro +++ b/src/components/widgets/Navbar.astro @@ -30,12 +30,12 @@ const navItems = [ xHyroM