File: default-site

package info (click to toggle)
jekyll 3.9.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,604 kB
  • sloc: ruby: 15,325; javascript: 1,455; sh: 214; xml: 29; makefile: 7
file content (29 lines) | stat: -rwxr-xr-x 1,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# Runs the `jekyll new` command and builds the default site as a sanity check

set -e

echo "$0: setting up tmp directory"
mkdir -p ./tmp
rm -Rf ./tmp/default-site

echo "$0: creating new default site"
bundle exec jekyll new tmp/default-site
pushd tmp/default-site

echo "$0: respecifying the jekyll install location"
ruby -e "contents = File.read('Gemfile'); File.write('Gemfile', contents.sub(/gem \"jekyll\".*\\n/, 'gem \"jekyll\", path: \"../../\"'))"
if [ -n "$KRAMDOWN_VERSION" ]; then
  echo "$0: respecifying the kramdown version"
  ruby -e "contents = File.read('Gemfile'); File.write('Gemfile', contents.sub(/gem \"kramdown-parser-gfm\".*\\n/, ''))"
  echo "gem 'kramdown', '~> $KRAMDOWN_VERSION'" >> Gemfile
fi
if [ -n "$ROUGE_VERSION" ]; then
  echo "$0: respecifying the rouge version"
  echo "gem 'rouge', '~> $ROUGE_VERSION'" >> Gemfile
fi
echo "$0: installing default site dependencies"
BUNDLE_GEMFILE=Gemfile bundle install
echo "$0: building the default site"
BUNDLE_GEMFILE=Gemfile bundle exec jekyll build --verbose --profile
popd