Skip to content

Fix: generate the docs in the CI instead of a index.html to avoid double redirect#336

Merged
Mossaka merged 1 commit into
mainfrom
mossaka/docs-fix
Oct 3, 2025
Merged

Fix: generate the docs in the CI instead of a index.html to avoid double redirect#336
Mossaka merged 1 commit into
mainfrom
mossaka/docs-fix

Conversation

@Mossaka

@Mossaka Mossaka commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

No description provided.

…ble redirect

Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
@Mossaka Mossaka requested a review from Copilot October 3, 2025 22:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the documentation build process to generate the root redirect page dynamically in CI rather than storing it as a static file, preventing potential double redirects in the local development environment.

Key changes:

  • Remove static docs/index.html redirect file
  • Generate redirect page inline during CI build process
  • Add documentation explaining local vs production URL structure differences

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
docs/index.html Removes static redirect HTML file that was causing local development issues
.github/workflows/docs.yml Replaces file copy with inline HTML generation for the root redirect page
.github/instructions/docs.instructions.md Adds clarification about URL structure differences between local and production environments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +100 to +141
cat > public/wassette/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=latest/">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting to Wassette Documentation</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f5f5f5;
}
.message {
text-align: center;
padding: 2rem;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
a {
color: #4183c4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="message">
<h1>Redirecting to Wassette Documentation</h1>
<p>If you are not redirected automatically, <a href="latest/">click here</a>.</p>
</div>
</body>
</html>
EOF

Copilot AI Oct 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using heredoc syntax in CI scripts can be fragile and difficult to maintain. Consider creating a template file or using a dedicated build script that can be version controlled and tested separately.

Suggested change
cat > public/wassette/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=latest/">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting to Wassette Documentation</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f5f5f5;
}
.message {
text-align: center;
padding: 2rem;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
a {
color: #4183c4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="message">
<h1>Redirecting to Wassette Documentation</h1>
<p>If you are not redirected automatically, <a href="latest/">click here</a>.</p>
</div>
</body>
</html>
EOF
cp docs/gh-pages-root-index.html public/wassette/index.html

Copilot uses AI. Check for mistakes.
Comment on lines +100 to +141
cat > public/wassette/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=latest/">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting to Wassette Documentation</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f5f5f5;
}
.message {
text-align: center;
padding: 2rem;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
a {
color: #4183c4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="message">
<h1>Redirecting to Wassette Documentation</h1>
<p>If you are not redirected automatically, <a href="latest/">click here</a>.</p>
</div>
</body>
</html>
EOF

Copilot AI Oct 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This large inline HTML block makes the workflow file difficult to read and maintain. Consider moving the HTML content to a separate template file that can be processed during the build, which would also allow for easier testing and validation of the HTML.

Copilot uses AI. Check for mistakes.
@Mossaka Mossaka merged commit 859b49b into main Oct 3, 2025
17 checks passed
@Mossaka Mossaka deleted the mossaka/docs-fix branch October 3, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants