Pārlūkot izejas kodu

:wrench: Make the project list available in every page

Useful to generate the dropdown list in the navbar.
DricomDragon 1 gadu atpakaļ
vecāks
revīzija
c22aaf5ccb
1 mainītis faili ar 3 papildinājumiem un 6 dzēšanām
  1. 3 6
      makefile

+ 3 - 6
makefile

@@ -25,7 +25,7 @@ DIST_FILES := $(DIST_GEN_FILES) $(DIST_INC_FILES) $(DIST_EMB_FILES)
 BUILD_VERSION := $(shell git describe)
 BUILD_DATE := $(shell date "+%F")
 
-PANDOC_GEN := pandoc --template src/templates/main.html --metadata-file src/meta.yml --metadata=build-date:$(BUILD_DATE) --metadata=build-version:$(BUILD_VERSION) --wrap=none
+PANDOC_GEN := pandoc --template src/templates/main.html --metadata-file src/meta.yml --metadata=build-date:$(BUILD_DATE) --metadata=build-version:$(BUILD_VERSION) --wrap=none --metadata-file $(GEN_LIST_YML)
 LIST_GEN := yq eval-all '{"data": ., "target": {"content": filename | sub("meta.yml", "html") | sub(".*/", ""), "dir": filename | sub("$(DIR_OF_PROJECTS)/", "") | sub("/[^/]*.yml", "")}} as $$item ireduce ([]; . + $$item) | {"list": .}'
 
 # Functions
@@ -37,19 +37,16 @@ extract_update_date = $(shell git log -1 --pretty="format:%cs" $(1))
 build: $(GEN_CONTENT_FILES)
 	$(info HTML generated)
 
-%.gen.html: %.src.html %.meta.yml $(SRC_TEMPLATES)
+%.gen.html: %.src.html %.meta.yml $(SRC_TEMPLATES) $(GEN_LIST_YML)
 	$(PANDOC_GEN) --metadata-file $*.meta.yml --metadata=category-$(call extract_category,$*) --metadata=update-date:$(call extract_update_date,$<) --output $@ $<
 
-%.gen.html: %.src.md %.meta.yml $(SRC_TEMPLATES)
+%.gen.html: %.src.md %.meta.yml $(SRC_TEMPLATES) $(GEN_LIST_YML)
 	$(PANDOC_GEN) --metadata-file $*.meta.yml --metadata=category-$(call extract_category,$*) --metadata=update-date:$(call extract_update_date,$<) --output $@ $<
 
 # Build lists
 $(GEN_LIST_YML): $(SRC_LIST_YML)
 	$(LIST_GEN) $(SRC_LIST_YML) > $@
 
-$(DIR_OF_PROJECTS)/content.gen.html: $(DIR_OF_PROJECTS)/content.src.html $(DIR_OF_PROJECTS)/content.meta.yml $(GEN_LIST_YML) $(SRC_TEMPLATES)
-	$(PANDOC_GEN) --metadata-file $(DIR_OF_PROJECTS)/content.meta.yml --metadata-file $(GEN_LIST_YML) --metadata=category-projets --metadata=update-date:$(call extract_update_date,$<) --output $@ $<
-
 # Distribution
 .PHONY: install
 install: $(DIST_DIR)