From 49e005e118c78c59b452194812a982b5dd25de32 Mon Sep 17 00:00:00 2001 From: Leo Gavilieau Date: Sun, 21 May 2023 22:25:19 +0200 Subject: [PATCH] feat: auto-generated authors file --- Makefile | 14 +++++++++++--- utils/authors.md | 13 +++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 utils/authors.md diff --git a/Makefile b/Makefile index a740d3e..e67beaa 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,14 @@ INPUT_DIR=content STATIC_DIR=static OUTPUT_DIR=output +UTILS_DIR=utils # The pandoc template to use -TEMPLATE=utils/template.html +TEMPLATE=$(UTILS_DIR)/template.html # The pandoc lua filter to use # The language code and file extension will be appended later -FILTER=utils/link-filter. +FILTER=$(UTILS_DIR)/link-filter. ## You should not need to change anything beyond this line @@ -24,8 +25,15 @@ FILTER=utils/link-filter. STATIC=$(patsubst $(STATIC_DIR)/%,$(OUTPUT_DIR)/%,$(shell find $(STATIC_DIR) -type f)) OUTPUT=$(patsubst $(INPUT_DIR)/%.md,$(OUTPUT_DIR)/%/index.html,$(shell find $(INPUT_DIR) -type f)) -site: $(OUTPUT) $(STATIC) +# The last one is for the autogenerated authors thing. +site: $(OUTPUT) $(STATIC) $(OUTPUT_DIR)/authors/index.html +# This generates the authors file. +$(OUTPUT_DIR)/authors/index.html: $(UTILS_DIR)/authors.md + mkdir -p $(dir $@) + pandoc --from markdown+smart+yaml_metadata_block+auto_identifiers -V lastmod="$(shell git log --follow --format=%ad --date default $< | tail -1)" --to html --template $(TEMPLATE) $< -o $@ + +# Generate normal markdown $(OUTPUT_DIR)/%/index.html: $(INPUT_DIR)/%.md $(TEMPLATE) mkdir -p $(dir $@) pandoc --from markdown+smart+yaml_metadata_block+auto_identifiers -V lastmod="$(shell git log --follow --format=%ad --date default $< | tail -1)" --lua-filter=$(FILTER)$(shell echo $@ | cut -d / -f 2).lua --to html --template $(TEMPLATE) $< -o $@ diff --git a/utils/authors.md b/utils/authors.md new file mode 100644 index 0000000..40bb841 --- /dev/null +++ b/utils/authors.md @@ -0,0 +1,13 @@ +--- +title: "Wiki authors" +--- + +This page contains auto-generated usernames of all those who have contributed to the vern wiki. If you want your name to be here, then modify the `utils/authors.md` file with your name added in a new line, you may link to other sites here as well. + +* [~xmoo](https://xmoo.vern.cc) +* [~vitorg](https://vitorg.vern.cc) +* [~cobra](https://cobra.vern.cc) +* [~pjals](https://pjals.vern.cc) +* [Arya K.](https://arya.projectsegfau.lt/) +* hacker999 +* ajhalili2006