Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
07e59cb
remvoe /docs
Its-Just-Nans Aug 15, 2025
e12ebf5
chore: move static assets to the root directory
3w36zj6 Aug 17, 2025
9dfee3d
chore: update routing and asset paths
3w36zj6 Aug 17, 2025
cdc91d8
feat: update top page links to use base path
3w36zj6 Aug 17, 2025
5dc4331
fix: pagefind
Its-Just-Nans Aug 17, 2025
74a235f
fix dev server
Its-Just-Nans Aug 17, 2025
5223385
fix: plugins
Its-Just-Nans Aug 17, 2025
703a8f2
biome check
Its-Just-Nans Aug 17, 2025
bf34eb6
fix: dev server
Its-Just-Nans Aug 17, 2025
bf80d65
fix path
Its-Just-Nans Aug 17, 2025
4da6855
fix: remove sitemap link element
3w36zj6 Aug 17, 2025
fe8a458
fix: correction
Its-Just-Nans Aug 17, 2025
8cfbd55
chore: update vite version to ^7.1.2
3w36zj6 Aug 18, 2025
0ee8660
chore: update @hono/vite-dev-server version to ^0.20.1
3w36zj6 Aug 18, 2025
d7400e9
chore: inject Vite client script manually
3w36zj6 Aug 18, 2025
a8e3fda
Merge remote-tracking branch 'origin/main' into wip
3w36zj6 Aug 18, 2025
b22498a
chore: update path for generated documentation
3w36zj6 Aug 18, 2025
2485093
chore: add `public/assets` directory to `.gitignore`
3w36zj6 Aug 19, 2025
07bd631
feat: add path utility
3w36zj6 Aug 19, 2025
704e28a
refactor: replace string concatenation with path utility for URL cons…
3w36zj6 Aug 19, 2025
3b5f7b8
docs: add TSDoc to metadata
3w36zj6 Aug 19, 2025
27edd12
feat: add route validation
3w36zj6 Aug 19, 2025
e6b04b8
refactor: move global styles to CSS file
3w36zj6 Aug 19, 2025
4ff9368
fix: update Typst official URL handling in base template
3w36zj6 Aug 19, 2025
f783b24
refactor: add utility to remove base path
3w36zj6 Aug 19, 2025
24cb495
fix message
Its-Just-Nans Aug 20, 2025
3284b85
symlink docs.json
Its-Just-Nans Aug 20, 2025
ead1093
disable PagefinUi on dev
Its-Just-Nans Aug 20, 2025
9e544a4
biome :)
Its-Just-Nans Aug 20, 2025
cc243b8
I missed an update of mise
Its-Just-Nans Aug 20, 2025
31d439e
Update website/src/components/templates/BaseTemplate.tsx
3w36zj6 Aug 20, 2025
6e32f4e
Update website/src/metadata.ts
3w36zj6 Aug 20, 2025
e83c3e0
Update website/src/metadata.ts
3w36zj6 Aug 20, 2025
5f4fe0c
refactor: remove hardcoded path
3w36zj6 Aug 22, 2025
770d3ab
style: apply Biome
3w36zj6 Aug 22, 2025
1a12902
fix: update base path type to enforce leading and trailing slash
3w36zj6 Aug 22, 2025
acc2fce
fix: allow root path in base path type
3w36zj6 Aug 22, 2025
24d7eea
fix: add official documentation base URL type
3w36zj6 Aug 22, 2025
89b8576
fix: handle joining of paths when the first part is a `http(s)://` URL
3w36zj6 Aug 22, 2025
c3d3002
style: apply Biome
3w36zj6 Aug 22, 2025
23aa109
Merge remote-tracking branch 'origin/main' into remove-docs-url
3w36zj6 Aug 22, 2025
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
2 changes: 1 addition & 1 deletion website/src/components/templates/BaseTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
rel="icon"
type="image/png"
sizes="32x32"
href="/assets/favicon.png"
href={`${basePath.replace(/\/$/, "")}/favicon.png`}
/>
<link
rel="preload"
Expand Down
21 changes: 15 additions & 6 deletions website/src/components/ui/common/SearchWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ import { CloseIcon } from "../../icons";
export const SearchWindow: FC = () => {
return (
<div class="flex flex-col max-h-[80vh]">
<link
href={`${basePath.replace(/\/$/, "")}/pagefind/pagefind-ui.css`}
rel="stylesheet"
/>
<script src={`${basePath.replace(/\/$/, "")}/pagefind/pagefind-ui.js`} />
{import.meta.env.PROD && (
<>
<link
href={`${basePath.replace(/\/$/, "")}/pagefind/pagefind-ui.css`}
rel="stylesheet"
/>
<script
src={`${basePath.replace(/\/$/, "")}/pagefind/pagefind-ui.js`}
/>
</>
)}
<div class="flex justify-between items-center p-4 border-b border-gray-200 flex-shrink-0">
<h2 class="text-lg font-semibold">検索</h2>
<h2 class="text-lg font-semibold">
検索
{import.meta.env.DEV && <span> - Search disabled on DEV</span>}
</h2>
<button
type="button"
class="text-gray-400 hover:text-gray-600"
Expand Down
20 changes: 18 additions & 2 deletions website/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { serveStatic } from "@hono/node-server/serve-static";
import { Hono } from "hono";
import { appendTrailingSlash, trimTrailingSlash } from "hono/trailing-slash";
import {
Expand All @@ -24,7 +25,7 @@ const [flattenedPages, pagePaths] = flattenDocs(docs);
const allRoutes = flattenedPages.map((page) => page.route);
registerRoutes(allRoutes);

const app = new Hono();
const app = new Hono().basePath(import.meta.env.DEV ? "/docs" : "/");
app.use(appendTrailingSlash());
app.use(trimTrailingSlash());

Expand All @@ -47,7 +48,7 @@ flattenedPages.forEach((page, pageIndex) => {

// Remove basePath from the route if it starts with basePath.
let route = page.route;
if (import.meta.env.PROD && route.startsWith(basePath)) {
if (route.startsWith(basePath)) {
route = route.slice(basePath.length - (basePath.endsWith("/") ? 1 : 0));
}
app.get(route, (c) => {
Expand All @@ -74,4 +75,19 @@ flattenedPages.forEach((page, pageIndex) => {
});
});

if (import.meta.env.DEV) {
app.use(
"*",
serveStatic({
root: "./public",
rewriteRequestPath: (path) => {
return path.slice(basePath.length);
},
onNotFound: (path, c) => {
console.log(`${path} is not found, request to ${c.req.path}`);
},
}),
);
}

export default app;