commit 685b147a8f2c3e4b0a11475ba50a163cd4ba729d
parent 41b782c28fa85b12998b30830af1ef9eabcb901e
Author: lumidify <nobody@lumidify.org>
Date: Mon, 11 May 2020 07:58:05 +0200
Add always_update metadata
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/LSG/Generate.pm b/LSG/Generate.pm
@@ -33,7 +33,9 @@ sub gen_files() {
exists($config->{"modified_dates"}->{"pages"}->{"$pageid.$lang"}) &&
exists($config->{"modified_dates"}->{"templates"}->{$template}) &&
$config->{"modified_dates"}->{"pages"}->{"$pageid.$lang"} eq $config->{"metadata"}->{$pageid}->{"modified"}->{$lang} &&
- $config->{"modified_dates"}->{"templates"}->{$template} eq $config->{"templates"}->{$template}->{"modified"}
+ $config->{"modified_dates"}->{"templates"}->{$template} eq $config->{"templates"}->{$template}->{"modified"} &&
+ (!exists $config->{"metadata"}->{$pageid}->{$lang}->{"always_update"} ||
+ $config->{"metadata"}->{$pageid}->{$lang}->{"always_update"} ne "true")
) {
next;
}
diff --git a/lsg.pl b/lsg.pl
@@ -237,6 +237,16 @@ Two more functions, C<gen_nav> and C<gen_lang_selector>, are defined, but they a
currently only used internally in the templates and probably aren't needed for the
actual pages.
+=head1 BUGS
+
+The C<modified_dates> behavior is buggy - pages should have proper dependency resolution
+so that pages which call other functions are still updated if the pages they require
+are modified but the page itself isn't. For instance, if one page has a list of books
+that is automatically generated, it won't be updated if the books change because the
+generator doesn't know that this page actually depends on all other pages. As a small
+workaround, there is now the C<always_update> metadata, so if C<always_update:true> is
+specified in the metadata, that page will always be updated.
+
=head1 SEE ALSO
Text::Markdown