first commit

This commit is contained in:
Florian du Garage Num 2023-12-15 16:14:36 +01:00
commit 6db283eb13
4 changed files with 40 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
#Hugo-Buildpack
## What is it?
A buildpack for easy deploy hugo website on dokku / heroku
## How to use it?

25
bin/compile Normal file
View File

@ -0,0 +1,25 @@
#!/bin/sh
BUILD_DIR=$1
HUGO_VERSION=$(grep 'hugoVersion' $BUILD_DIR/config.yaml | cut -d '"' -f 2)
if [ -z "$HUGO_VERSION" ]; then
HUGO_VERSION="0.111.2" # default version
fi
# Download and install Hugo
curl -s https://api.github.com/repos/gohugoio/hugo/releases/tags/v$HUGO_VERSION \
| grep browser_download_url \
| grep linux-amd64.deb \
| grep extended \
| cut -d '"' -f 4 \
| wget -i -
dpkg -i hugo*_linux-amd64.deb
rm hugo*_linux-amd64.deb
cd $BUILD_DIR
hugo

8
bin/detect Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# check if config.toml or config.yaml exists
if [ -f "config.toml" ] || [ -f "config.yaml" ]; then
exit 0
else
exit 1
fi

0
bin/release Normal file
View File