From 37083aa1219810413c378f673a93f6a5ea505646 Mon Sep 17 00:00:00 2001 From: Chris Bush Date: Tue, 25 Jul 2023 10:21:37 -0400 Subject: [PATCH] Add script to fix H1s on docs (#7835) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add script to fix H1s on docs Per SEO team request, the Javadoc generated docs need H1s. * Update javadoc header-fix script --------- Co-authored-by: Claus Rørbech --- tools/fix-h1s.sh | 24 ++++++++++++++++++++++++ tools/publish_release.sh | 1 + 2 files changed, 25 insertions(+) create mode 100755 tools/fix-h1s.sh diff --git a/tools/fix-h1s.sh b/tools/fix-h1s.sh new file mode 100755 index 0000000000..10d2e61220 --- /dev/null +++ b/tools/fix-h1s.sh @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +usage() { +cat < +EOF +} + +if [ "$#" -ne 1 ] ; then + usage + exit 1 +fi + +# Assume Dokka has been run +pushd $1 + +find . -name "*.html" | while read ln +do + # Make the output SEO friendly by converting the "h2" title to the proper "h1" + sed -i -e 's|||' "$ln" +done +find . -iname "*.html-e" | xargs rm + +popd diff --git a/tools/publish_release.sh b/tools/publish_release.sh index 9818b61f66..29cec6294e 100644 --- a/tools/publish_release.sh +++ b/tools/publish_release.sh @@ -106,6 +106,7 @@ create_javadoc() { echo "Creating JavaDoc..." cd $REALM_JAVA_PATH eval "./gradlew javadoc $GRADLE_BUILD_PARAMS --stacktrace" + eval "./tools/fix-h1s.sh realm/realm-library/build/docs/javadoc/" cd $HERE }