Skip to content

Commit

Permalink
add more script documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
neteler committed Aug 29, 2024
1 parent 6f796d3 commit 1668170
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion utils/cronjobs_osgeo_lxd/cron_grass_legacy_build_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ unset ARCH ARCH_DISTDIR GISBASE VERSION_NUMBER

############################################
# Inject hint to new current version hint in a red box into each manual page
# - cd into folder of HTML manual pages
# - run sed to replace an existing HTML string in the upper part of the HTML file
# with itself + the red box pointing to the respective stable version manual page
# --> do this for core manual pages, addons, libpython
##
# for core manual pages
echo "Injecting G8.x new current version hint in a red box into MAN pages..."
# inject G8.x current stable version hint in a red box:
Expand All @@ -307,7 +312,11 @@ echo "Injecting G8.x new current version hint in a red box into MAN pages..."

# SEO: inject canonical link into all (old) manual pages to point to latest stable (avoid "duplicate content" SEO punishment)
# see https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
# canonical: once again after addon manual (re)creation, only where missing
# - cd into folder of HTML manual pages
# - run sed to replace an existing HTML header string in the upper part of the HTML file
# with itself + canonical link of stable version
# --> do this for core manual pages, addons, libpython
##
(cd $TARGETHTMLDIR/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s:</head>:<link rel=\"canonical\" href=\"https\://grass.osgeo.org/grass${NEW_CURRENT}/manuals/$myfile\">\n</head>:g" $myfile ; done)
(cd $TARGETHTMLDIR/addons/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s:</head>:<link rel=\"canonical\" href=\"https\://grass.osgeo.org/grass${NEW_CURRENT}/manuals/addons/$myfile\">\n</head>:g" $myfile ; done)
(cd $TARGETHTMLDIR/libpython/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s:</head>:<link rel=\"canonical\" href=\"https\://grass.osgeo.org/grass${NEW_CURRENT}/manuals/libpython/$myfile\">\n</head>:g" $myfile ; done)
Expand Down
10 changes: 9 additions & 1 deletion utils/cronjobs_osgeo_lxd/cron_grass_old_build_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ unset ARCH ARCH_DISTDIR GISBASE VERSION_NUMBER

############################################
# Inject hint to new current version hint in a red box into each manual page
# - cd into folder of HTML manual pages
# - run sed to replace an existing HTML string in the upper part of the HTML file
# with itself + the red box pointing to the respective stable version manual page
# --> do this for core manual pages, addons, libpython
##
# for core manual pages
echo "Injecting G8.x new current version hint in a red box into MAN pages..."
# inject G8.x current stable version hint in a red box:
Expand All @@ -341,7 +346,10 @@ echo "Injecting G8.x new current version hint in a red box into MAN pages..."

# SEO: inject canonical link into all (old) manual pages to point to latest stable (avoid "duplicate content" SEO punishment)
# see https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
# canonical: once again after addon manual (re)creation, only where missing
# - cd into folder of HTML manual pages
# - run sed to replace an existing HTML header string in the upper part of the HTML file
# with itself + canonical link of stable version
# --> do this for core manual pages, addons, libpython
(cd $TARGETHTMLDIR/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s:</head>:<link rel=\"canonical\" href=\"https\://grass.osgeo.org/grass${NEW_CURRENT}/manuals/$myfile\">\n</head>:g" $myfile ; done)
(cd $TARGETHTMLDIR/addons/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s:</head>:<link rel=\"canonical\" href=\"https\://grass.osgeo.org/grass${NEW_CURRENT}/manuals/addons/$myfile\">\n</head>:g" $myfile ; done)
(cd $TARGETHTMLDIR/libpython/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s:</head>:<link rel=\"canonical\" href=\"https\://grass.osgeo.org/grass${NEW_CURRENT}/manuals/libpython/$myfile\">\n</head>:g" $myfile ; done)
Expand Down

0 comments on commit 1668170

Please sign in to comment.