Skip to content

Commit

Permalink
Changed base index.html to a redirect into the version/index.html (#4852
Browse files Browse the repository at this point in the history
)
  • Loading branch information
scsides authored Mar 17, 2022
1 parent 303cdec commit ed978e2
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 4 deletions.
8 changes: 4 additions & 4 deletions isis/cmake/BuildDocs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ function(build_upper_level)

# These folders are populated inside "build_documents_folder"

# Create the main index.html file aka the home page
execute_process(COMMAND ${XALAN} ${XALAN_VALIDATE_OPTION} ${XALAN_PARAM_OPTION} menuPath \"${docVersion}/\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/index.html ${XALAN_INFILE_OPTION} ${docBuildFolder}/build/homepage.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/main.xsl)
# Create a second main page inside the version numbered area for when the page above gets overwritten with a new version
execute_process(COMMAND ${XALAN} ${XALAN_VALIDATE_OPTION} ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/${docVersion}/index.html ${XALAN_INFILE_OPTION} ${docBuildFolder}/build/homepage.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/main.xsl)
# Create a redirect for the top level index file. It points to the version index file
execute_process(COMMAND ${XALAN} ${XALAN_VALIDATE_OPTION} ${XALAN_PARAM_OPTION} menuPath \"${docVersion}/\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/index.html ${XALAN_INFILE_OPTION} ${docBuildFolder}/build/redirect.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/redirect.xsl)
# Create the main documentaion page. This is located in the version directory
execute_process(COMMAND ${XALAN} ${XALAN_VALIDATE_OPTION} ${XALAN_PARAM_OPTION} menuPath \"\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/${docVersion}/index.html ${XALAN_INFILE_OPTION} ${docBuildFolder}/build/homepage.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/main.xsl)

# This folder just gets copied as-is
# Note: Schemas are referenced inside the application xml files. The schema URI inside the xmls do not have version numbers in the path
Expand Down
23 changes: 23 additions & 0 deletions isis/src/docsys/build/redirect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<redirectPage>
<div class="isisNavigationBar">
<table>
<tr>
<td><img src="assets/banners/banner.jpg" width="600" height="106" alt="[USGS Banner]" border="0" usemap="#bannermap"/>
<map name="bannermap" id="bannermap">
<area shape="rect" target="_top" alt="Visit the USGS Home Page" coords="2,1,186,73" href="http://www.usgs.gov"
title="Visit the USGS Home Page"/>
<area shape="rect" target="_top" alt="Go to the Astrogeology Research Program Home Page" coords="2,75,249,102"
href="http://astrogeology.usgs.gov" title="Go to the Astrogeology Research Program Home Page"/>
<area shape="default" alt="USGS" nohref="nohref"/>
</map>
</td>
</tr>
</table>
</div>

<meta http-equiv="refresh" content="0; url='7.0.0/index.html'" />

<p>You were not rediected to the new home for ISIS documentation. Please follow: <a href="'7.0.0/index.html'">this link</a>.</p>

</redirectPage>
106 changes: 106 additions & 0 deletions isis/src/docsys/build/redirect.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="xmlns fo">

<!--
This stylesheet will be used to generate the top level index page which redirects to the current public release docs
Author
Deborah Lee Soltesz
04/15/2003
Updated to be just a redirect page
03/15/2022
-->

<xsl:include href="menu.xsl"/>

<xsl:output
media-type="text/html"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
indent="yes"
encoding="utf-8"
omit-xml-declaration="yes">
<xsl:template match="/">
<xsl:apply-templates select="//redirectPage" />
</xsl:template>
</xsl:output>

<xsl:template match="//redirectPage">
<html>
<head>
<title>USGS Isis: Planetary Image Processing Software</title>
<meta name="keywords" content="Isis, image processing, software, open source, remote sensing, planetary science, astrogeology"/>
<!-- need ratings tag -->
<meta name="description" content="Integrated Software for Imagers and Spectrometers (ISIS), created and managed by the USGS Astrogeology Research Program. ISIS provides a comprehensive, user-friendly, portable tool for processing, analyzing, and displaying remotely sensed image data."/>
<meta name="publisher" content="USGS - GD - Astrogeology Program"/>
<meta name="author" content="Deborah Lee Soltesz, [email protected]"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="country" content="USA"/>
<meta name="state" content="AZ"/>
<meta name="county" content="Coconino"/>
<meta name="city" content="Flagstaff"/>
<meta name="zip" content="86001"/>

<link rel="stylesheet" href="assets/styles/IsisStyleCommon.css"/>
<link rel="stylesheet" href="assets/styles/main.css"/>
<link rel="stylesheet" href="assets/styles/menu.css"/>
<link rel="stylesheet" media="print" href="assets/styles/print.css"/>

<script type="text/javascript" src="assets/scripts/homepage.js"></script>
<!-- Dynamic analytics insertion to prevent running on local URLs -->
<xsl:text>&#xa;</xsl:text>
<script type="text/javascript">
//<xsl:comment><![CDATA[
(function() {
var usgsAnalytics = document.createElement('script');
usgsAnalytics.type = 'text/javascript';
usgsAnalytics.async = true;
usgsAnalytics.src = 'http://www.usgs.gov/scripts/analytics/usgs-analytics.js';
if('http:' == document.location.protocol) {
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(usgsAnalytics, s);
}
})();
]]></xsl:comment>
<xsl:text>&#xa;</xsl:text>
</script>
<!-- ** end PAGE HEADER needs these scripts ** -->

</head>

<body>

<div class="isisMenu">
<xsl:call-template name="writeMenu"/>
</div>

<div class="isisContent">
<!--xsl:copy-of select="."/-->
<xsl:apply-templates select="* | text()" mode="copyContents"/>
</div>

<!-- end of body -->
</body>
</html>

</xsl:template>

<xsl:template match="*" mode="copyContents">
<xsl:element name="{name()}" namespace="{namespace-uri()}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="copyContents"/>
</xsl:element>
</xsl:template>

<xsl:template match="text()" mode="copyContents">
<xsl:value-of select="."/>
<xsl:apply-templates mode="copyContents"/>
</xsl:template>

</xsl:stylesheet>

0 comments on commit ed978e2

Please sign in to comment.