Skip to content

Commit 31ea403

Browse files
committed
Fix GitHub Pages
1 parent 537937b commit 31ea403

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727

2828
- name: Build website
2929
run: yarn build
30+
env:
31+
ROOT_PATH: "/${{ github.event.repository.name }}/"
3032

3133
- uses: actions/upload-pages-artifact@v3
3234
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ plugins: [
9696
[
9797
"./plugins/docusaurus-search-duckdb",
9898
{
99-
routeBasePath: "search", // 検索ページのパス
99+
routeBasePath: "/search", // 検索ページのパス
100100
docsJsonPath: "docs.json", // ドキュメントJSONファイルのパス
101101
enableDebugMode: true, // SQLデバッグ機能の有効/無効
102102
},

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sidebar_position: 1
1111

1212
- **目的**: DuckDB WASM検索機能のデモンストレーション
1313
- **内容**: 架空のプロジェクトドキュメント
14-
- **検索**: ナビゲーションの検索ボックスまたは [/search](/search/) ページをご利用ください
14+
- **検索**: ナビゲーションの検索ボックスまたは [/search](../search/) ページをご利用ください
1515

1616
## サンプルドキュメント
1717

@@ -24,4 +24,4 @@ sidebar_position: 1
2424
- 「Supabase」「security.txt」などの技術用語
2525
- 「マラソン」「スター」など一般用語
2626

27-
ナビゲーションバーの検索ボックスに入力するか、専用の検索ページ [/search](/search/) をご利用ください。
27+
ナビゲーションバーの検索ボックスに入力するか、専用の検索ページ [/search](../search/) をご利用ください。

docusaurus.config.js

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

7-
const baseUrl = process.env.PREVIEW_PATH || "/";
7+
const baseUrl = process.env.ROOT_PATH || "/";
88

99
/** @type {import('@docusaurus/types').Config} */
1010
const config = {
@@ -55,7 +55,7 @@ const config = {
5555
[
5656
"./plugins/docusaurus-search-duckdb",
5757
{
58-
routeBasePath: "search",
58+
routeBasePath: baseUrl + "search",
5959
docsJsonPath: "docs.json",
6060
enableDebugMode: true,
6161
},

plugins/docusaurus-search-duckdb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
[
2626
'./plugins/docusaurus-search-duckdb',
2727
{
28-
routeBasePath: 'search',
28+
routeBasePath: '/search',
2929
docsJsonPath: 'docs.json',
3030
enableDebugMode: true,
3131
},
@@ -38,7 +38,7 @@ module.exports = {
3838

3939
| オプション || デフォルト | 説明 |
4040
|------------|-----|-----------|-----|
41-
| `routeBasePath` | `string` | `'search'` | 検索ページのベースパス |
41+
| `routeBasePath` | `string` | `'/search'` | 検索ページのベースパス |
4242
| `docsJsonPath` | `string` | `'docs.json'` | ドキュメントJSONファイルのパス |
4343
| `enableDebugMode` | `boolean` | `true` | SQLデバッグインターフェースを有効にする |
4444

plugins/docusaurus-search-duckdb/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require("path");
22

33
function pluginDuckDBSearch(context, options = {}) {
44
const {
5-
routeBasePath = "search",
5+
routeBasePath = "/search",
66
docsJsonPath = "docs.json",
77
enableDebugMode = true,
88
} = options;
@@ -18,7 +18,7 @@ function pluginDuckDBSearch(context, options = {}) {
1818
const { addRoute } = actions;
1919

2020
addRoute({
21-
path: `/${routeBasePath}`,
21+
path: routeBasePath,
2222
component: path.resolve(__dirname, "./src/theme/SearchPage/index.tsx"),
2323
exact: true,
2424
});

plugins/docusaurus-search-duckdb/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function pluginDuckDBSearch(
1313
options: PluginOptions,
1414
): Plugin<void> {
1515
const {
16-
routeBasePath = "search",
16+
routeBasePath = "/search",
1717
docsJsonPath = "docs.json",
1818
enableDebugMode = true,
1919
} = options;
@@ -33,7 +33,7 @@ export default function pluginDuckDBSearch(
3333
const { addRoute } = actions;
3434

3535
addRoute({
36-
path: `/${routeBasePath}`,
36+
path: routeBasePath,
3737
component: "@theme/SearchPage",
3838
exact: true,
3939
});

plugins/docusaurus-search-duckdb/src/validateOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { PluginOptions } from "./index";
22

33
const DEFAULT_OPTIONS: Required<PluginOptions> = {
44
id: "default",
5-
routeBasePath: "search",
5+
routeBasePath: "/search",
66
docsJsonPath: "docs.json",
77
enableDebugMode: true,
88
};

0 commit comments

Comments
 (0)