Skip to content

Commit

Permalink
deploy to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Henderson committed Oct 26, 2023
1 parent 45a7b52 commit 85832ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "smoothstep",
"homepage": "/smoothstep",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="theme-color" content="#282a36" />
<script type="text/javascript" src="CCapture.all.min.js"></script>
<title>smoothstep</title>
</head>
Expand Down
33 changes: 18 additions & 15 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import { Link, RouterProvider, createBrowserRouter } from 'react-router-dom';

import Hypocycloids from './animations/hypocycloids';
import './index.css';
Expand All @@ -20,28 +20,31 @@ const AnimationList = () => {
<ul className="list-inside list-disc pt-2 ">
{animations.map((animation) => (
<li key={animation.name}>
<a href={`/${animation.name}`} className="text-pink hover:text-pink-200 hover:underline">
<Link to={`/${animation.name}`} className="text-pink hover:text-pink-200 hover:underline">
{animation.name}
</a>
</Link>
</li>
))}
</ul>
</div>
);
};

const router = createBrowserRouter([
{
path: '/',
element: <AnimationList />,
},
...animations.map((animation) => {
return {
path: `/${animation.name}`,
element: <animation.component />,
};
}),
]);
const router = createBrowserRouter(
[
{
path: '/',
element: <AnimationList />,
},
...animations.map((animation) => {
return {
path: `/${animation.name}`,
element: <animation.component />,
};
}),
],
{ basename: '/smoothstep' },
);

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down

0 comments on commit 85832ff

Please sign in to comment.