Browse Source

build script

itix-theme
Nicolas Massé 5 years ago
parent
commit
65970aead2
  1. 25
      hugo
  2. 4
      netlify.toml

25
hugo

@ -0,0 +1,25 @@
#!/bin/sh
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
function cleanup() {
trap - SIGINT SIGTERM ERR EXIT
find content/french -type l -print0 | while IFS= read -r -d $'\0' filename; do
if realpath "$filename" | grep -E "^$PWD/" > /dev/null; then
rm -f "$filename"
fi
done
}
(cd content/english && find * -type f -name '*.md') | while read file; do
if [ ! -e "content/french/$file" ]; then
ln -s ../../../content/english/$file content/french/$file
fi
done
find content/french -xtype l -exec rm -f {} \;
hugo gen chromastyles --style=borland > static/css/chroma.css
hugo "$@"

4
netlify.toml

@ -1,6 +1,6 @@
[build]
publish = "public"
command = "hugo gen chromastyles --style=perldoc > static/css/chroma.css && hugo"
command = "./hugo"
[build.environment] # Global
HUGO_VERSION = "0.42"
@ -9,7 +9,7 @@ HUGO_VERSION = "0.42"
HUGO_VERSION = "0.42"
[context.deploy-preview]
command = "hugo gen chromastyles --style=perldoc > static/css/chroma.css && hugo --buildDrafts --buildFuture --baseURL $DEPLOY_PRIME_URL"
command = "./hugo --buildDrafts --buildFuture --baseURL $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_ENABLEGITINFO = "true"

Loading…
Cancel
Save