-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to fix H1s on Dokka-generated docs (#1460)
* Add script to fix H1s on Dokka-generated docs This is an SEO team request to make sure all pages have an H1. * Verified script execution in development environment --------- Co-authored-by: Claus Rørbech <claus.rorbech@mongodb.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash -ex | ||
|
||
usage() { | ||
cat <<EOF | ||
Usage: $0 <root-dokka-dir> | ||
EOF | ||
} | ||
|
||
if [ "$#" -ne 1 ] ; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
# Assume Dokka has been run | ||
pushd $1 | ||
|
||
# Make the output SEO friendly by converting the "h2" title to the proper "h1". | ||
# For Dokka, this is only an issue on the index page (apparently). | ||
sed -i -e 's|<h2\(.*\)</h2>|<h1\1</h1>|' index.html | ||
find . -iname "*.html-e" | xargs rm | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters