-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcreate-jekyll-config.sh
More file actions
204 lines (174 loc) · 4.21 KB
/
create-jekyll-config.sh
File metadata and controls
204 lines (174 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#!/bin/bash
# Script to create Jekyll configuration files
# This script creates the Gemfile and _config.yml for the Jekyll site
echo "📝 Creating Jekyll configuration files..."
# Set up sed in-place flag based on OS
if sed --version 2>&1 | grep -q GNU; then
# GNU sed (Linux)
SED_INPLACE=(-i)
else
# BSD sed (macOS)
SED_INPLACE=(-i "")
fi
# Create Gemfile
echo "📄 Creating Gemfile..."
cat > site-src/Gemfile << EOF
source 'https://rubygems.org'
gem 'jekyll', '~> 4.3.2'
gem 'just-the-docs', '~> 0.5.3'
gem 'jekyll-seo-tag'
gem 'jekyll-remote-theme'
gem 'jekyll-relative-links'
gem 'webrick' # required for Ruby 3.x
EOF
# Create _config.yml
echo "📄 Creating _config.yml..."
cat > site-src/_config.yml << EOF
title: DXT Documentation
description: Documentation for the DEFRA Forms Engine Plugin
# Theme configuration
remote_theme: just-the-docs/just-the-docs@v0.5.3
# Use this instead of remote_theme when running locally
# theme: just-the-docs
# URL configuration - ensure these are correct for GitHub Pages
url: ""
baseurl: "/forms-engine-plugin" # Use repo name for GitHub Pages
# Search and heading configuration
search_enabled: true
heading_anchors: true
search:
heading_level: 2
previews: 3
preview_words_before: 5
preview_words_after: 10
rel_url: true
# Navigation configuration
nav_external_links:
- title: GitHub
url: https://github.com/DEFRA/forms-designer
hide_icon: false
# Auxiliary links
aux_links:
"DXT on GitHub":
- "https://github.com/DEFRA/forms-designer"
# Include all necessary file types
include:
- "**/*.html"
- "**/*.json"
- "**/*.schema.json"
- "schemas/**/*"
- "assets/js/*.js"
# Tell Jekyll to EXCLUDE these directories completely
exclude:
- "vendor"
- "vendor/bundle/"
- "vendor/cache/"
- "vendor/gems/"
- "vendor/ruby/"
- "Gemfile"
- "Gemfile.lock"
# Markdown processing
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
syntax_highlighter_opts:
block:
line_numbers: false
# Color scheme
color_scheme: light
# Plugin configuration
plugins:
- jekyll-remote-theme
- jekyll-relative-links
- jekyll-seo-tag
# Asset configuration
assets:
self_contained: false
js_directory: /assets/js
compress:
js: false
# Link handling
relative_links:
enabled: true
collections: true
# Default layouts and configurations
defaults:
# Process JS files with Liquid but no layout
- scope:
path: "assets/js"
values:
layout: null
sitemap: false
render_with_liquid: true
# Then define all other defaults below
- scope:
path: "assets/css"
values:
layout: null
render_with_liquid: true
- scope:
path: ""
type: "pages"
values:
layout: default
render_with_liquid: false
- scope:
path: "schemas"
values:
layout: default
parent: "Schema Reference"
# Table of contents configuration
toc:
min_level: 1
max_level: 2 # Only show h1 and h2 in TOC
# Custom scripts
head_scripts:
- /assets/js/fix-links.js
# Handle assets correctly
keep_files:
- assets
EOF
echo "📝 Copying link-fixer JavaScript..."
mkdir -p site-src/assets/js
cp .github/scripts/docs/assets/js/fix-links.js site-src/assets/js/
mkdir -p site-src/_includes
cat > site-src/_includes/head_custom.html << 'EOF'
<meta name="baseurl" content="{{ site.baseurl }}">
EOF
echo "📝 Copying custom SCSS styling overrides..."
mkdir -p site-src/_sass/custom
cp .github/scripts/docs/assets/scss/custom.scss site-src/_sass/custom/custom.scss
# Features section - explicit configuration
- scope:
path: "features"
values:
nav_exclude: false
- scope:
path: "features/index.md"
values:
layout: default
title: "Features"
nav_order: 4
has_children: true
permalink: /features/
nav_exclude: false
- scope:
path: "features/code-based/index.md"
values:
layout: default
title: "Code-based Features"
parent: "Features"
has_children: true
nav_order: 1
nav_exclude: false
- scope:
path: "features/configuration-based/index.md"
values:
layout: default
title: "Configuration-based Features"
parent: "Features"
has_children: true
nav_order: 2
nav_exclude: false
echo "✅ Jekyll configuration files created successfully!"