mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-30 04:33:58 +00:00
The "Last Updated" footer shows the date the page was published, not when the content was last updated. This has caused readers some confusion. Update the footer with the date of the git commit that last updated the document, and clarify with both the last modified and published dates in the footer, something like this: Last modified: Aug 19, 2021. Published: Nov 03, 2021. Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
23 lines
934 B
Bash
Executable File
23 lines
934 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (C) 2021 Intel Corporation.
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
#
|
|
# Run this script in the _build/html folder after generating the HTML content.
|
|
#
|
|
# Scan through HTML files look for the corresponding .rst file (in doc or misc
|
|
# for ACRN project). Replace the "Last updated" date in the footer with the last
|
|
# commit date for the corresponding .rst file (if we can find it). Tweak
|
|
# wording to mention Last modified and published dates.
|
|
|
|
cd _build/html
|
|
|
|
find -type f -name "*.html" | \
|
|
while read filename;
|
|
do
|
|
f=${filename%.*}.rst
|
|
[[ -f "../../$f" ]] && prefix="../.."
|
|
[[ -f "../../../$f" ]] && prefix="../../.."
|
|
d="$(git log -1 --format="%ad" --date=format:"%b %d, %Y" -- "$prefix/$f")";
|
|
[[ ! -z "$d" ]] && sed -i "s/\(^ *<span class=\"lastupdated\">\)Last updated on \(.*\)\.$/\1Last modified: $d. Published: \2./" $filename;
|
|
done
|