From 7f28462b4388f081c3f22d960b5878950c194e35 Mon Sep 17 00:00:00 2001 From: Rath Pascal Date: Sat, 7 Dec 2024 17:28:22 +0100 Subject: [PATCH] update docs-infra --- docs/html_infra.sh | 76 +++++++++++++++++++++++++++++++++++++++++++ docs/meta/robots.txt | 27 +++++++++++++++ docs/meta/sitemap.xml | 13 ++++++++ docs/source/conf.py | 12 ++++--- docs/venv.sh | 12 +++++++ 5 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 docs/html_infra.sh create mode 100644 docs/meta/robots.txt create mode 100644 docs/meta/sitemap.xml create mode 100644 docs/venv.sh diff --git a/docs/html_infra.sh b/docs/html_infra.sh new file mode 100644 index 0000000..8eb2bfb --- /dev/null +++ b/docs/html_infra.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +if [ -z "$1" ] +then + DEST_DIR='build' +else + DEST_DIR="$1" +fi + +set -euo pipefail + +function log() { + msg="$1" + echo '' + echo "### ${msg} ###" + echo '' +} + +cd "$(dirname "$0")" + +SRC_DIR="$(pwd)" + +TS="$(date +%s)" +TMP_DIR="/tmp/${TS}" +mkdir -p "${TMP_DIR}" + +VENV_BIN='/tmp/.ag-docs-venv/bin/activate' +if [ -f "$VENV_BIN" ] +then + source "$VENV_BIN" +fi + +log 'BUILDING DOCS' +export PYTHONWARNINGS='ignore' +sphinx-build -b html source/ "${TMP_DIR}/" >/dev/null + +log 'PATCHING METADATA' +cp "${SRC_DIR}/meta/"* "${TMP_DIR}/" + +HTML_META_SRC="" +HTML_META="${HTML_META_SRC}" +HTML_META="${HTML_META}" +HTML_META_EN="${HTML_META}" # +# HTML_LOGO_LINK_SRC='href=".*Go to homepage"' +# HTML_LOGO_LINK_EN='href="https://www.o-x-l.com" class="oxl-nav-logo" title="OXL IT Services Website"' +HTML_TITLE_BAD_EN='Ansible Collection - LinuxHA documentation' +HTML_TITLE_OK='LinuxHA Ansible Collection' +HTML_LANG_NONE=' + + https://linuxha.ansibleguy.net/en/latest/ + + https://linuxha.ansibleguy.net/en/latest/usage/1_install.html + https://linuxha.ansibleguy.net/en/latest/usage/2_config.html + https://linuxha.ansibleguy.net/en/latest/usage/3_basic.html + + https://linuxha.ansibleguy.net/en/latest/modules/1_basic.html + https://linuxha.ansibleguy.net/en/latest/modules/config.html + https://linuxha.ansibleguy.net/en/latest/modules/raw.html + https://linuxha.ansibleguy.net/en/latest/modules/status.html + \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 6beb7ab..a92eedc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -9,10 +9,11 @@ templates_path = ['_templates'] exclude_patterns = [] html_theme = 'piccolo_theme' -html_static_path = ['_static'] -html_logo = 'https://clusterlabs.org/assets/clusterlabs3-9dbb18813995af518cd0b823b0eaaa83b4ba5770f199728d37818b090f1f377c.svg' -html_favicon = '_static/img/favicon.ico' -html_css_files = ['css/main.css'] +# html_static_path = ['_static'] +# html_logo = 'https://clusterlabs.org/assets/clusterlabs3-9dbb18813995af518cd0b823b0eaaa83b4ba5770f199728d37818b090f1f377c.svg' +# html_favicon = '_static/img/favicon.ico' +html_js_files = ['https://files.oxl.at/js/feedback.js'] +html_css_files = ['css/main.css', 'https://files.oxl.at/css/feedback.css'] master_doc = 'index' display_version = True sticky_navigation = True @@ -21,6 +22,7 @@ } html_theme_options = { 'banner_text': 'Repository on GitHub | ' - 'Report errors' + 'Report Errors | ' + 'Get Support' } html_short_title = 'Ansible LinuxHA' \ No newline at end of file diff --git a/docs/venv.sh b/docs/venv.sh new file mode 100644 index 0000000..291c436 --- /dev/null +++ b/docs/venv.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cd "$(dirname "$0")" + +VENV_PATH='/tmp/.ag-docs-venv' + +python3 -m virtualenv "$VENV_PATH" +source "${VENV_PATH}/bin/activate" + +pip install -r requirements.txt >/dev/null \ No newline at end of file