Files
error-prone-support/generate-docs.sh
Jelmer Borst 5ca95eb36d Set up documentation website generation and deployment (#253)
Generating the website is done by Jekyll with a theme called `just-the-docs`. 
Deployment of the website is done via GitHub Pages.

See:
- https://github.com/jekyll/jekyll
- https://github.com/just-the-docs/just-the-docs
2022-10-04 09:08:23 +02:00

28 lines
645 B
Bash
Executable File

#!/usr/bin/env bash
set -e -u -o pipefail
REPOSIORY_ROOT="$(git rev-parse --show-toplevel)"
WEBSITE_ROOT="${REPOSIORY_ROOT}/website"
generate_homepage() {
local homepage="${WEBSITE_ROOT}/index.md"
echo "Generating ${homepage}..."
cat - "${REPOSIORY_ROOT}/README.md" > "${homepage}" << EOF
---
layout: default
title: Home
nav_order: 1
---
EOF
local macos_compat=""
[[ "${OSTYPE}" == "darwin"* ]] && macos_compat="yes"
sed -i ${macos_compat:+".bak"} 's/src="website\//src="/g' "${homepage}"
sed -i ${macos_compat:+".bak"} 's/srcset="website\//srcset="/g' "${homepage}"
}
# Generate the website.
generate_homepage