Skip to content

Commit 8baf987

Browse files
committed
fix base url
1 parent 20d59d3 commit 8baf987

File tree

4 files changed

+69
-3
lines changed

4 files changed

+69
-3
lines changed

docusaurus.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import type * as Preset from "@docusaurus/preset-classic";
22
import type { Config } from "@docusaurus/types";
33
import { themes as prismThemes } from "prism-react-renderer";
44

5-
const baseUrl = process.env.DOCUSAURUS_BASE_URL ?? "/";
6-
75
const LATEST_DEVVIT_VERSION = "0.12"; // update-versioned-docs.mjs sets this automatically
86

97
const config: Config = {
@@ -14,7 +12,7 @@ const config: Config = {
1412
title: "Reddit for Developers",
1513
tagline: "An app for anything",
1614
url: "https://developers.reddit.com",
17-
baseUrl,
15+
baseUrl: "/docs-staging/",
1816
onBrokenLinks: "warn",
1917
onBrokenMarkdownLinks: "warn",
2018
favicon: "/img/devvit_icon.png",

scripts/build-api-docs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd "$(dirname "$0")/.."
5+
echo "Building Devvit API docs..."
6+
7+
typedoc \
8+
--plugin typedoc-plugin-markdown \
9+
--entryPoints '../packages/public-api/src/index.ts' \
10+
--exclude "../packages/public-api/src/apis/reddit/**/*.ts" \
11+
--tsconfig '../packages/public-api/tsconfig.json' \
12+
--hideBreadcrumbs \
13+
--disableSources \
14+
--useHTMLAnchors \
15+
--includeVersion \
16+
--excludePrivate \
17+
--excludeExternals \
18+
--excludeInternal \
19+
--readme none \
20+
--out './docs/api/public-api'

scripts/build-reddit-api-docs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd "$(dirname "$0")/.."
5+
echo "Building Reddit API docs..."
6+
7+
typedoc \
8+
--plugin typedoc-plugin-markdown \
9+
--entryPoints '../packages/public-api/src/apis/reddit/RedditAPIClient.ts' \
10+
--entryPoints '../packages/public-api/src/apis/reddit/models' \
11+
--tsconfig '../packages/public-api/tsconfig.json' \
12+
--hideBreadcrumbs \
13+
--disableSources \
14+
--includeVersion \
15+
--excludePrivate \
16+
--useHTMLAnchors \
17+
--excludeExternals \
18+
--excludeInternal \
19+
--readme none \
20+
--out './docs/api/redditapi'

scripts/verify-docs.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
set -xeuo pipefail
3+
4+
R='\033[0;31m' #'0;31' is Red's ANSI color code
5+
G='\033[0;32m' #'0;32' is Green's ANSI color code
6+
RESET='\033[0m'
7+
8+
# Run generation script
9+
echo "Generating API docs...";
10+
yarn gen:api-docs && yarn gen:reddit-api-docs
11+
echo "Linting API docs...";
12+
# Only format markdown files tracked by git (excludes submodules)
13+
# Explicitly exclude docs/spec/headers.md as it is a generated file that is not formatted correctly by prettier
14+
git ls-files '*.md' ':!/docs/spec/headers.md' | xargs npx prettier --write
15+
16+
# Check for unstaged changes
17+
if [ -n "$(git status --porcelain)" ]; then
18+
git status
19+
git diff
20+
21+
# Give stdout a little time to handle all the output from git diff before printing the helpful suggestion
22+
sleep 2;
23+
24+
echo -e "${R}The docs generation script (yarn docs:gen) resulted in unstaged changes. Please run 'devvit-docs/scripts/verify-docs.sh' and commit the generated docs.${RESET}";
25+
exit 1
26+
else
27+
echo -e "${G}Workspace clean ${RESET}";
28+
fi

0 commit comments

Comments
 (0)