Skip to content

Commit a18c48e

Browse files
committed
chore: improve documentation generation workflow by refining INDEX.md processing and enhancing Jekyll configuration
- Updated the handling of INDEX.md to replace .md with .html and ensure proper front matter formatting. - Enhanced the copying process to exclude INDEX.md initially and process it separately. - Adjusted the Jekyll _config.yml to specify a version for the remote theme and added collections support. - Improved final build structure logging to include schema files.
1 parent d845887 commit a18c48e

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/test-docs-generation.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ jobs:
6565
run: |
6666
# Create Jekyll source directory
6767
mkdir -p site-src
68+
69+
# Copy all docs except INDEX.md (we'll handle that separately)
6870
cp -r docs/* site-src/
6971
70-
# Create lowercase index.md (Jekyll requirement)
71-
cat > site-src/index.md << EOF
72-
---
73-
layout: default
74-
title: DXT Documentation
75-
---
72+
# Process INDEX.md - replace .md with .html and add proper front matter
73+
sed 's/\.md/\.html/g' docs/INDEX.md > site-src/index.md
74+
# Make sure front matter is formatted correctly (with empty line after)
75+
sed -i '1s/^/---\nlayout: default\ntitle: DXT Documentation\n---\n\n/' site-src/index.md
76+
77+
# Process all other markdown files to fix links
78+
find site-src -name "*.md" | while read file; do
79+
sed -i 's/\.md/\.html/g' "$file"
80+
done
7681
77-
$(grep -v "^# DXT documentation" site-src/INDEX.md)
78-
EOF
79-
8082
# Create Gemfile with exact dependencies
8183
cat > site-src/Gemfile << EOF
8284
source 'https://rubygems.org'
@@ -89,7 +91,7 @@ jobs:
8991
gem 'webrick' # required for Ruby 3.x
9092
EOF
9193
92-
# Write Jekyll _config.yml with remote theme
94+
# Write Jekyll _config.yml with proper configuration
9395
cat > site-src/_config.yml << EOF
9496
title: DXT Documentation
9597
description: Documentation for the DEFRA Forms Engine Plugin
@@ -99,7 +101,7 @@ jobs:
99101
syntax_highlighter: rouge
100102
101103
# Use remote GitHub-hosted theme
102-
remote_theme: pages-themes/minimal
104+
remote_theme: pages-themes/minimal@v0.2.0
103105
104106
plugins:
105107
- jekyll-remote-theme
@@ -108,6 +110,7 @@ jobs:
108110
109111
relative_links:
110112
enabled: true
113+
collections: true
111114
112115
defaults:
113116
- scope:
@@ -137,7 +140,7 @@ jobs:
137140
138141
# Display final build structure for debugging
139142
echo "Final site structure:"
140-
find _site -type f | grep -v ".git" | grep -e "index.html" -e "assets" | head -n 10
143+
find _site -type f | grep -v ".git" | grep -e "index.html" -e "assets" -e "schema" | head -n 10
141144
echo "... (and more files)"
142145
143146
- name: Setup Pages

0 commit comments

Comments
 (0)