Building a Zen sub-theme: In shell commands
From the Zen documentation How to build your own sub-theme (6.x), translated into bash commands. The project is called example, and we have installed the zen theme to sites/default/themes.
Someone enterprising could make this into a simple bash script.
UPDATE: Someone did turn this into a bash script that was later incorporated into the docs. Here is a modified version of a more robust script that was posted to Jason Chinn's Magicsparks site:
zen_subtheme.sh (Zipped, as shell files cannot be accessed in Drupal's files directory!)
Run it from the root of your Drupal directory after making sure Zen 1.0 is in your sites/all/themes directory (drush dl zen
will do that).
The command (substitute your new theme folder name, fixed for liquid if you want, theme title and description) is:
zen_subtheme.sh newthemename liquid "New theme title" "New theme description."
If you insist on doing it by hand, the commands to make it easy:
<code>
cd /sites/example/www/sites/default/themes
sudo cp -pr zen/STARTERKIT/ example_zen
cd example_zen/
sudo mv STARTERKIT.info example_zen.info
sudo vi example_zen.info
All right, the editing of the .info file will be hard to script. But all the rest should definitely be scriptified.
We're still in /sites/scfabout/www/sites/default/themes/example_zen and the Zen system of themes is next door.
Because fixed-width layout is evil we go straight for flexible (or as it's called here, liquid). Urgh, maybe on this project I should be using fixed with. OK, make this a variable in the script! Alternate line is cp -p ../zen/zen/layout-fixed.css layout.css
sudo cp -p ../zen/zen/layout-liquid.css layout.css
sudo cp -p ../zen/zen/print.css print.css
sudo cp -p ../zen/zen/zen.css example_zen.css
Then the next steps of editing template.php and theme-settings.php to replace "STARTERKIT" with your theme name ("example_zen" in this case) could be scripted also.
Comments
Here's an experiment with getting the initial Zen from CVS
Using the latest in the Drupal-5 branch, with the idea that we'd be able to update it to a stable version later:
cd www/sites/default/
sudo mkdir themes
cd themes
sudo cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-5 -d zen contributions/themes/zen
What's this comment about Drupal 5 for?
Seems off-topic and points to a potentially dangerous mental instability on the part of the poster.
sed grep rename to build from zen starterkit
Has this work developed further by now? I imagine a little sed could assist in a script to make it a single command flow..
zenophile exists for automating zen subtheme creation
Oops. Here's what I get for commenting on a 2yr old post ;) Let me cover my tracks a bit for future wanderers:
http://drupal.org/project/zenophile
Post new comment