mirror of
https://github.com/mudler/luet.git
synced 2025-09-05 01:00:44 +00:00
📓 Add docs alongside
This commit is contained in:
30
docs/scripts/build.sh
Executable file
30
docs/scripts/build.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_URL="${BASE_URL:-https://luet.io}"
|
||||
|
||||
binpath="${ROOT_DIR}/bin"
|
||||
publicpath="${ROOT_DIR}/public"
|
||||
|
||||
if [ ! -e "${binpath}/hugo" ];
|
||||
then
|
||||
[[ ! -d "${binpath}" ]] && mkdir -p "${binpath}"
|
||||
wget https://github.com/gohugoio/hugo/releases/download/v"${HUGO_VERSION}"/hugo_extended_"${HUGO_VERSION}"_"${HUGO_PLATFORM}".tar.gz -O "$binpath"/hugo.tar.gz
|
||||
tar -xvf "$binpath"/hugo.tar.gz -C "${binpath}"
|
||||
rm -rf "$binpath"/hugo.tar.gz
|
||||
chmod +x "$binpath"/hugo
|
||||
fi
|
||||
|
||||
rm -rf "${publicpath}" || true
|
||||
[[ ! -d "${publicpath}" ]] && mkdir -p "${publicpath}"
|
||||
|
||||
# Note: It needs
|
||||
# sudo npm install -g postcss-cli
|
||||
#
|
||||
|
||||
npm install -D --save autoprefixer
|
||||
npm install -D --save postcss-cli
|
||||
|
||||
HUGO_ENV="production" "${binpath}/hugo" --gc -b "${BASE_URL}" -d "${publicpath}"
|
||||
|
||||
cp -rf CNAME $publicpath
|
14
docs/scripts/publish.sh
Executable file
14
docs/scripts/publish.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
"${ROOT_DIR}"/scripts/build.sh
|
||||
|
||||
git branch -D gh-pages || true
|
||||
|
||||
git checkout --orphan gh-pages
|
||||
|
||||
git rm -rf .
|
||||
|
||||
cp -rfv public/* ./
|
||||
rm -rf public/
|
||||
|
14
docs/scripts/serve.sh
Executable file
14
docs/scripts/serve.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
binpath="${ROOT_DIR}/bin"
|
||||
if [ ! -e "${binpath}/hugo" ];
|
||||
then
|
||||
[[ ! -d "${binpath}" ]] && mkdir -p "${binpath}"
|
||||
wget https://github.com/gohugoio/hugo/releases/download/v"${HUGO_VERSION}"/hugo_extended_"${HUGO_VERSION}"_"${HUGO_PLATFORM}".tar.gz -O "$binpath"/hugo.tar.gz
|
||||
tar -xvf "$binpath"/hugo.tar.gz -C "${binpath}"
|
||||
rm -rf "$binpath"/hugo.tar.gz
|
||||
chmod +x "$binpath"/hugo
|
||||
fi
|
||||
|
||||
"${binpath}/hugo" --baseURL="$BASE_URL" -s "$ROOT_DIR" serve
|
Reference in New Issue
Block a user