diff options
| author | William Hergès <william@herges.fr> | 2025-10-03 17:21:29 +0200 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2025-10-03 17:21:29 +0200 |
| commit | 270f592fc65cd5553ccf7c0dc81431c3efdf67ab (patch) | |
| tree | 4c1c53f3c40b6324201dda10a8c30c7438fcbde7 | |
| parent | ed216fcfbd19d97f35292ceb9af77aab989446b0 (diff) | |
feat(frontend): bundle htmx and set every external link to target blank
| -rw-r--r-- | backend/templates/base.html | 3 | ||||
| -rw-r--r-- | bun.lock | 3 | ||||
| -rw-r--r-- | frontend/scss/home.scss | 2 | ||||
| -rw-r--r-- | index.ts | 7 | ||||
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | tsconfig.json | 4 |
6 files changed, 15 insertions, 5 deletions
diff --git a/backend/templates/base.html b/backend/templates/base.html index 8466bc0..68d3f8d 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -39,7 +39,8 @@ <footer> <p>© 2025 - Anhgelus Morthuuzh</p> <p>« {{ .Quote }} »</p> - <p><a href="/legal">Mentions légales</a>, <a href="https://git.anhgelus.world/anhgelus/small-web">Code source</a>.</p> + <p><a href="/legal">Mentions légales</a>, <a href="https://git.anhgelus.world/anhgelus/small-web">code source</a>.</p> </footer> +<script src="{{ assets "index.js" }}" defer></script> </body> </html> @@ -4,6 +4,7 @@ "": { "name": "small-web", "dependencies": { + "htmx.org": "2.0.7", "reset-css": "^5.0.2", "sass": "^1.93.2", "scss": "^0.2.4", @@ -63,6 +64,8 @@ "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + "htmx.org": ["htmx.org@2.0.7", "", {}, "sha512-YiJqF3U5KyO28VC5mPfehKJPF+n1Gni+cupK+D69TF0nm7wY6AXn3a4mPWIikfAXtl1u1F1+ZhSCS7KT8pVmqA=="], + "immutable": ["immutable@5.1.3", "", {}, "sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg=="], "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], diff --git a/frontend/scss/home.scss b/frontend/scss/home.scss index 29a0116..0b85b2b 100644 --- a/frontend/scss/home.scss +++ b/frontend/scss/home.scss @@ -23,7 +23,7 @@ article article { align-content: center; gap: var(--margin-base); - @media only screen and (max-width: 350px) { + @media only screen and (max-width: 400px) { display: flex; flex-direction: column-reverse; } @@ -1 +1,6 @@ -console.log("Hello via Bun!");
\ No newline at end of file +import 'htmx.org'; + +document.querySelectorAll("a").forEach(e => { + if (e.href.startsWith(window.location.origin)) return; + e.target = "_blank"; +}); diff --git a/package.json b/package.json index 1cf5eb4..543b5bf 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "typescript": "^5" }, "dependencies": { + "htmx.org": "2.0.7", "reset-css": "^5.0.2", "sass": "^1.93.2", "scss": "^0.2.4" diff --git a/tsconfig.json b/tsconfig.json index bfa0fea..56d55cc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { // Environment setup & latest features - "lib": ["ESNext"], - "target": "ESNext", + "lib": ["ESNext", "DOM"], + "target": "ES2018", "module": "Preserve", "moduleDetection": "force", "jsx": "react-jsx", |
