7777 - name : Process schema documentation and prepare for Jekyll
7878 run : |
7979 echo "🔄 Processing documentation files..."
80- chmod +x .github/scripts/docs/process-docs.sh
81- .github/scripts/docs/process-docs.sh
80+ cd site-src
81+ chmod +x ../.github/scripts/docs/process-docs.sh
82+ ../.github/scripts/docs/process-docs.sh
83+ cd ..
8284
8385 - name : Fix documentation links
8486 run : |
98100 echo "🔨 Building Jekyll site..."
99101 cd site-src
100102 bundle install
101- JEKYLL_ENV=production bundle exec jekyll build --verbose -- destination ../_site
103+ JEKYLL_ENV=production bundle exec jekyll build --destination ../_site
102104 cd ..
103105
104106 # Fix capitalization issues
@@ -108,7 +110,7 @@ jobs:
108110 cp "_site/INDEX.html" "_site/index.html"
109111 fi
110112
111- # Fix unconverted markdown files
113+ # Fix unconverted markdown files - with proper paths
112114 echo "🔧 Handling unconverted markdown files..."
113115 for md_file in $(find _site -name "*.md"); do
114116 html_file="${md_file%.md}.html"
@@ -117,17 +119,43 @@ jobs:
117119
118120 echo " Converting $md_file to HTML..."
119121
120- # Create a minimal HTML version of the markdown file
121- echo "<html><head><title>$base_name</title>" > "$html_file"
122- echo "<meta http-equiv=\"refresh\" content=\"0; url='$base_name'\">" >> "$html_file"
123- echo "</head><body>" >> "$html_file"
124- echo "<h1>$base_name</h1>" >> "$html_file"
125- echo "<p>This page should redirect automatically. If not, <a href=\"$base_name\">click here</a>.</p>" >> "$html_file"
126- echo "</body></html>" >> "$html_file"
122+ # Create a minimal HTML version of the markdown file that uses the baseurl
123+ cat > "$html_file" << EOF
124+ <html>
125+ <head>
126+ <title>$base_name</title>
127+ <meta http-equiv="refresh" content="0; url='/forms-engine-plugin$dir_name/$base_name/'">
128+ </head>
129+ <body>
130+ <h1>$base_name</h1>
131+ <p>Redirecting to <a href="/forms-engine-plugin$dir_name/$base_name/">/forms-engine-plugin$dir_name/$base_name/</a></p>
132+ </body>
133+ </html>
134+ EOF
135+
136+ # Create directory and index.html for pretty URLs
137+ mkdir -p "_site$dir_name/$base_name"
138+
139+ # Create an index.html in the subdirectory with the actual content
140+ cat > "_site$dir_name/$base_name/index.html" << EOF
141+ <html>
142+ <head>
143+ <title>$base_name</title>
144+ <link rel="stylesheet" href="/forms-engine-plugin/assets/css/just-the-docs-default.css">
145+ </head>
146+ <body>
147+ <div class="main-content">
148+ <h1>$base_name</h1>
149+ <div class="content">
150+ $(cat "$md_file" | sed 's|](/|](/forms-engine-plugin/|g')
151+ </div>
152+ </div>
153+ </body>
154+ </html>
155+ EOF
127156
128- # Create index.html in a directory with the same name for proper paths
129- mkdir -p "$dir_name/$base_name"
130- cp "$html_file" "$dir_name/$base_name/index.html"
157+ # Remove the original markdown file
158+ rm "$md_file"
131159 done
132160
133161 # Ensure lowercase 'index' directory exists for assets
@@ -185,4 +213,15 @@ jobs:
185213 id : deployment
186214 uses : actions/deploy-pages@v4
187215 with :
188- timeout : 600000 # 10 minutes in milliseconds
216+ timeout : 600000 # 10 minutes in milliseconds
217+
218+ run : |
219+ echo "🔧 Verifying Jekyll baseurl configuration..."
220+ if ! grep -q "baseurl: \"/forms-engine-plugin\"" site-src/_config.yml; then
221+ sed -i.bak 's|baseurl: ""|baseurl: "/forms-engine-plugin"|g' site-src/_config.yml
222+ sed -i.bak 's|baseurl: "/"|baseurl: "/forms-engine-plugin"|g' site-src/_config.yml
223+ rm -f site-src/_config.yml.bak
224+ echo "✅ Updated baseurl in _config.yml"
225+ else
226+ echo "✅ baseurl already correctly configured"
227+ fi
0 commit comments