diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-08-18 23:03:40 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-08-18 23:03:40 +0200 |
| commit | 338f941477ef6815bd4638bf166f1fddb5a4b3d3 (patch) | |
| tree | 31527fdc4a758345b9d969d2d401af4253b6f357 /repo/www | |
| parent | b5205f3253e745083f55f40f4a5e64cb2da39aac (diff) | |
| download | memory-leaks-338f941477ef6815bd4638bf166f1fddb5a4b3d3.tar.xz | |
Rename some variables
Diffstat (limited to 'repo/www')
| -rw-r--r-- | repo/www/Makefile | 18 | ||||
| -rw-r--r-- | repo/www/convert-internal-links.lua | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/repo/www/Makefile b/repo/www/Makefile index 9a804db..f88672c 100644 --- a/repo/www/Makefile +++ b/repo/www/Makefile @@ -1,6 +1,6 @@ TOP_DIR = ../.. OUT_DIR = $(TOP_DIR)/public -TEXT_FILES = md org +EXTENSIONS = md org V = 0 v = $(call v_$(V),$(1),$(2)) @@ -10,9 +10,9 @@ v_1 = dirname = $(patsubst %/,%,$(dir $(1))) dirnames = $(sort $(call dirname,$(1))) -text_patterns = $(foreach ext,$(TEXT_FILES),'$(TOP_DIR)/**.$(ext)') -text_folders = $(call dirnames,$(shell git ls-files $(text_patterns))) -top_readme = $(shell git ls-files $(addprefix $(TOP_DIR)/README.,$(TEXT_FILES))) +page_patterns = $(foreach ext,$(EXTENSIONS),'$(TOP_DIR)/**.$(ext)') +page_folders = $(call dirnames,$(shell git ls-files $(page_patterns))) +top_readme = $(shell git ls-files $(addprefix $(TOP_DIR)/README.,$(EXTENSIONS))) html_template = template.html lua_filters = convert-internal-links.lua @@ -29,8 +29,8 @@ dependencies = $(cache)/deps.mk $(title): $(top_readme) | $(cache) pandoc --lua-filter print-title.lua $< > $@ -$(site_tree): $(text_folders) | $(cache) - ./generate-tree.py -o $@ $(TEXT_FILES) +$(site_tree): $(page_folders) | $(cache) + ./generate-tree.py -o $@ $(EXTENSIONS) $(dependencies): $(site_tree) | $(cache) ./generate-deps.py $< $@ $(OUT_DIR) @@ -40,7 +40,7 @@ include $(dependencies) site: $(pages) $(indices) # List of output folders. Compute this from the full list of HTML -# pages, since $(text_folders) may be missing some intermediate +# pages, since $(page_folders) may be missing some intermediate # directories (e.g. folders that only contain subfolders). html_folders = $(call dirnames,$(pages) $(indices)) @@ -52,7 +52,7 @@ $(pages) $(subindices): $(title) $(pages) $(indices): $(html_template) $(pages): $(OUT_DIR)/%.html: - $(call v,PAGE,$*) TEXT_FILES="$(TEXT_FILES)" \ + $(call v,PAGE,$*) EXTENSIONS="$(EXTENSIONS)" \ ./generate-page.py --site-title="$$(cat $(title))" --title="$*" \ $(foreach f,$(lua_filters),--lua-filter $(f)) \ --template=$(html_template) $< $@ @@ -66,7 +66,7 @@ $(subindices): index_options = --site-title="$$(cat $(title))" # ⚠ When tweaking this rule, check whether it still works for the # top-level index.html. $(indices): $(OUT_DIR)/%index.html: - $(call v,INDEX,$*) TEXT_FILES="$(TEXT_FILES)" \ + $(call v,INDEX,$*) EXTENSIONS="$(EXTENSIONS)" \ ./generate-index.py $(index_options) --template=$(html_template) \ $(foreach f,$(lua_filters),--lua-filter $(f)) \ $(site_tree) "$(patsubst %/,%,$*)" $@ diff --git a/repo/www/convert-internal-links.lua b/repo/www/convert-internal-links.lua index b0817dd..e50352a 100644 --- a/repo/www/convert-internal-links.lua +++ b/repo/www/convert-internal-links.lua @@ -1,7 +1,7 @@ EXTENSIONS = {} string.gsub( - os.getenv("TEXT_FILES"), + os.getenv("EXTENSIONS"), "[^%s]+", function (ext) EXTENSIONS[#EXTENSIONS+1] = ext end ) |
