Skip to content

Commit b8df627

Browse files
committed
fix: use fork when determining URLs
1 parent ab5352c commit b8df627

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/build-gh-pages.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
env:
3434
GITHUB_ORIGIN: ${{ steps.configure.outputs.origin }}
3535
GITHUB_BASE: ${{ steps.configure.outputs.base_path }}
36+
GITHUB_REPOSITORY: ${{ github.repository }}
3637
run: |
3738
yarn
3839
yarn build

docusaurus.config.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
const lightCodeTheme = require("prism-react-renderer/themes/github");
55
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
66

7+
let githubOrganization = "mbta";
8+
let githubProject = "schemas";
9+
if (process.env.GITHUB_REPOSITORY) {
10+
[githubOrganization, githubProject] =
11+
process.env.GITHUB_REPOSITORY.split("/");
12+
}
13+
714
/** @type {import('@docusaurus/types').Config} */
815
const config = {
916
title: "MBTA Event Schemas",
@@ -17,9 +24,8 @@ const config = {
1724
baseUrl: process.env.GITHUB_BASE || "/",
1825

1926
// GitHub pages deployment config.
20-
// If you aren't using GitHub pages, you don't need these.
21-
organizationName: "mbta", // Usually your GitHub org/user name.
22-
projectName: "schemas", // Usually your repo name.
27+
organizationName: githubOrganization,
28+
projectName: githubProject, // Usually your repo name.
2329

2430
onBrokenLinks: "throw",
2531
onBrokenMarkdownLinks: "warn",
@@ -43,7 +49,7 @@ const config = {
4349
sidebarCollapsed: false,
4450
// Please change this to your repo.
4551
// Remove this to remove the "edit this page" links.
46-
editUrl: "https://github.com/mbta/schemas/tree/main/",
52+
editUrl: `https://github.com/${githubOrganization}/${githubProject}/tree/main/`,
4753
},
4854
blog: false,
4955
theme: {
@@ -74,7 +80,7 @@ const config = {
7480
label: "Events",
7581
},
7682
{
77-
href: "https://github.com/mbta/schemas",
83+
href: `https://github.com/${githubOrganization}/${githubProject}`,
7884
label: "GitHub",
7985
position: "right",
8086
},
@@ -97,7 +103,7 @@ const config = {
97103
items: [
98104
{
99105
label: "GitHub",
100-
href: "https://github.com/mbta/schemas",
106+
href: `https://github.com/${githubOrganization}/${githubProject}`,
101107
},
102108
],
103109
},

0 commit comments

Comments
 (0)