瀏覽代碼

:wrench: Add build version in footer

DricomDragon 1 年之前
父節點
當前提交
b810814b85
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      makefile
  2. 1 1
      src/templates/footer.html

+ 2 - 1
makefile

@@ -22,9 +22,10 @@ DIST_INC_FILES := $(INCLUDED_FILES:src/%=$(DIST_DIR)/%)
 DIST_EMB_FILES := $(EMBEDDED_FILES:src/%=$(DIST_DIR)/%)
 DIST_FILES := $(DIST_GEN_FILES) $(DIST_INC_FILES) $(DIST_DWN_FILES) $(DIST_EMB_FILES) $(DIST_DIR)/favicon.ico
 
+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) --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
 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

+ 1 - 1
src/templates/footer.html

@@ -2,7 +2,7 @@
     <div class="container">
         <span class="text-muted">
             Version
-            $version$
+            $build-version$
             du
             <span title="Site mis en ligne le $build-date$">$build-date$</span>
             -