From 0ceda48fe9f706c098837996ee4008361e6d6268 Mon Sep 17 00:00:00 2001 From: Andrew Stryker Date: Sat, 13 Jul 2024 11:53:09 -0700 Subject: [PATCH] Add hugo serve target --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index b393271..4fe6f59 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,14 @@ # #-----------------------------------------------------------------------------# +SHELL = /usr/bin/bash + DEST ?= axs@sdf.org:html SITE_URL ?= https://axs.sdf.org +HUGO_SERVE_FLAGS ?= --buildDrafts +hugo_serve_cmd = hugo server ${HUGO_SERVE_FLAGS} + help_generator = generate-help.awk #-----------------------------------------------------------------------------# @@ -55,6 +60,17 @@ publish: build #> Publish site @echo "✓ Publising complete" @echo "\nThe site should be available on ${SITE_URL}" +serve: #> Start a Hugo server + @if [[ -z $${TMUX} ]]; \ + then \ + echo not tmux; \ + else \ + echo Starting a Hugo server in a new Tmux window; \ + tmux neww ${hugo_serve_cmd}; \ + fi + + + help: #> Generate this help message @gawk -f ${help_generator} $(MAKEFILE_LIST)