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
1 change: 1 addition & 0 deletions pages/public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open-codereview.ai
7 changes: 4 additions & 3 deletions pages/src/components/HeroSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useCallback, useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Link } from 'react-router-dom';
import { useTranslation } from '../i18n';
import { useResponsive } from '../hooks/useResponsive';
import ColorBends from './ColorBends';
Expand Down Expand Up @@ -313,8 +314,8 @@ const HeroSection: React.FC = () => {
>
{t('hero.quickStart')}
</a>
<a
href="#/docs"
<Link
to="/docs"
style={{
height: 32,
display: 'flex',
Expand All @@ -330,7 +331,7 @@ const HeroSection: React.FC = () => {
}}
>
{t('hero.learnMore')}
</a>
</Link>
</div>

{/* Terminal */}
Expand Down
6 changes: 3 additions & 3 deletions pages/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 { HashRouter } from 'react-router-dom';
import { BrowserRouter } from 'react-router-dom';
import App from './App';
import { LanguageProvider } from './i18n';
import './styles/index.css';
Expand All @@ -16,9 +16,9 @@ const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
<LanguageProvider>
<HashRouter>
<BrowserRouter>
<App />
</HashRouter>
</BrowserRouter>
</LanguageProvider>
</React.StrictMode>
);
9 changes: 8 additions & 1 deletion pages/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: process.env.NODE_ENV === 'production' ? '/open-code-review/' : '/'
publicPath: '/'
},
module: {
rules: [
Expand Down Expand Up @@ -65,6 +65,13 @@ module.exports = {
template: './index.html',
inject: 'body'
}),
// SPA fallback: serve the app shell for deep links / refreshes on client-side
// routes (BrowserRouter). GitHub Pages returns this for unknown paths.
new HtmlWebpackPlugin({
template: './index.html',
inject: 'body',
filename: '404.html'
}),
new CopyPlugin({
patterns: [
{ from: 'public', to: '.', noErrorOnMissing: true }
Expand Down
Loading