Skip to content

Commit b7c4ca9

Browse files
committed
feat: update Jekyll configuration to improve asset handling and exclusions
- Added exclusions for specific JavaScript files and Gemfile-related files to optimize Jekyll processing. - Enhanced asset configuration settings for better management of JavaScript files. - Streamlined the overall Jekyll configuration for improved clarity and functionality.
1 parent 4aff57e commit b7c4ca9

1 file changed

Lines changed: 17 additions & 20 deletions

File tree

.github/scripts/docs/create-jekyll-config.sh

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ include:
6969
- "**/*.schema.json"
7070
- "schemas/**/*"
7171
72+
# Tell Jekyll to EXCLUDE JS files from processing as pages
73+
exclude:
74+
- "vendor"
75+
- "Gemfile"
76+
- "Gemfile.lock"
77+
7278
# Markdown processing
7379
markdown: kramdown
7480
kramdown:
@@ -87,6 +93,13 @@ plugins:
8793
- jekyll-relative-links
8894
- jekyll-seo-tag
8995
96+
# Asset configuration
97+
assets:
98+
self_contained: false
99+
js_directory: /assets/js
100+
compress:
101+
js: false
102+
90103
# Link handling
91104
relative_links:
92105
enabled: true
@@ -123,32 +136,16 @@ toc:
123136
min_level: 1
124137
max_level: 2 # Only show h1 and h2 in TOC
125138
126-
assets:
127-
self_contained: false
128-
js_directory: /assets/js
129-
compress:
130-
js: false
131-
132139
# Custom scripts
133140
head_scripts:
134141
- /assets/js/fix-links.js
135142
136143
# Handle assets correctly
137144
keep_files:
138145
- assets
146+
EOF
139147

140-
exclude:
141-
- "/assets/js/just-the-docs.js" # Exclude from processing, not from output
142-
- "/assets/js/vendor/lunr.min.js"
143-
- "vendor"
144-
- "Gemfile"
145-
- "Gemfile.lock"
146-
147-
# Explicitly tell Jekyll NOT to process certain file types
148-
keep_files:
149-
- assets
150-
151-
# Add custom CSS for better styling
148+
# Create custom CSS file
152149
echo "📝 Creating custom CSS file..."
153150
mkdir -p site-src/assets/css
154151
cat > site-src/assets/css/custom.scss << 'EOF'
@@ -224,8 +221,8 @@ cat > site-src/assets/js/fix-links.js << 'EOF'
224221
document.addEventListener('DOMContentLoaded', function() {
225222
// Fix all links that should have the baseurl
226223
document.querySelectorAll('a[href^="/"]').forEach(function(link) {
227-
if (!link.href.includes('/forms-engine-plugin') &&
228-
!link.href.match(/^https?:\/\//) && a
224+
if (!link.href.includes('/forms-engine-plugin') &&
225+
!link.href.match(/^https?:\/\//) &&
229226
!link.getAttribute('href').startsWith('/forms-engine-plugin')) {
230227
const href = link.getAttribute('href');
231228
link.href = '/forms-engine-plugin' + href;

0 commit comments

Comments
 (0)