diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-08-25 18:28:05 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-08-25 18:28:05 +0000 |
| commit | 981aa5901cb704884424aafefb36acc5b9db84bd (patch) | |
| tree | 45e613144c772dd85493d95744d5d4bf76185227 /layouts/resize.sh | |
| parent | eff9404994dd754850e221675636edf58523242a (diff) | |
| download | themes-981aa5901cb704884424aafefb36acc5b9db84bd.tar.gz themes-981aa5901cb704884424aafefb36acc5b9db84bd.tar.bz2 themes-981aa5901cb704884424aafefb36acc5b9db84bd.zip | |
add a layout selection layer to existing themes - some themes have been updated to work with this method.
Diffstat (limited to 'layouts/resize.sh')
| -rwxr-xr-x | layouts/resize.sh | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/layouts/resize.sh b/layouts/resize.sh new file mode 100755 index 0000000..6471162 --- /dev/null +++ b/layouts/resize.sh @@ -0,0 +1,76 @@ +#!/bin/bash +echo "This script will resize statically sized layouts to whatever size you want. If +you have not modified the script manually, it will resize pixel values to work +with a total width of 900px instead of the original 700px. If this is not what +you want, please edit this file manually to suit your needs." +echo + +if [[ ( $1 == '--help' ) || ( $1 == '-h' ) || ( $1 == '?' ) ]] +then + exit +fi + +# Check to see if we've already made a backup +if [ -f layouts_css_backup.tar.gz ] +then + echo "I have found a css backup file. Please rename or remove the file +layouts_css_backup.tar.gz before executing this script again." + exit +fi + +echo "Creating backup of css files." +tar -czf layouts_css_backup.tar.gz *.css +echo +echo "Created backup in layouts_css_backup.tar.gz" +echo +echo "The script will continue in 5 seconds - hit <ctrl-c> to abort." +echo 5; sleep 1 +echo 4; sleep 1 +echo 3; sleep 1 +echo 2; sleep 1 +echo 1; sleep 1 +echo +echo "Executing substitutions." + +# This sample script will resize all statically set dimansions to work with 900px instead of 800px +# total width +find . -name "*.css" -exec perl -i -wpe 's/700px/900px/g' {} \; +# half the total width +find . -name "*.css" -exec perl -i -wpe 's/350px/450px/g' {} \; + +# one side column +find . -name "*.css" -exec perl -i -wpe 's/200px/260px/g' {} \; +# two side columns +find . -name "*.css" -exec perl -i -wpe 's/400px/520px/g' {} \; +# remainder of total width - one side column +find . -name "*.css" -exec perl -i -wpe 's/500px/640px/g' {} \; + +# narrow side column (used when there are 2 side columns in a static layout) +find . -name "*.css" -exec perl -i -wpe 's/150px/220px/g' {} \; +# two narrow side columns +find . -name "*.css" -exec perl -i -wpe 's/300px/440px/g' {} \; +# remainder of total width - one narrow side column +find . -name "*.css" -exec perl -i -wpe 's/550px/680px/g' {} \; + + + +## Use the replacements below to generate a very small layout that works with the layout_style.tar.gz +## This sample script will resize all statically set dimansions to work with 900px instead of 800px +## total width +#find . -name "*.css" -exec perl -i -wpe 's/700px/100px/g' {} \; +## half the total width +#find . -name "*.css" -exec perl -i -wpe 's/350px/50px/g' {} \; +# +## one side column +#find . -name "*.css" -exec perl -i -wpe 's/200px/29px/g' {} \; +## two side columns +#find . -name "*.css" -exec perl -i -wpe 's/400px/58px/g' {} \; +## remainder of total width - one side column +#find . -name "*.css" -exec perl -i -wpe 's/500px/71px/g' {} \; +# +## narrow side column (used when there are 2 side columns in a static layout) +#find . -name "*.css" -exec perl -i -wpe 's/150px/22px/g' {} \; +## two narrow side columns +#find . -name "*.css" -exec perl -i -wpe 's/300px/44px/g' {} \; +## remainder of total width - one narrow side column +#find . -name "*.css" -exec perl -i -wpe 's/550px/78px/g' {} \; |
