Make: add targets for running devservers, and avoid installing Hugo

Add `make` targets `devserver-webapp` and `devserver-website` to run
respectively Yarn and Hugo.

This also slightly changes how Hugo is invoked, from using the `hugo` CLI
command to `go run github.com/gohugoio/hugo@v0.101.0`. This avoids the
need to actually install Hugo locally, and also will use the correct
version of Hugo if the locally-installed version happens to be different.
This commit is contained in:
Sybren A. Stüvel 2023-09-08 15:39:20 +02:00
parent a229c0f75a
commit f951981a4c
2 changed files with 12 additions and 6 deletions

@ -38,6 +38,9 @@ JS_API_PKG_NAME=manager
# ANY ABSOLUTE PATH.
WEB_STATIC=web/static
# The Hugo package + its version.
HUGO_PKG := github.com/gohugoio/hugo@v0.101.0
# Prevent any dependency that requires a C compiler, i.e. only work with pure-Go libraries.
export CGO_ENABLED=0
@ -47,7 +50,6 @@ all: application
with-deps:
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.9.0
go install github.com/golang/mock/mockgen@v1.6.0
go install github.com/gohugoio/hugo@v0.101.0
$(MAKE) application
vet:
@ -236,10 +238,16 @@ clean-webapp-static:
mkdir -p ./${WEB_STATIC}
touch ${WEB_STATIC}/emptyfile
devserver-website:
go run ${HUGO_PKG} -s web/project-website serve
devserver-webapp:
yarn --cwd web/app run dev --host
deploy-website:
$(MAKE) -s check-environment
rm -rf web/project-website/public/
cd web/project-website; hugo --baseURL https://flamenco.blender.org/
go run ${HUGO_PKG} -s web/project-website --baseURL https://flamenco.blender.org/
rsync web/project-website/public/ ${WEBSERVER_SSH}:${WEBSERVER_ROOT}/ \
-e "ssh" \
-rl \

@ -14,12 +14,10 @@ has something to work with, even before any static files have been built.
The [Flamenco website](https://flamenco.blender.org/) runs off of [Hugo](https://gohugo.io/).
Hugo is automatically installed when running `make with-deps`, but you can also [manually install Hugo](https://gohugo.io/getting-started/installing/).
To locally run the site, run `make devserver-website`. Then visit https://localhost:1313/ in a webbrowser.
To locally run the site, from the `web/project-website` directory, start the server with:
Alternatively, [manually install Hugo](https://gohugo.io/getting-started/installing/). Then, from the `web/project-website` directory, start the server with:
```
hugo server -D
```
Then visit https://localhost:1313/ in a webbrowser.