|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Ruby version" |
|
ruby -v |
|
|
|
|
|
echo "Jekyll version" |
|
jekyll -v |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Create a new Jekyll site with the default theme" |
|
jekyll new . --skip-bundle --force |
|
|
|
|
|
|
|
echo "Deleting default .gitignore file Jekyll generated" |
|
GITIGNORE=.gitignore |
|
if test -f "$GITIGNORE"; then |
|
rm $GITIGNORE |
|
fi |
|
|
|
|
|
|
|
echo "Create a new .gitignore file" |
|
touch $GITIGNORE |
|
|
|
|
|
|
|
echo "Populating the .gitignore file" |
|
echo "_site/" >> $GITIGNORE |
|
echo ".sass-cache/" >> $GITIGNORE |
|
echo ".jekyll-cache/" >> $GITIGNORE |
|
echo ".jekyll-metadata" >> $GITIGNORE |
|
echo ".bundle/" >> $GITIGNORE |
|
echo "vendor/" >> $GITIGNORE |
|
echo "**/.DS_Store" >> $GITIGNORE |
|
|
|
|
|
echo "Add GitHub Pages to the bundle" |
|
bundle add "github-pages" --group "jekyll_plugins" --version 228 |
|
|
|
|
|
echo "Add required webrick dependency to the bundle" |
|
bundle add webrick |
|
|
|
|
|
echo "bundle install" |
|
bundle install |
|
echo "bundle update" |
|
bundle update |
|
|
|
|
|
|
|
|
|
|
|
|
|
git init -b main |
|
git add -A |
|
git commit -m "initial commit" |
|
|
|
|
|
var=$(pwd) |
|
BASEURL="$(basename $PWD)" |
|
|
|
|
|
echo "" |
|
echo "\033[1;32mDone configuring your Jekyll site! Here are the next steps:\033[00m" |
|
echo "1. Modify the baseurl and url in your _config.yml file:" |
|
echo " The baseurl is \033[1m/$BASEURL\033[0m" |
|
echo " The url is \033[1mhttps://YourGitHubUsername.github.io\033[0m" |
|
echo "2. Run Jekyll for the first time on your computer:" |
|
echo " \033[1mbundle exec jekyll serve --livereload\033[0m" |
|
echo " Look for the site at port 4000 (ex http://127.0.0.1:4000/)" |
|
echo " After testing, type CONTROL+C to stop Jekyll" |
|
echo "3. Commit all your changes to Git locally" |
|
echo "4. Publish your site to a new GitHub repo" |
|
echo " In Visual Studio Code, type:" |
|
echo " COMMAND+SHIFT+P (Mac) or CONTROL+SHIFT+P (Windows)" |
|
echo " Search for and select \033[1mPublish to GitHub\033[0m" |
|
echo " In most cases, you will make the repo public" |
|
echo " Follow the steps to complete the process" |
|
echo "5. In GitHub, enable GitHub Pages in the repo settings and test" |
|
echo " https://YourGitHubUserName.github.io/$BASEURL" |
|
echo "6. Continue developing locally and pushing changes to GitHub" |
|
echo " All your changes will publish to the website automatically after a few minutes" |
|
echo "" |
|
echo "7. Optionally, create a README.md at the root of this folder to provide yourself" |
|
echo " and others with pertinent details for building and using the repo" |
|
|