mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
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
This commit is contained in:
27
generate-docs.sh
Executable file
27
generate-docs.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user