-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
33 lines (23 loc) · 823 Bytes
/
build.sh
File metadata and controls
33 lines (23 loc) · 823 Bytes
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
#!/bin/sh
set -eu
script_dir=$(cd "$(dirname "$0")" && pwd)
echo "Building site..."
# Create the 'site' directory if it doesn't exist
mkdir -p "${script_dir}/docs/docs"
# Copy files to the 'docs' directory
for path in \
"index.html" \
"manifest.webmanifest" \
"robots.txt" \
"service-worker.js"
do
cp -r "${script_dir}/src/${path}" "${script_dir}/docs"
done
# Copy static files
cp -r "${script_dir}/src/static" "${script_dir}/docs/docs"
asciidoctor -r asciidoctor-diagram -r asciidoctor-bibtex --doctype=book "${script_dir}/src/index.adoc" -a webfonts! -o "${script_dir}/docs/docs/index.html"
mkdir -p docs/docs/static/css
cp syntax/css/*.css docs/docs/static/css
# Lazy load images
sed -i -e 's/<img/<img loading="lazy"/g' "${script_dir}/docs/docs/index.html"
echo "Morloc Manual site build complete!"