Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RamaLama</title>
<link rel="icon" href="./assets/ramalama-favicon-x-i7PUts.svg" />
<script type="module" crossorigin src="./assets/index-CMs8QfDb.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DS9OvM91.css">
<script type="module" crossorigin src="./assets/index-C68Jeup1.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BWgz0inV.css">
</head>
<body>
<div id="root"></div>
Expand Down
53 changes: 53 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"postbuild": "cp -R public/docs dist/docs",
"lint": "eslint .",
"preview": "vite preview",
"predeploy": "npm run build",
Expand All @@ -27,6 +28,7 @@
"eslint-plugin-react-refresh": "^0.4.24",
"gh-pages": "^6.3.0",
"globals": "^16.4.0",
"sirv": "^3.0.2",
"vite": "^7.1.12"
}
}
Empty file added public/docs/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions src/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const Navbar = () => {
<li>
<a href="#about">About</a>
</li>
<li>
<a href="/docs/introduction">Docs</a>
</li>
<li>
<a href="#presentations">Presentations</a>
</li>
Expand Down
34 changes: 32 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import sirv from 'sirv'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const docsDir = resolve(__dirname, 'public/docs')

const serveDocsPlugin = () => ({
name: 'serve-public-docs',
configureServer(server) {
const serve = sirv(docsDir, { dev: true })

server.middlewares.use((req, res, next) => {
const url = req.url
if (!url || !url.startsWith('/docs')) {
return next()
}

const parsedUrl = new URL(url, 'http://localhost')
const strippedPath = parsedUrl.pathname.slice('/docs'.length) || '/'
req.url = `${strippedPath}${parsedUrl.search}`

serve(req, res, (err) => {
req.url = url
next(err)
})
})
},
})

export default defineConfig({
plugins: [react()],
plugins: [react(), serveDocsPlugin()],
homepage: "https://github.com/containers/ramalama.github.io",
base: '',
})
})