From a12b0b1f76acd41fdde85686a35ff38350c398b3 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 11 Jan 2019 17:17:11 +0000 Subject: [PATCH] Add build pipeline --- .gitignore | 1 + config.yml | 6 ++++-- content/_index.md | 0 layouts/index.html | 14 ++++++++++++++ layouts/partials/script.html | 2 ++ layouts/partials/style.html | 2 ++ scripts/build.sh | 9 +++++++++ 7 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 content/_index.md create mode 100644 layouts/index.html create mode 100644 layouts/partials/script.html create mode 100644 layouts/partials/style.html create mode 100755 scripts/build.sh diff --git a/.gitignore b/.gitignore index 72e9ae4..19b8efa 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,4 @@ typings/ .dynamodb/ # End of https://www.gitignore.io/api/node,hugo +static/build diff --git a/config.yml b/config.yml index 130f41c..9e4497d 100644 --- a/config.yml +++ b/config.yml @@ -1,11 +1,13 @@ baseURL: http://example.org/ title: My New Hugo Site -staticDir: - - node_modules/materialize-css/dist +staticDir: static/build +assetDir: static/build disableKinds: - sitemap + - taxonomyTerm + - 404 outputs: home: diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..e69de29 diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..5ff08b6 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,14 @@ + + + + + + Page Title + + + {{ partial "style.html" "css/materialize.css" }} + + + {{ partial "script.html" "js/materialize.js" }} + + diff --git a/layouts/partials/script.html b/layouts/partials/script.html new file mode 100644 index 0000000..2a6a9a0 --- /dev/null +++ b/layouts/partials/script.html @@ -0,0 +1,2 @@ +{{ $script := resources.Get . | minify | fingerprint }} + diff --git a/layouts/partials/style.html b/layouts/partials/style.html new file mode 100644 index 0000000..7012e30 --- /dev/null +++ b/layouts/partials/style.html @@ -0,0 +1,2 @@ +{{ $style := resources.Get . | toCSS | minify | fingerprint }} + diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..8a19362 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +mkdir -p static/build + +cp -r node_modules/materialize-css/dist/* static/build/ + +hugo -v