Feature request - nikola clone $source $dest

4 views
Skip to first unread message

Paraplegic Racehorse

unread,
Jul 3, 2016, 2:56:48 PM7/3/16
to nikola-...@googlegroups.com
Suppose I have a test site all complete with the features and themes I want but I need to rid myself of all the test content. And/or I want to build another site with the same look-n-feel. Other use-cases also probably exist, but I can't think of them at the moment. Anyway, I want to create a fresh nikola site with all the configs of some other nikola site, but none of the content.

Here's a quick-n-dirty bash script to achieve it, but integrating something like this into the core would be fantastic.

code:bash
----
#!/bin/bash

#
# USE
# $ nikolaclone [sourcedir] [targetdir]
#

nikola init -q $2
cp $1/conf.py $2/
cp $1/files/* $2/files/
if [ $1/plugins ]
then
cp -r $1/plugins $2/
fi
if [ $1/themes ]
then
cp -r $1/themes $2/
fi
----

I'm happy to create an issue if you think it necessary.

An alternate would be to maintain a base test site, from which to deploy new features to existing sites, by changing 'cp -r' to 'cp -l' and working some magic in the existing conf.py with awk, but awk is way beyond my scripting level.

--
I'm Paraplegic Racehorse.
"Grand Curmudgeon" :: International Discordance of Kilted Apiarists, Local #994.
http://www.paraplegicracehorse.net/
Reply all
Reply to author
Forward
0 new messages