From abb564ba41c2ae5b06ff6fa25b572bf45f87b2de Mon Sep 17 00:00:00 2001 From: "David B. Kinder" Date: Thu, 28 Oct 2021 11:01:55 -0700 Subject: [PATCH] doc: add top-level redirect * Add a script for creating top-level redirects on the projectacrn.github.io site. * Use it to generate the top-level index.html redirect to latest/index.html in the Makefile (for make publsh). * Generate a new redirect for hardware.html to catch inbound links. Signed-off-by: David B. Kinder --- doc/Makefile | 3 ++- doc/scripts/publish-index.html | 12 ------------ doc/scripts/publish-redirect.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 13 deletions(-) delete mode 100644 doc/scripts/publish-index.html create mode 100755 doc/scripts/publish-redirect.sh diff --git a/doc/Makefile b/doc/Makefile index 5d4ee56cb..7f48b6562 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -92,7 +92,8 @@ publish: cp -r $(BUILDDIR)/html/* $(PUBLISHDIR) ifeq ($(RELEASE),latest) cp scripts/publish-README.md $(PUBLISHDIR)/../README.md - cp scripts/publish-index.html $(PUBLISHDIR)/../index.html + scripts/publish-redirect.sh $(PUBLISHDIR)/../index.html latest/index.html + scripts/publish-redirect.sh $(PUBLISHDIR)/../hardware.html latest/reference/hardware.html cp scripts/publish-robots.txt $(PUBLISHDIR)/../robots.txt sed 's//\n /' $(BUILDDIR)/html/404.html > $(PUBLISHDIR)/../404.html endif diff --git a/doc/scripts/publish-index.html b/doc/scripts/publish-index.html deleted file mode 100644 index 2d58e38b9..000000000 --- a/doc/scripts/publish-index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - ACRN Hypervisor documentation - - - - -

Please visit the latest ACRN documentation

- - diff --git a/doc/scripts/publish-redirect.sh b/doc/scripts/publish-redirect.sh new file mode 100755 index 000000000..4adef2cc8 --- /dev/null +++ b/doc/scripts/publish-redirect.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright (C) 2021 Intel Corporation. +# SPDX-License-Identifier: BSD-3-Clause + +# Create top-level website redirect to a doc (conf.py redirect script can only +# create redirects within the published folder output, e.g. latest/ or 2.6/) +# +# publish-redirect docname.html destpath/docname.html + +if [[ $# -ne 2 ]]; then + echo "Error: $0 expects two parameters: docname.html destpath/docname.html" >&2 + exit 1 +fi + +cat>"$1"< + + ACRN Hypervisor documentation Redirect + + + + +

Please visit the latest ACRN documentation

+ + +EOF