diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07e8a4f4c309ea5a043fce27ee9661a910690582..847219c2d66b3f00ed625155fc13a8d82ef53b41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,8 @@ before_script: build: stage: build + variables: + BASE_URL: "/git-cheat/" script: # Construire le site avec Vite (le bundler par défaut pour SolidJS) - yarn build-static diff --git a/README.md b/README.md index c88fb2c70bde2d36ba33ded38f03d890f0ca2fdf..49e8f98bdb6aae125f07fb803d58783985dab0e0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Small Git cheat sheet for french students. +[https://bramas.pages.unistra.fr/git-cheat](https://bramas.pages.unistra.fr/git-cheat) + ## Building diff --git a/app.config.ts b/app.config.ts index f95ed13f7db3a203408db64314a6c729978e89c6..5e742613bc97d2cff5c780a2c883bcaa13fe5369 100644 --- a/app.config.ts +++ b/app.config.ts @@ -4,9 +4,9 @@ export default defineConfig({ ssr: true, server: { prerender: { - crawlLinks: true + crawlLinks: true, }, - baseURL: "/git-cheat/", + baseURL: process.env.BASE_URL || "/", preset: 'gitlab-pages', }, }); \ No newline at end of file diff --git a/package.json b/package.json index 28aea69e485eb8c94227bbdad0fbbd61cae193df..e8d2491fbbfd123e3afd7b420d06c84e7890fe12 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "dev": "vinxi dev", "build": "vinxi build", "start": "vinxi start", - "version": "vinxi version", - "build-static": "vinxi build --preset static --base=/git-cheat/" + "version": "vinxi version" }, "dependencies": { "@solidjs/meta": "^0.29.4", diff --git a/public/favicon.ico b/public/favicon.ico index fb282da0719ef6ab4c1732df93be6216b0d85520..8312a3f17e450c3edd8ab31074e5f4d027c7042a 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/app.css b/src/app.css index e56868d177395414ea45f98dde5298bce872742c..4f39245e2fc9c0cb926e20540b9250607f4f5119 100644 --- a/src/app.css +++ b/src/app.css @@ -18,7 +18,7 @@ h1 { font-size: 3rem; font-weight: 100; line-height: 1.1; - margin: 4rem auto; + margin: 1rem auto 2rem auto; max-width: 14rem; } diff --git a/src/app.tsx b/src/app.tsx index 0afe80d95765b3febd08afab310b1eb9227eb62b..159237021473df9cba768bb05de559870c7014e9 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,22 +1,21 @@ import { MetaProvider, Title } from "@solidjs/meta"; -import { Router } from "@solidjs/router"; +import { StaticRouter, A } from "@solidjs/router"; import { FileRoutes } from "@solidjs/start/router"; import { Suspense } from "solid-js"; import "./app.css"; export default function App() { return ( - <Router + <StaticRouter + base={process.env.BASE_URL || import.meta.env.BASE_URL || "/"} root={props => ( <MetaProvider> <Title>Aide-mémoire Git</Title> - <a href="/">Index</a> - <a href="/about">About</a> <Suspense>{props.children}</Suspense> </MetaProvider> )} > <FileRoutes /> - </Router> + </StaticRouter> ); } diff --git a/src/entry-server.tsx b/src/entry-server.tsx index 401eff83fdf7f3946fa0c87164bce7bad1ca62f9..164b3bb67ec703b071e5373c0e4dfc7de21b1db2 100644 --- a/src/entry-server.tsx +++ b/src/entry-server.tsx @@ -8,7 +8,7 @@ export default createHandler(() => ( <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="icon" href="/favicon.ico" /> + <link rel="icon" href="./favicon.ico" /> {assets} </head> <body>