forked from jekyll/minima
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.make4ht
40 lines (37 loc) · 951 Bytes
/
.make4ht
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- local outdir = os.getenv "be.github.io_root"
local outdir = "../../_posts"
local domfilter = require "make4ht-domfilter"
-- remove the \maketitle environment from the HTML file, title will be inserted in the template
local domprocess = domfilter{function(dom)
local maketitles = dom:query_selector(".maketitle")
for _, el in ipairs(maketitles) do
print "removing maketitle"
el:remove_node()
end
return dom
end}
filter_settings "staticsite" {
site_root = outdir,
map = {
[".css$"] = "assets/css/"
},
header = {
layout="post",
date = function(parameters)
return os.date("!%Y-%m-%d %T", parameters.time)
end
}
}
Make:enable_extension "common_domfilters"
if mode=="draft" then
Make:htlatex {}
elseif mode=="publish" then
-- Make:htlatex {}
Make:match("html$", domprocess)
Make:enable_extension "staticsite"
Make:htlatex {}
else
Make:htlatex {}
Make:htlatex {}
Make:htlatex {}
end