diff --git a/.gitignore b/.gitignore index cec7f1f..47ef57d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ website/.jekyll-metadata env.sh website/main.sh +website/assets/build +website/.lanyon +website/.lanyon/vendor/bin diff --git a/.travis.yml b/.travis.yml index 4891a5a..4158a29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: test/acceptance.sh deploy: skip_cleanup: true provider: script - script: website/_bin/deploy.sh + script: website/_scripts/deploy.sh on: branch: master condition: $TRAVIS_OS_NAME = linux diff --git a/FAQ.md b/FAQ.md index e073d99..8aca1c9 100644 --- a/FAQ.md +++ b/FAQ.md @@ -108,8 +108,8 @@ The source mainly consists of: - `./FAQ.md` (FAQ page) - `./CHANGELOG.md` (changelog page) - `./website/_layouts/default.html` (the design in which all pages are rendered) -- `./website/public/app.js` (main JS file) -- `./website/public/style.css` (main CSS file) +- `./website/assets/app.js` (main JS file) +- `./website/assets/style.css` (main CSS file) The rest is dark magic from which you should probably steer clear. : ) diff --git a/package.json b/package.json index 08c16cc..cc70043 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Copypastable templates to write better bash scripts", "version": "2.1.0", "scripts": { - "deploy": "website/_bin/travis-deploy.sh", + "deploy": "website/_scripts/deploy.sh", "lint": "shellcheck --shell=bash $(find . -name '*.sh' -maxdepth 2)", "release:major": "env SEMANTIC=major npm run release", "release:minor": "env SEMANTIC=minor npm run release", @@ -13,19 +13,28 @@ "test": "test/acceptance.sh", "version:current": "node -e 'console.log(require(\"./package.json\").version)'", "version:replace": "replace 'v\\d+\\.\\d+\\.\\d+' \"v$(npm run --silent version:current)\" main.sh src/*.sh", - "web:build": "cd website && bundle exec jekyll build --incremental", - "web:inject": "./website/_bin/inject.sh", - "web:install": "npm install && cd website && bundle install --path ./_vendor", - "web:preview": "npm-run-all web:install --parallel web:watch web:serve", - "web:serve": "cd website/_site && browser-sync start --server --files .", - "web:watch": "nodemon --verbose --watch ./ --ignore 'website/*.md' --ignore 'website/_site/*' --ext html,json,md,js,css,png,jpg --exec 'npm-run-all web:inject web:build'" + "web:build:production": "LANYON_ENV=production lanyon build", + "web:serve:production": "LANYON_ENV=production lanyon serve", + "web:build": "lanyon build", + "web:inject": "./website/_scripts/inject.sh", + "web:injecter": "nodemon --verbose --watch ./ --ignore 'website/*.md' --ignore website/_site --ignore website/.lanyon --ext html,json,md,js,css,png,jpg --exec 'npm run web:inject'", + "web:start:production": "npm-run-all web:inject web:build:production web:serve:production", + "web:starter": "lanyon start", + "web:start": "npm-run-all --parallel web:injecter web:starter" + }, + "lanyon": { + "projectDir": "website", + "entries": [ + "app" + ] }, "dependencies": { - "fakefile": "0.0.6" + "fakefile": "0.0.6", + "lanyon": "0.0.12" }, "devDependencies": { - "cross-env": "1.0.7", "browser-sync": "2.11.0", + "cross-env": "1.0.7", "nodemon": "1.8.1", "npm-run-all": "2.1.1" } diff --git a/website/.bundle/config b/website/.bundle/config deleted file mode 100644 index 056960e..0000000 --- a/website/.bundle/config +++ /dev/null @@ -1,3 +0,0 @@ ---- -BUNDLE_PATH: "./_vendor" -BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/website/_bin/deploy.sh b/website/_bin/deploy.sh deleted file mode 100755 index 8d9e5a4..0000000 --- a/website/_bin/deploy.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash -# This file: -# -# - Let's inject.sh inject markdown files into the ./website directory -# - Syncs that to a temporary directory along with a git init -# - (in case of Travis CI) assumes a Git bot identity, and uses an overriden GHPAGES_URL containing its token thanks to `travis encrypt` -# - Force pushes that to the gh-pages branch -# -# Usage: -# -# ./deploy.sh -# -# Based on a template by BASH3 Boilerplate v2.0.0 -# http://bash3boilerplate.sh/#authors -# -# The MIT License (MIT) -# Copyright (c) 2013 Kevin van Zonneveld and contributors -# You are not obligated to bundle the LICENSE file with your b3bp projects as long -# as you leave these references intact in the header comments of your source files. - -# Exit on error. Append || true if you expect an error. -set -o errexit -# Exit on error inside any functions or subshells. -set -o errtrace -# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR -set -o nounset -# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip` -set -o pipefail -# Turn on traces, useful while debugging but commented out by default -# set -o xtrace - -# Set magic variables for current file, directory, os, etc. -__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -__file="${__dir}/$(basename "${BASH_SOURCE[0]}")" -__base="$(basename ${__file} .sh)" - -ghpages_repo=${GHPAGES_REPO:-"kvz/bash3boilerplate"} -ghpages_branch=${GHPAGES_BRANCH:-"gh-pages"} -ghpages_url=${GHPAGES_URL:-"git@github.com:${ghpages_repo}.git"} - -echo "--> Deploying to GitHub pages.." - -${__dir}/inject.sh - -if [ "${TRAVIS:-}" = "true" ]; then - git config --global user.name 'lekevbot' - git config --global user.email 'bot@kvz.io' -fi - -mkdir -p /tmp/deploy-${ghpages_repo} - -# Custom steps -rsync \ - --archive \ - --delete \ - --exclude=.git* \ - --exclude=node_modules \ - --exclude=lib \ - --checksum \ - --no-times \ - --no-group \ - --no-motd \ - --no-owner \ -./website/ /tmp/deploy-${ghpages_repo} > /dev/null - -echo 'This branch is just a deploy target. Do not edit. You changes will be lost.' \ - |tee /tmp/deploy-${ghpages_repo}/README.md - -(cd /tmp/deploy-${ghpages_repo} \ - && git init && git checkout -B ${ghpages_branch} && git add --all . \ - && git commit -nm "Update ${ghpages_repo} website by ${USER}" \ - && (git remote add origin ${ghpages_url}|| true) \ - && git push origin ${ghpages_branch}:refs/heads/${ghpages_branch} --force) > /dev/null - -rm -rf /tmp/deploy-${ghpages_repo} diff --git a/website/_config.yml b/website/_config.yml index ebbb601..4acc86b 100644 --- a/website/_config.yml +++ b/website/_config.yml @@ -1,2 +1,4 @@ +title: BASH3 Boilerplate + gems: - jekyll-redirect-from diff --git a/website/_layouts/default.html b/website/_layouts/default.html index c54ec74..aa0efa0 100644 --- a/website/_layouts/default.html +++ b/website/_layouts/default.html @@ -2,13 +2,18 @@ + {% if page.url == "/" %} + {{page.title}} + {% else %} + {{page.title}} | {{site.title}} + {% endif %} + {{page.title}} - - +
@@ -66,7 +71,7 @@ - +