From 30e831c9602ea5d4d0603f5ad03baff481771b4b Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 19 Aug 2020 00:10:08 +0200 Subject: Put extensions in Lua module instead of sneaking them in environment Note that neither .cache/config.lua nor .cache/site-tree.json get updated when EXTENSIONS changes. This could be hacked as follows: config = EXTENSIONS="$(EXTENSIONS)" ifneq "$(shell test -f $(config_token) && cat $(config_token))" \ "$(shell ./generate-config-token.py $(config))" .PHONY: $(lua_config) $(site_tree) $(config_token) endif Plus a recipe for config_token, and some dependencies on it. --- repo/www/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'repo/www/helpers.py') diff --git a/repo/www/helpers.py b/repo/www/helpers.py index 434ef6c..f76fa02 100644 --- a/repo/www/helpers.py +++ b/repo/www/helpers.py @@ -1,7 +1,7 @@ from collections import defaultdict from dataclasses import dataclass, field from itertools import chain -from os import path +from os import environ, path from subprocess import run from typing import Iterator @@ -67,4 +67,5 @@ def pandoc(page, output, template, filters, title=None, site_title=None): if site_title is not None: cmd += ('-T', site_title) + environ['LUA_PATH'] = '.cache/?.lua;;' run(cmd, check=True) -- cgit v1.2.3