From e750dd63b0a40c9ea9cbf6e41c9d6a07e5f23b50 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Wed, 14 May 2025 00:04:25 +1000 Subject: [PATCH] Initial implementation of templating system --- .gitignore | 2 ++ cgit.mk | 12 ++++++++++++ themed/htmlcc | 1 + 3 files changed, 15 insertions(+) create mode 120000 themed/htmlcc diff --git a/.gitignore b/.gitignore index 661df34..203799b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ cgitrc.5.pdf cgitrc.5.xml *.o *.d + +/themed/themed.c diff --git a/cgit.mk b/cgit.mk index 3fcc1ca..e582ca3 100644 --- a/cgit.mk +++ b/cgit.mk @@ -95,6 +95,8 @@ CGIT_OBJ_NAMES += ui-summary.o CGIT_OBJ_NAMES += ui-tag.o CGIT_OBJ_NAMES += ui-tree.o +CGIT_OBJ_NAMES += themed/themed.o + CGIT_OBJS := $(addprefix $(CGIT_PREFIX),$(CGIT_OBJ_NAMES)) # Only cgit.c reference CGIT_VERSION so we only rebuild its objects when the @@ -116,9 +118,19 @@ ifeq ($(wildcard $(CGIT_PREFIX).depend),) missing_dep_dirs += $(CGIT_PREFIX).depend endif +ifeq ($(wildcard $(CGIT_PREFIX)themed/.depend),) +missing_dep_dirs += $(CGIT_PREFIX)themed/.depend +endif + $(CGIT_PREFIX).depend: @mkdir -p $@ +$(CGIT_PREFIX)themed/.depend: + @mkdir -p $@ + +$(CGIT_PREFIX)themed/themed.c: $(CGIT_PREFIX)themed/index.html + cd $(CGIT_PREFIX)themed; python -m htmlcc $^ > $@ + $(CGIT_PREFIX)CGIT-CFLAGS: FORCE @FLAGS='$(subst ','\'',$(CGIT_CFLAGS))'; \ if test x"$$FLAGS" != x"`cat ../CGIT-CFLAGS 2>/dev/null`" ; then \ diff --git a/themed/htmlcc b/themed/htmlcc new file mode 120000 index 0000000..7f04398 --- /dev/null +++ b/themed/htmlcc @@ -0,0 +1 @@ +../../htmlcc/htmlcc \ No newline at end of file