This is a bash script that is used to bootstrap new Jekyll projects. It currently supports Strapi and Drone-CI integration. The plugins and .env data must be added for Strapi and Drone-CI integration to work.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

121 lines
3.7 KiB

#!/bin/sh
# run this script in the current directory you would like the site to be created in.
# requirements: bash; script works only in unix type environments.
# changes directory back into root directory
cd ..
# create base Jekyll site directory structure
mkdir -p ./assets/css/images
mkdir -p ./assets/icons
mkdir -p ./assets/images
mkdir -p ./assets/js
mkdir -p ./assets/webfonts
mkdir -p ./collections/_drafts
mkdir -p ./collections/_posts
mkdir -p ./collections/_products
mkdir -p ./_data
# these directories are for Strapi CMS integration
mkdir -p ./_data/authors
mkdir -p ./_data/posts
mkdir -p ./_data/products
mkdir -p ./_plugins
mkdir -p ./_includes
mkdir -p ./_layouts
mkdir -p ./pages/posts
mkdir -p ./pages/products
mkdir -p ./_scss
mkdir -p ./uploads/authors
mkdir -p ./docs
# create default Jekyll root files with docker and drone ci support.
touch .drone.yml _config.yml robots.txt sitemap.xml COPYING Gemfile humans.txt LICENSE README.md .env .gitignore docker-compose.yml
# create default Jekyll _layouts
touch ./_layouts/default.html
touch ./_layouts/post.html
touch ./_layouts/posts.html
touch ./_layouts/product.html
touch ./_layouts/products.html
touch ./_layouts/page.html
touch ./_layouts/landing.html
# create default Jekyll _includes
touch ./_includes/head.html
touch ./_includes/header.html
touch ./_includes/footer.html
touch ./_includes/navigation.html
touch ./_includes/pagination.html
touch ./_includes/back-to-top.html
touch ./_includes/post_hero.html
touch ./_includes/post_related.html
touch ./_includes/post_category.html
touch ./_includes/post_rest.html
touch ./_includes/post_related.html
touch ./_includes/post_featured.html
touch ./_includes/product_hero.html
touch ./_includes/product_definition.html
touch ./_includes/product_rest.html
touch ./_includes/product_related.html
touch ./_includes/product_featured.html
touch ./_includes/product_grid_gallery.html
touch ./_includes/product_category.html
touch ./_includes/author_card.html
touch ./_includes/sections.html
touch ./_includes/banner.html
# create default _data files with Strapi CMS integration
touch ./_data/menus.yml
touch ./_data/socials.yml
touch ./_data/global.yml
# add default contents to each file with another bash script
cp -vf ./st-jekyll-bootstrap/templates/* ./
# to copy hidden files ONLY, we must specify these manually
cp -vf ./st-jekyll-bootstrap/templates/.gitignore ./
cp -vf ./st-jekyll-bootstrap/templates/.drone.yml ./
# add default _data files
cp -vf ./st-jekyll-bootstrap/templates/docs/* ./docs/
# add default contents to each file with another bash script
cp -vrf ./st-jekyll-bootstrap/templates/pages/* ./pages/
# add default _data files
cp -vf ./st-jekyll-bootstrap/templates/data/* ./_data/
# add default _layouts templates
cp -vf ./st-jekyll-bootstrap/templates/layouts/* ./_layouts/
# add default _includes templates
cp -vf ./st-jekyll-bootstrap/templates/includes/* ./_includes/
# move all assets data into assets folder
cp -vrf ./st-jekyll-bootstrap/templates/assets/* ./assets/
# move all scss data into _scss folder
cp -vrf ./st-jekyll-bootstrap/templates/scss/* ./_scss/
# move all posts data into collection/_posts/ folder
cp -vf ./st-jekyll-bootstrap/templates/posts/* ./collections/_posts/
# move all image data into uploads/ folder
cp -vrf ./st-jekyll-bootstrap/templates/uploads/* ./uploads/
# cleanup script data
cat <<EOF
__ _ _____ _
/ _\ |__ __ _ _ __ _ __ __/__ \_ __ ___ _ __ (_) ___ ___
\ \| _ \ / _ | __| _ \ / _ \/ /\/ __/ _ \| _ \| |/ __/ __|
_\ \ | | | (_| | | | |_) | __/ / | | | (_) | | | | | (__\__ |
\__/_| |_|\__ _|_| | __/ \___\/ |_| \___/|_| |_|_|\___|___/
|_|
EOF