Skip to content

Commit 79e6b24

Browse files
Fix local server previewing and add automatic redirect to documentation
1 parent 20fcd47 commit 79e6b24

File tree

53 files changed

+516
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+516
-1
lines changed

.github/workflows/pages.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ jobs:
3434
swift build
3535
chmod +x ./scripts/build-docs.sh
3636
./scripts/build-docs.sh
37+
38+
# Create a root index.html to redirect to the docs
39+
cat > docs/index.html << 'EOF'
40+
<!DOCTYPE html>
41+
<html>
42+
<head>
43+
<meta charset="UTF-8">
44+
<meta http-equiv="refresh" content="0; url=documentation/registryapi/">
45+
<title>Redirecting to API Documentation</title>
46+
</head>
47+
<body>
48+
<p>If you are not redirected automatically, <a href="documentation/registryapi/">click here</a>.</p>
49+
</body>
50+
</html>
51+
EOF
3752
3853
- name: Setup Pages
3954
uses: actions/configure-pages@v5

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,15 @@ The latest documentation is automatically deployed to GitHub Pages and can be vi
8888

8989
You can serve the documentation locally using one of these methods:
9090

91-
#### Using the helper script:
91+
#### Using the local preview script (recommended):
92+
93+
```bash
94+
./scripts/local-preview.sh
95+
```
96+
97+
This script creates the necessary directory structure for local testing and handles the redirects properly. This is the most reliable way to preview the documentation exactly as it will appear on GitHub Pages.
98+
99+
#### Using the server script:
92100

93101
```bash
94102
./scripts/serve-docs.sh

docs-local/OpenAPI-Integration-with-DocC/css/866.2d08a543.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-local/OpenAPI-Integration-with-DocC/css/989.4f123103.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-local/OpenAPI-Integration-with-DocC/css/documentation-topic.da0b1931.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-local/OpenAPI-Integration-with-DocC/css/index.3a335429.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-local/OpenAPI-Integration-with-DocC/css/topic.4be8f56d.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-local/OpenAPI-Integration-with-DocC/css/tutorials-overview.adb17623.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sections":[],"schemaVersion":{"patch":0,"major":0,"minor":3},"kind":"article","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/com.example.RegistryAPI\/documentation\/RegistryAPI"},"primaryContentSections":[{"content":[{"anchor":"Overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"text":"This documentation provides details about the Swift Package Registry API endpoints and schemas, generated from the OpenAPI specification.","type":"text"}]}],"kind":"content"}],"abstract":[{"type":"text","text":"Swift Package Registry API documentation."}],"metadata":{"title":"RegistryAPI","role":"collection"},"hierarchy":{"paths":[[]]}}
12.3 KB
Loading

0 commit comments

Comments
 (0)