Skip to content

Commit b1c12e8

Browse files
committed
chore: refine documentation generation workflow with liquid tag fixes and layout adjustments
- Enhanced the processing of markdown files to fix Liquid tag issues and ensure proper formatting. - Updated INDEX.md layout from 'home' to 'default' for consistency across documentation. - Improved the script to inject front matter and handle markdown links more effectively.
1 parent 3809c08 commit b1c12e8

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

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

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,36 @@ jobs:
7171
7272
# Process INDEX.md - replace .md with .html and add proper front matter
7373
sed 's/\.md/\.html/g' docs/INDEX.md > site-src/index.md
74-
# Make sure front matter is formatted correctly (with empty line after)
7574
sed -i '1s/^/---\nlayout: default\ntitle: DXT Documentation\n---\n\n/' site-src/index.md
7675
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
76+
# Create a file to hold the problematic lines to fix
77+
cat > fix-liquid.sed << EOF
78+
# Fix for the specific error in PAGE_EVENTS.md
79+
/You have not been awarded any funding for this application/,+1 s/{% endif %}//
80+
81+
# Escape all Liquid tags for Jekyll
82+
s/{{/\\{{ /g
83+
s/}}/\\}} /g
84+
s/{%/\\{% /g
85+
s/%}/\\%} /g
86+
EOF
8187
82-
# Inject front matter into all markdown files that are missing it
88+
# Process all markdown files
8389
find site-src -name "*.md" | while read file; do
90+
# Apply the liquid fixes
91+
sed -i -f fix-liquid.sed "$file"
92+
93+
# Replace .md with .html in links
94+
sed -i 's/\.md/\.html/g' "$file"
95+
96+
# Ensure every Markdown file has front matter
8497
if ! grep -q "^---" "$file"; then
8598
echo "Injecting front matter into $file"
8699
sed -i '1s/^/---\nlayout: default\n---\n\n/' "$file"
87100
fi
101+
102+
# Fix any 'layout: home' references
103+
sed -i 's/layout: home/layout: default/g' "$file"
88104
done
89105
90106
# Create Gemfile with exact dependencies
@@ -121,28 +137,16 @@ jobs:
121137
collections: true
122138
123139
defaults:
124-
- scope:
125-
path: "schemas"
126-
type: "pages"
127-
values:
128-
layout: default
129-
- scope:
130-
path: "features"
131-
type: "pages"
132-
values:
133-
layout: default
134140
- scope:
135141
path: ""
136142
type: "pages"
137143
values:
138144
layout: default
139145
EOF
140146
141-
# Install dependencies using Bundler
147+
# Install dependencies and build
142148
cd site-src
143149
bundle install
144-
145-
# Build the site using Jekyll with bundler
146150
bundle exec jekyll build --destination ../_site
147151
cd ..
148152

docs/INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: home
2+
layout: default
33
---
44

55
- [Getting started with DXT](./GETTING_STARTED.md)

0 commit comments

Comments
 (0)