diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2826f01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +_site +/test-deploy.sh +.idea/ +Gemfile.lock +.DS_Store diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c1f0231 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "website-assets"] + path = website-assets + url = https://github.com/montrealrobotics/website-assets.git + branch = master diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9af220f --- /dev/null +++ b/Gemfile @@ -0,0 +1,9 @@ +source 'https://rubygems.org' +group :jekyll_plugins do + gem 'github-pages' + gem 'jekyll' + gem 'jekyll-paginate' + gem 'jekyll-scholar' + gem 'jemoji' + gem 'unicode_utils' +end \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fbf245d --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +# targets that aren't filenames +.PHONY: all clean deploy build serve + +all: build + + +build: + bundle exec jekyll build + +install: + bundle install + +# you can configure these at the shell, e.g.: +# SERVE_PORT=5001 make serve +SERVE_HOST ?= 127.0.0.1 +SERVE_PORT ?= 5000 + +serve: + bundle exec jekyll serve --port $(SERVE_PORT) --host $(SERVE_HOST) + +deploy: + git commit -am"updating"; git push + +clean: + $(RM) -r _site + +deploy: clean build + ./bin/deploy diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..f5a5831 --- /dev/null +++ b/_config.yml @@ -0,0 +1,24 @@ +url: https://montrealrobotics.github.io + +includes_dir: website-assets/_includes +layouts_dir: website-assets/_layouts +sass: + sass_dir: website-assets/_sass +asset_dir: /website-assets/assets + +base: '' + +# Navigation bar links. +navigation: + - title: Home + link: / + - title: People + link: /people.html + - title: Research + link: /research.html + - title: Publications + link: /publications/ + - title: Contact + link: /contact.html + - title: Blog + link: /blog.html \ No newline at end of file diff --git a/bin/deploy b/bin/deploy new file mode 100644 index 0000000..58e8ded --- /dev/null +++ b/bin/deploy @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +# Run this script to deploy the app to Github Pages + +# Parse cmd arguments + +SRC_BRANCH="source" +DEPLOY_BRANCH="master" + +USAGE_MSG="usage: deploy [-h|--help] [-u|--user] [-s|--src SRC_BRANCH] [-d|--deploy DEPLOY_BRANCH]" + +while [[ $# > 0 ]]; do + key="$1" + + case $key in + -h|--help) + echo $USAGE_MSG + exit 0 + ;; + -u|--user) + SRC_BRANCH="source" + DEPLOY_BRANCH="master" + shift + ;; + -s|--src) + SRC_BRANCH="$2" + shift + ;; + -d|--deploy) + DEPLOY_BRANCH="$2" + shift + ;; + *) + echo "Option $1 is unknown." + echo $USAGE_MSG + exit 0 + ;; + esac + shift +done + +# Exit if any subcommand fails +set -e + +echo "Deploying..." +echo "Source branch: $SRC_BRANCH" +echo "Deploy branch: $DEPLOY_BRANCH" + +read -r -p "Do you want to proceed? [y/N] " response +if [[ ! $response =~ ^([yY][eE][sS]|[yY])+$ ]] +then + echo "Aborting." + [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 +fi + +# Check if there are any uncommitted changes +if ! git diff-index --quiet HEAD --; then + echo "Changes to the following files are uncommitted:" + git diff-index --name-only HEAD -- + echo "Please commit the changes before proceeding." + echo "Aborting." + [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 +fi + +# Switch to source branch (creates it if necessary from the current branch) +if [ `git branch | grep $SRC_BRANCH | tr ' ' '\n' | tail -1` ] +then + git checkout $SRC_BRANCH +else + git checkout -b $SRC_BRANCH +fi + +# Checkout DEPLOY_BRANCH branch +if [ `git branch | grep $DEPLOY_BRANCH` ] +then + git branch -D $DEPLOY_BRANCH +fi +git checkout -b $DEPLOY_BRANCH + + +# Build site +bundle exec jekyll build + +git submodule deinit --all + +# Delete and move files +find . -maxdepth 1 ! -name '_site' ! -name '.git' ! -name '.gitignore' -exec rm -rf {} \; +mv _site/* . +rm -R _site/ +rm -rf .git/modules + +# Push to DEPLOY_BRANCH + +git add -fA +git commit --allow-empty -m "$(git log -1 --pretty=%B) [ci skip]" +git push -f -q origin $DEPLOY_BRANCH + + +git rm --cached website-assets +git commit -m"remove" +git push -f -q origin $DEPLOY_BRANCH +git add website-assets +git commit -m"add" +git push -f -q origin $DEPLOY_BRANCH + +# Move back to SRC_BRANCH +git checkout $SRC_BRANCH +rm -rf website-assets +git submodule init +git submodule update +cd website-assets +git checkout master +cd .. +echo "Deployed successfully!" + +exit 0 diff --git a/img/ADD_PROJECT_IMAGES_HERE b/img/ADD_PROJECT_IMAGES_HERE new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..fd078ab --- /dev/null +++ b/index.html @@ -0,0 +1,7 @@ +--- +layout: default +title: Project template +permalink: index.html +--- + +Edit this diff --git a/website-assets b/website-assets new file mode 160000 index 0000000..4b90f6b --- /dev/null +++ b/website-assets @@ -0,0 +1 @@ +Subproject commit 4b90f6b47f61cc859aab9adcf2e56c9c164f908c