Skip to content

Commit bfd738e

Browse files
Configure custom domain deployment at webcompass.ai/WebCompass
1 parent 0561e7d commit bfd738e

6 files changed

Lines changed: 25 additions & 22 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Next.js site to GitHub Pages
1+
name: Deploy Next.js site to GitHub Pages
22

33
on:
44
push:
@@ -38,6 +38,9 @@ jobs:
3838
- name: Build static export
3939
run: npm run build
4040

41+
- name: Ensure custom domain CNAME
42+
run: echo "webcompass.ai" > out/CNAME
43+
4144
- name: Upload artifact
4245
uses: actions/upload-pages-artifact@v3
4346
with:
@@ -52,4 +55,4 @@ jobs:
5255
steps:
5356
- name: Deploy to GitHub Pages
5457
id: deployment
55-
uses: actions/deploy-pages@v4
58+
uses: actions/deploy-pages@v4

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Academic project page for **WebCompass: A Unified Multimodal Benchmark and Evalu
44

55
Production deployment target:
66

7-
- GitHub Pages project site
8-
- URL: `https://huayuankou9-arch.github.io/WebCompass/`
7+
- GitHub Pages (custom domain + project subpath)
8+
- URL: `https://webcompass.ai/WebCompass/`
99
- Base path: `/WebCompass`
1010

1111
## Tech Stack
@@ -48,7 +48,7 @@ Deployment is automated by GitHub Actions:
4848
4. Deploy with `actions/deploy-pages`
4949

5050
After each push, the site updates at:
51-
`https://huayuankou9-arch.github.io/WebCompass/`
51+
`https://webcompass.ai/WebCompass/`
5252

5353
## Figure-Source Consistency (LaTeX whitelist)
5454

@@ -85,3 +85,4 @@ Frontend/
8585
scripts/
8686
styles/
8787
```
88+

app/layout.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Metadata } from "next";
1+
import type { Metadata } from "next";
22
import { IBM_Plex_Sans, JetBrains_Mono } from "next/font/google";
33

44
import "./globals.css";
@@ -15,21 +15,20 @@ const jetbrainsMono = JetBrains_Mono({
1515
variable: "--font-mono"
1616
});
1717

18-
const [ownerFromEnv, repoFromEnv] = (process.env.GITHUB_REPOSITORY || "huayuankou9-arch/WebCompass").split("/");
19-
const owner = ownerFromEnv || "huayuankou9-arch";
20-
const repo = repoFromEnv || "WebCompass";
21-
const productionUrl = `https://${owner}.github.io/${repo}/`;
18+
const productionOrigin = "https://webcompass.ai";
19+
const productionPath = "/WebCompass/";
20+
const productionUrl = `${productionOrigin}${productionPath}`;
2221
const siteUrl = process.env.NODE_ENV === "production" ? productionUrl : "http://localhost:3000/";
23-
const ogImagePath = "og-image.svg";
24-
const faviconPath = "favicon.svg";
22+
const ogImagePath = "/WebCompass/og-image.svg";
23+
const faviconPath = "/WebCompass/favicon.svg";
2524

2625
export const metadata: Metadata = {
2726
title: "WebCompass | A Unified Multimodal Benchmark for Web Coding",
2827
description:
2928
"WebCompass: A unified multimodal benchmark and evaluation framework for web coding across generation, editing, and repair.",
30-
metadataBase: new URL(siteUrl),
29+
metadataBase: new URL(process.env.NODE_ENV === "production" ? productionOrigin : "http://localhost:3000"),
3130
alternates: {
32-
canonical: siteUrl
31+
canonical: process.env.NODE_ENV === "production" ? productionPath : "/"
3332
},
3433
openGraph: {
3534
title: "WebCompass",

lib/base-path.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const repo = process.env.NEXT_PUBLIC_REPO_NAME || "WebCompass";
1+
const productionBasePath = "/WebCompass";
2+
const isProduction = process.env.NODE_ENV === "production";
23

3-
export const basePath = process.env.NODE_ENV === "production" ? `/${repo}` : "";
4+
export const basePath = isProduction ? productionBasePath : "";
45

56
export function withBasePath(path: string) {
67
if (!path.startsWith("/")) return `${basePath}/${path}`;
78
if (!basePath) return path;
89
if (path.startsWith(`${basePath}/`) || path === basePath) return path;
910
return `${basePath}${path}`;
1011
}
11-

next.config.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
/** @type {import('next').NextConfig} */
2-
const repository = process.env.GITHUB_REPOSITORY?.split("/")[1] || "WebCompass";
1+
/** @type {import('next').NextConfig} */
32
const isProduction = process.env.NODE_ENV === "production";
4-
const basePath = isProduction ? `/${repository}` : "";
3+
const basePath = isProduction ? "/WebCompass" : "";
54

65
const nextConfig = {
76
output: "export",
87
trailingSlash: true,
98
basePath,
10-
assetPrefix: basePath || undefined,
9+
assetPrefix: isProduction ? "/WebCompass" : undefined,
1110
images: {
1211
unoptimized: true
1312
}
1413
};
1514

16-
module.exports = nextConfig;
15+
module.exports = nextConfig;

public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
webcompass.ai

0 commit comments

Comments
 (0)