Utilities/tosupportpage.sh
author Robert Vehse <robertvehse@fastmail.fm>
Wed, 22 Mar 2017 01:44:16 +0100
branchadium-1.5.10.3
changeset 5961 aea3529ae847
parent 5839 b7966704c82d
permissions -rwxr-xr-x
Utilities: Update tosupportpage.sh script
* Use https for NetworkRedux
* Fix link for "Apple Design Awards"
#!/bin/sh

# Usage: tosupportpage path/to/www/help

# This very ugly script adds a header and footer to each help page, makes sure
# the formatting is consistent etc. to incorporate them in the Adium website.
# Give it a path to /help/ in a checkout of https://hg.adium.im/www/adium.im/.

if [ $# -ne 1 ]
then
	echo "Usage: $0 path/to/www/help"
	exit -1
fi

mkdir -p $1

for file in ../AdiumHelp/pgs/*; do
cat "$file"\
| sed 's|</head>|<link href="../css/common.css" type="text/css" rel="stylesheet" media="all" />\
<link rel="stylesheet" type="text/css" href="../../styles/layoutstyle.css" />\
<link rel="stylesheet" type="text/css" href="../../styles/defaultstyle.css" />\
</head>|g'\
| sed 's|<body>|<body>\
<div id="container">\
		<div id="titlecontainer">\
			<a href="/">Adium</a>\
        </div>\
		<div id="navcontainer">\
			<a class="navtab" href="https://adium.im/">Download</a>\
			<a class="navtab" href="https://adium.im/about">About</a>\
			<a class="navtab" href="https://adium.im/blog/">Blog</a>\
			<a class="navtabcurrent" href="https://adium.im/help">Help</a>\
			<a class="navtab" href="https://trac.adium.im">Development</a>\
			<a class="navtab" href="https://adium.spreadshirt.com">Merchandise</a>\
			<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>\
		</div>|g'\
		| sed 's|</body>|	<div id="footer">					<div class="donate">\
									<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;submit.x=57&amp;submit.y=8&amp;encrypted=-----BEGIN+PKCS7-----%0D%0AMIIHFgYJKoZIhvcNAQcEoIIHBzCCBwMCAQExggEwMIIBLAIBADCBlDCBjjELMAkG%0D%0AA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQw%0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pdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRww%0D%0AGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkq%0D%0AhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNDAzMjUwNDQ0%0D%0AMzRaMCMGCSqGSIb3DQEJBDEWBBRzTAS6zk5cmMeC49IorY8CM%2BkX0TANBgkqhkiG%0D%0A9w0BAQEFAASBgBsyRfMv9mSyoYq00wIB7BmUHFGq5x%2Ffnr8M24XbKjhkyeULk2NC%0D%0As4jbCgaWNg6grvccJtjbvmDskMKt%2BdS%2BEAkeWwm1Zf%2F%2B5u1fMyb5vo1NNcRIs5oq%0D%0A7SvXiLTPRzVqzQdhVs7PoZG0i0RRIb0tMeo1IssZeB2GE5Nsg0D8PwpB%0D%0A-----END+PKCS7-----">\
									Donate to Adium</a>\
									</div>\
								<div id="powered" style="opacity: 100%">\
									<a href="https://developer.apple.com/design/awards/"><img class="libgaim" src="../../images/ada.png" alt="Apple design awards 05 special mention"></a>\
									<a href="https://www.pidgin.im"><img class="libgaim" src="../../images/powered_by_libpurple.png" alt="Adium is powered by libpurple"></a>\
									<a class="cachefly" href="https://www.cachefly.com"><img src="../../images/cachefly.png" alt="CacheFly Logo"></a>\
									<a class="networkredux" href="https://networkredux.com"><img src="../../images/network_redux.png" alt="Network Redux Logo"></a>\
								</div>\
							</div>\
			</body>|g'\
			| sed 's|<a class="navleftsty" href="../AdiumHelp.html">Adium Help</a> <a class="navleftsty" href="AdiumDocumentation.html">Adium Documentation</a>|<a class="navleftsty" href="../">Adium Help</a> <a class="navleftsty" href="https://adium.im/screencasts/">Adium Videos</a> <a class="navleftsty active" href="AdiumDocumentation.html">Adium Documentation</a>|g'\
			| sed 's|</title>| - Adium Documentation</title>|g'\
			| sed 's|<div id="pagetitle">|<div id="pagetitle"> <h3><span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/help" itemprop="url"><img src="../gfx/AdiumIcon.png" alt="Adium Icon" height="32" width="32" border="0" /><span itemprop="title">Adium Help</span></a></span> \&gt; <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="AdiumDocumentation.html" itemprop="url"><span itemprop="title">Adium Documentation</span></a></span> \&gt; </h3>|g'\
			 > "$1/pgs/$(basename $file)"
done

find ../AdiumHelp/gfx/ -type f|while read file
do
cp -v "$file" "$1/gfx/${file##*/}"
done