campingmontagut/Makefile
jordi fita mas f963f54839 Add profile form, inside a user menu
This is the first form that uses HTMx, and can not return a 400 error
code because otherwise HTMx does not render the content.

Since now there are pages that do not render the whole html, with header
and body, i need a different layout for these, and moved the common code
to handle forms and such a new template file that both layouts can use.
I also need the request in template.MustRender to check which layout i
should use.

Closes #7.
2023-07-26 20:46:09 +02:00

27 lines
889 B
Makefile

HTML_FILES := $(shell find web -name *.gohtml)
GO_FILES := $(shell find . -name *.go)
DEFAULT_DOMAIN = camper
POT_FILE = po/$(DEFAULT_DOMAIN).pot
LINGUAS = ca es
MO_FILES = $(patsubst %,locale/%/LC_MESSAGES/$(DEFAULT_DOMAIN).mo,$(LINGUAS))
XGETTEXTFLAGS = --no-wrap --from-code=UTF-8 --package-name=camper --msgid-bugs-address=jordi@tandem.blog
locales: $(MO_FILES)
locale/%/LC_MESSAGES/camper.mo: po/%.po
mkdir -p $(@D)
msgfmt -o $@ $<
po/%.po: $(POT_FILE)
msgmerge --no-wrap --update --backup=off $@ $<
$(POT_FILE): $(HTML_FILES) $(GO_FILES)
xgettext $(XGETTEXTFLAGS) --language=Scheme --output=$@ --keyword=pgettext:1,2c $(HTML_FILES)
xgettext $(XGETTEXTFLAGS) --language=C --output=$@ --keyword=Gettext:1 --keyword=GettextNoop:1 --keyword=Pgettext:1,2c --join-existing $(GO_FILES)
test-deploy:
sqitch deploy --db-name $(PGDATABASE)
pg_prove test/*
.PHONY: locales test-db