Browse Source

fix stage 2 template

master 0.01
alistair 3 years ago
parent
commit
a3f6592bec
  1. 7
      main.cpp
  2. 1
      templater.hpp

7
main.cpp

@ -98,6 +98,7 @@ class builder { @@ -98,6 +98,7 @@ class builder {
std::map<std::string, std::string> properties;
templater *templr;
templater *textsub_templr;
templater *s2_templr;
std::map<fs::path, time_t> last_build;
@ -357,7 +358,7 @@ class builder { @@ -357,7 +358,7 @@ class builder {
article_properties["body"] = new_page;
notify_file_write(target);
compile_jobs[target] = {job_type::WRITE_ARTICLE, entry, std::map<std::string, std::string>(article_properties), article_last_update};
compile_jobs[target] = {job_type::TEMPLATE, entry, std::map<std::string, std::string>(article_properties), article_last_update};
continue;
}
@ -464,6 +465,8 @@ class builder { @@ -464,6 +465,8 @@ class builder {
textsub_templr = new templater({new variable_transclude_plugin{}}, {});
s2_templr = new templater({}, {new rss_feed_plugin{}, new microblog_plugin{}});
add_default_templates();
}
@ -519,7 +522,7 @@ class builder { @@ -519,7 +522,7 @@ class builder {
// reapply stg1 and stg2 templates
std::string page = e.second.properties.at("body");
e.second.properties.erase("body");
templr->run_substitution_plugins(page,
s2_templr->run_substitution_plugins(page,
e.second.properties, compile_jobs);
e.second.properties["body"] = page;

1
templater.hpp

@ -892,6 +892,7 @@ class templater { @@ -892,6 +892,7 @@ class templater {
return {num, recurse};
}
}
spdlog::warn("substplugin error: {}", invocation);
return {};
}

Loading…
Cancel
Save