I need to test various themes. Install them through GIT, then overlay a few .MD files and run the local server. I have a bash script that I use for the hugo-tranquilpeak-4000-theme, but need to make the script more flexible to handle any theme.
Then simply parse the theme name to the script, like bash Hugo_install.sh theme_name
Here is the script at present.
cd ~/Hugo
# Cleanup
rm -r -f mysite
rm -r -f .git
rm .gitmodules
# New hugo site
hugo new site mysite
cd mysite
git init
# add the transquilpeak theme
git clone https://github.com/petems/hugo-tranquilpeak-4000-theme
# Remove .../content/basics, .../cont, ..shortcodes
rm -r -f ~/Hugo/mysite/hugo-tranquilpeak-4000-theme/exampleSite/content/posts
mkdir ~/Hugo/mysite/hugo-tranquilpeak-4000-theme/exampleSite/content/musings
mkdir ~/Hugo/mysite/hugo-tranquilpeak-4000-theme/exampleSite/content/images
mkdir ~/Hugo/mysite/static/images
# Copy Markdown (md) files , images & layouts mods
cp -r -v ~/Hugo/Backup/mysite/themes/hugo-tranquilpeak-4000-theme/exampleSite/content/musings/*.* ~/Hugo/mysite/hugo-tranquilpeak-4000-theme/exampleSite/content/musings/
cp -r -v ~/Hugo/Backup/mysite/themes/hugo-tranquilpeak-4000-theme/static/images/*.* ~/Hugo/mysite/hugo-tranquilpeak-4000-theme/exampleSite/content/images
# Copy configuration
cp ~/Hugo/Backup/mysite/themes/hugo-tranquilpeak-4000-theme/exampleSite/config.toml ~/Hugo/mysite/hugo-tranquilpeak-4000-theme/exampleSite/config.toml
# Cover image
cp ~/Hugo/Backup/mysite/themes/hugo-tranquilpeak-4000-theme/static/images/cover.jpg ~/Hugo/mysite/static/images/cover.jpg
I realise this is basic shell script work; if you can refresh my memory please, on how to (a) replace the hard coded theme name in the script, and then simply parse a theme name to the script.
Then I will be able to install/test various themes locally.