Skip to content

Commit bdbdebd

Browse files
committedMar 2, 2025
adding custom domain
1 parent c13341e commit bdbdebd

File tree

7 files changed

+17
-13
lines changed

7 files changed

+17
-13
lines changed
 

‎CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
chirp.hex.dance

‎deploy.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ cat > dist/404.html << EOL
5858
<meta charset="utf-8">
5959
<title>Chirp - Redirecting</title>
6060
<script>
61-
window.location.href = "/chirp/";
61+
window.location.href = "/";
6262
</script>
6363
</head>
6464
<body>
@@ -76,5 +76,5 @@ if [ $? -ne 0 ]; then
7676
exit 1
7777
fi
7878

79-
echo "Deployment complete! Your site should be available at https://solst-ice.github.io/chirp"
79+
echo "Deployment complete! Your site should be available at https://chirp.hex.dance"
8080
echo "Note: It may take a few minutes for GitHub Pages to update."

‎index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
// Handle GitHub Pages path issues
1010
(function() {
1111
const { pathname } = window.location;
12-
if (pathname.includes('/chirp') && !pathname.endsWith('/')) {
12+
// For custom domain, we just need to ensure the path ends with a slash
13+
if (pathname !== '/' && !pathname.endsWith('/')) {
1314
const hasQuery = window.location.search.length > 0;
1415
window.history.replaceState(
1516
{},
1617
'',
17-
`/chirp/${hasQuery ? window.location.search : ''}`
18+
`${pathname}/${hasQuery ? window.location.search : ''}`
1819
);
1920
}
2021
})();

‎package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc --noEmit && vite build --base=/chirp/",
9-
"preview": "vite preview --base=/chirp/",
8+
"build": "tsc --noEmit && vite build",
9+
"preview": "vite preview",
1010
"predeploy": "npm run build",
11-
"deploy": "gh-pages -d dist"
11+
"deploy": "gh-pages -d dist",
12+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
1213
},
1314
"dependencies": {
1415
"react": "^18.2.0",
@@ -22,5 +23,5 @@
2223
"typescript": "^5.0.2",
2324
"vite": "^4.4.5"
2425
},
25-
"homepage": "https://solst-ice.github.io/chirp"
26+
"homepage": "https://chirp.hex.dance"
2627
}

‎public/CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
chirp.hex.dance

‎vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { resolve } from 'path'
55
// https://vitejs.dev/config/
66
export default defineConfig({
77
plugins: [react()],
8-
base: '/chirp/',
8+
base: '/',
99
build: {
1010
outDir: 'dist',
1111
assetsDir: 'assets',

‎vite.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
3-
import path from 'path'
3+
import { resolve } from 'path'
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
77
plugins: [react()],
88
resolve: {
99
alias: {
10-
'@': path.resolve(__dirname, './src'),
10+
'@': resolve(__dirname, './src'),
1111
},
1212
},
13-
base: '/chirp/', // Set base path to repository name for GitHub Pages
13+
base: '/', // Updated for custom domain (was '/chirp/' for GitHub Pages)
1414
// Ensure we're using the correct entry point
1515
build: {
1616
rollupOptions: {
1717
input: {
18-
main: path.resolve(__dirname, 'index.html'),
18+
main: resolve(__dirname, 'index.html'),
1919
},
2020
},
2121
outDir: 'dist',

0 commit comments

Comments
 (0)
Please sign in to comment.