Documentation Revamp
Co-authored-by: jbdoumenjou <jb.doumenjou@gmail.com>
This commit is contained in:
parent
848e45c22c
commit
ac6b11037d
174 changed files with 5858 additions and 4002 deletions
16
docs/scripts/lint.sh
Executable file
16
docs/scripts/lint.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
# This script will run a couple of linter on the documentation
|
||||
|
||||
set -eu
|
||||
|
||||
# We want to run all linters before returning success (exit 0) or failure (exit 1)
|
||||
# So this variable holds the global exit code
|
||||
EXIT_CODE=0
|
||||
readonly BASE_DIR=/app
|
||||
|
||||
echo "== Linting Markdown"
|
||||
# Uses the file ".markdownlint.json" for setup
|
||||
cd "${BASE_DIR}" || exit 1
|
||||
markdownlint --config ${BASE_DIR}/content/includes/.markdownlint.json "${BASE_DIR}/content/**/*.md" || EXIT_CODE=1
|
||||
|
||||
exit "${EXIT_CODE}"
|
16
docs/scripts/netlify-run.sh
Executable file
16
docs/scripts/netlify-run.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# This script is run in netlify environment to build and validate
|
||||
# the website for documentation
|
||||
|
||||
CURRENT_DIR="$(cd "$(dirname "${0}")" && pwd -P)"
|
||||
|
||||
#### Build website
|
||||
# Provide the URL for this deployment to Mkdocs
|
||||
echo "${DEPLOY_PRIME_URL}" > "${CURRENT_DIR}/../CNAME"
|
||||
sed -i "s#site_url:.*#site_url: ${DEPLOY_PRIME_URL}#" "${CURRENT_DIR}/../mkdocs.yml"
|
||||
|
||||
# Build
|
||||
mkdocs build
|
||||
|
||||
exit 0
|
28
docs/scripts/verify.sh
Executable file
28
docs/scripts/verify.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
PATH_TO_SITE="${1:-/app/site}"
|
||||
|
||||
set -eu
|
||||
|
||||
[ -d "${PATH_TO_SITE}" ]
|
||||
|
||||
NUMBER_OF_CPUS="$(grep -c processor /proc/cpuinfo)"
|
||||
|
||||
echo "=== Checking HTML content..."
|
||||
|
||||
# Search for all HTML files except the theme's partials
|
||||
# and pipe this to htmlproofer with parallel threads
|
||||
# (one htmlproofer per vCPU)
|
||||
find "${PATH_TO_SITE}" -type f -not -path "/app/site/theme/*" \
|
||||
-name "*.html" -print0 \
|
||||
| xargs -0 -r -P "${NUMBER_OF_CPUS}" -I '{}' \
|
||||
htmlproofer \
|
||||
--check-html \
|
||||
--check_external_hash \
|
||||
--alt_ignore="/traefik.logo.png/" \
|
||||
--http_status_ignore="0,500,501,503" \
|
||||
--url-ignore "/https://groups.google.com/a/traefik.io/forum/#!forum/security/,/localhost:/,/127.0.0.1:/,/fonts.gstatic.com/,/.minikube/,/github.com\/containous\/traefik\/*edit*/,/github.com\/containous\/traefik\/$/,/docs.traefik.io/" \
|
||||
'{}' 1>/dev/null
|
||||
## HTML-proofer options at https://github.com/gjtorikian/html-proofer#configuration
|
||||
|
||||
echo "= Documentation checked successfully."
|
Loading…
Add table
Add a link
Reference in a new issue