Skip to content

Commit 27c6126

Browse files
committed
fix(docs): implement comprehensive Jekyll debugging and theme fixes
- Add extensive build tracing and HTML structure validation - Switch from remote_theme to local theme for better CI compatibility - Add layout defaults for all pages and API documentation - Create API index page with proper navigation structure - Update all API HTML files with layout: default frontmatter - Add GitHub API-based deployment verification - Add live site validation with curl testing - Create debug workflow for manual troubleshooting
1 parent 5a6d2b1 commit 27c6126

28 files changed

Lines changed: 267 additions & 65 deletions

.github/workflows/debug-docs.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Debug Documentation Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
debug_level:
7+
description: 'Debug level (1-3)'
8+
required: true
9+
default: '2'
10+
type: choice
11+
options:
12+
- '1'
13+
- '2'
14+
- '3'
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
debug-build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Ruby
27+
uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: "3.2"
30+
bundler-cache: true
31+
working-directory: docs
32+
33+
- name: Debug Jekyll Build
34+
env:
35+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
36+
DEBUG_LEVEL: ${{ github.event.inputs.debug_level }}
37+
run: |
38+
echo "=== Debug Level: $DEBUG_LEVEL ==="
39+
40+
# Level 1: Basic info
41+
bundle exec jekyll --version
42+
bundle list | grep -E "(jekyll|just-the-docs|sass)"
43+
44+
echo "=== Configuration ==="
45+
grep -E "^(theme|remote_theme|baseurl)" _config.yml
46+
47+
# Level 2: Build with trace
48+
if [ "$DEBUG_LEVEL" -ge 2 ]; then
49+
echo "=== Building with verbose output ==="
50+
bundle exec jekyll build --baseurl="/node-syslog" --verbose --trace
51+
fi
52+
53+
# Level 3: Full analysis
54+
if [ "$DEBUG_LEVEL" -ge 3 ]; then
55+
echo "=== Full site analysis ==="
56+
find _site -type f -name "*.html" -exec echo "=== {} ===" \; -exec head -30 {} \;
57+
58+
echo "=== Asset analysis ==="
59+
find _site -name "*.css" -o -name "*.js" | head -20
60+
61+
echo "=== Theme check ==="
62+
if [ -f "_site/assets/css/just-the-docs.css" ]; then
63+
echo "✅ Theme CSS found"
64+
else
65+
echo "❌ Theme CSS missing"
66+
fi
67+
fi
68+
working-directory: docs

.github/workflows/docs.yml

Lines changed: 124 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,87 @@ jobs:
169169
bundler-cache: true
170170
working-directory: docs
171171

172-
- name: Build Jekyll site
172+
- name: Trace Jekyll Build Process
173173
run: |
174-
echo "🔨 Building Jekyll site..."
175-
echo "Current directory: $(pwd)"
176-
echo "Jekyll config:"
177-
bundle exec jekyll doctor
178-
echo ""
179-
echo "Starting Jekyll build..."
180-
bundle exec jekyll build --baseurl="/node-syslog" --verbose --trace
181-
echo "✅ Jekyll build completed"
182-
echo "Build output directory contents:"
183-
ls -la _site/ || echo "_site directory not found"
174+
echo "=== Jekyll Environment ==="
175+
bundle exec jekyll --version
176+
bundle list | grep -E "(jekyll|just-the-docs|sass)"
177+
178+
echo "=== Jekyll Doctor Diagnosis ==="
179+
bundle exec jekyll doctor --trace
180+
181+
echo "=== Build Configuration ==="
182+
echo "Theme config:"
183+
grep -E "^(theme|remote_theme)" _config.yml
184+
echo "Baseurl config:"
185+
grep -E "^baseurl" _config.yml
186+
187+
echo "=== Starting Verbose Build ==="
188+
bundle exec jekyll build --baseurl="/node-syslog" --verbose --trace 2>&1 | tee build.log
189+
190+
echo "=== Build Log Analysis ==="
191+
echo "Theme-related messages:"
192+
grep -i "theme\|layout\|sass" build.log || echo "No theme messages found"
193+
194+
echo "=== Generated Site Structure ==="
195+
find _site -type f -name "*.html" | wc -l
196+
find _site -type f -name "*.css" | wc -l
197+
find _site -type f -name "*.js" | wc -l
198+
199+
echo "=== Critical Files Check ==="
200+
for file in index.html _api/index.html; do
201+
if [ -f "_site/$file" ]; then
202+
echo "✅ _site/$file exists"
203+
echo "First 50 lines:"
204+
head -50 "_site/$file"
205+
echo "---"
206+
else
207+
echo "❌ _site/$file missing"
208+
fi
209+
done
210+
working-directory: docs
211+
212+
- name: Analyze HTML Structure
213+
run: |
214+
echo "=== HTML Structure Validation ==="
215+
for html_file in $(find _site -name "*.html" -type f | head -5); do
216+
echo "=== Analyzing: $html_file ==="
217+
echo "Has DOCTYPE:"
218+
head -1 "$html_file" | grep -i "<!DOCTYPE" && echo "✅" || echo "❌"
219+
echo "Has <html>:"
220+
grep -q "<html" "$html_file" && echo "✅" || echo "❌"
221+
echo "Has <head>:"
222+
grep -q "<head" "$html_file" && echo "✅" || echo "❌"
223+
echo "Has <body>:"
224+
grep -q "<body" "$html_file" && echo "✅" || echo "❌"
225+
echo "Has <nav>:"
226+
grep -q "<nav" "$html_file" && echo "✅" || echo "❌"
227+
echo "Has theme CSS link:"
228+
grep -q "just-the-docs.*css\|main.*css" "$html_file" && echo "✅" || echo "❌"
229+
echo "---"
230+
done
231+
working-directory: docs
232+
233+
- name: Check Theme Asset Generation
234+
run: |
235+
echo "=== Theme Assets Investigation ==="
236+
echo "CSS files in _site:"
237+
find _site -name "*.css" -type f | sort
238+
239+
echo "JS files in _site:"
240+
find _site -name "*.js" -type f | sort
241+
242+
echo "SASS processing check:"
243+
if find _site -name "*.css" | grep -q "just-the-docs"; then
244+
echo "✅ just-the-docs CSS found"
245+
else
246+
echo "❌ just-the-docs CSS missing"
247+
echo "All CSS files:"
248+
find _site -name "*.css" -exec ls -la {} \;
249+
fi
250+
251+
echo "Asset directory structure:"
252+
find _site/assets -type f 2>/dev/null | head -20 || echo "No assets directory"
184253
working-directory: docs
185254

186255
- name: Add .nojekyll
@@ -240,31 +309,51 @@ jobs:
240309
keep_files: false
241310
# cname: node-syslog.schamane.de
242311

243-
- name: List deployed files (requires GH_TOKEN)
244-
if: env.GH_TOKEN != ''
312+
- name: Verify Deployment via GitHub API
313+
env:
314+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
245315
run: |
246-
echo "📁 Files deployed to gh-pages:"
247-
gh api repos/:owner/:repo/pages/build/latest | jq -r '.artifacts[].name' 2>/dev/null || echo "Using fallback listing..."
248-
249-
# Fallback listing
250-
echo "📁 Available files in _site:"
251-
find docs/_site -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.svg" | sort | head -10
252-
echo "..."
253-
echo "Total HTML files: $(find docs/_site -name "*.html" | wc -l)"
254-
echo "Total CSS files: $(find docs/_site -name "*.css" | wc -l)"
255-
echo "Total JS files: $(find docs/_site -name "*.js" | wc -l)"
316+
echo "=== Checking gh-pages branch ==="
317+
gh api repos/${{ github.repository }}/git/refs/heads/gh-pages || echo "gh-pages branch not found"
318+
319+
echo "=== Latest deployment commit ==="
320+
gh api repos/${{ github.repository }}/commits?sha=gh-pages&per_page=1 | jq -r '.[0].commit.message'
321+
322+
echo "=== Checking deployed files via API ==="
323+
gh api repos/${{ github.repository }}/git/trees/gh-pages?recursive=1 | jq -r '.tree[] | select(.type == "blob") | .path' | grep -E "\\.(html|css|js)$" | head -20
324+
325+
echo "=== Fetching and analyzing deployed index.html ==="
326+
gh api repos/${{ github.repository }}/contents/index.html?ref=gh-pages | jq -r '.content' | base64 -d | head -50
327+
328+
echo "=== Checking for theme assets in deployment ==="
329+
gh api repos/${{ github.repository }}/git/trees/gh-pages?recursive=1 | jq -r '.tree[] | .path' | grep -E "(just-the-docs|main|style).*\\.(css|js)" || echo "No theme assets found"
330+
331+
- name: Live Site Validation
256332
env:
257333
GH_TOKEN: ${{ secrets.GH_TOKEN }}
258-
259-
- name: List deployed files (fallback)
260-
if: env.GH_TOKEN == ''
261334
run: |
262-
echo "📁 Files deployed to gh-pages:"
263-
echo "📁 Available files in _site:"
264-
find docs/_site -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.svg" | sort | head -10
265-
echo "..."
266-
echo "Total HTML files: $(find docs/_site -name "*.html" | wc -l)"
267-
echo "Total CSS files: $(find docs/_site -name "*.css" | wc -l)"
268-
echo "Total JS files: $(find docs/_site -name "*.js" | wc -l)"
269-
echo ""
270-
echo "📖 Documentation available at: https://schamane.github.io/node-syslog/"
335+
echo "=== Waiting for deployment to propagate ==="
336+
sleep 15
337+
338+
echo "=== Testing live site ==="
339+
SITE_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
340+
echo "Testing URL: $SITE_URL"
341+
342+
echo "=== Fetching live site HTML ==="
343+
curl -s "$SITE_URL" | head -100 | tee live-site.html
344+
345+
echo "=== Analyzing live site structure ==="
346+
echo "Has DOCTYPE:"
347+
grep -i "<!DOCTYPE" live-site.html && echo "✅" || echo "❌"
348+
349+
echo "Has <nav> element:"
350+
grep "<nav" live-site.html && echo "✅" || echo "❌"
351+
352+
echo "Has theme CSS:"
353+
grep -E "just-the-docs.*css|main.*css" live-site.html && echo "✅" || echo "❌"
354+
355+
echo "Title tag:"
356+
grep "<title>" live-site.html || echo "No title found"
357+
358+
echo "=== Checking HTTP headers ==="
359+
curl -I "$SITE_URL"

docs/Gemfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
source "https://rubygems.org"
22

33
# Use Ruby version compatible with Jekyll
4-
ruby ">= 2.6.0"
4+
ruby ">= 3.2.0"
55

66
# Use exact versions for reproducible builds
7-
gem "jekyll", "~> 4.3.0"
8-
gem "just-the-docs", "~> 0.8.2"
7+
gem "jekyll", "~> 4.4.0"
8+
gem "just-the-docs", "~> 0.10.0"
99

1010
group :jekyll_plugins do
11-
gem "jekyll-feed", "~> 0.15.0"
12-
gem "jekyll-sitemap", "~> 1.3.0"
13-
gem "jekyll-seo-tag", "~> 2.7.0"
11+
gem "jekyll-feed"
12+
gem "jekyll-sitemap"
13+
gem "jekyll-seo-tag"
1414
end

docs/_api/classes/Syslog.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Syslog"
2+
layout: default
3+
title: "Syslog Class"
34
parent: API Reference
45
nav_order: 2
56
---

docs/_api/functions/alert.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2+
layout: default
23
title: "Alert"
3-
44
parent: API Reference
55
nav_order: auto
66
---

docs/_api/functions/createSyslog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2+
layout: default
23
title: "CreateSyslog"
3-
44
parent: API Reference
55
nav_order: auto
66
---

docs/_api/functions/critical.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2+
layout: default
23
title: "Critical"
3-
44
parent: API Reference
55
nav_order: auto
66
---

docs/_api/functions/debug.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2+
layout: default
23
title: "Debug"
3-
44
parent: API Reference
55
nav_order: auto
66
---

docs/_api/functions/emergency.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2+
layout: default
23
title: "Emergency"
3-
44
parent: API Reference
55
nav_order: auto
66
---

docs/_api/functions/error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2+
layout: default
23
title: "Error"
3-
44
parent: API Reference
55
nav_order: auto
66
---

0 commit comments

Comments
 (0)