From 0494017f897864c93c754f660a3dadae8be1dd9e Mon Sep 17 00:00:00 2001 From: "David B. Kinder" Date: Sun, 3 Apr 2022 13:38:16 -0700 Subject: [PATCH] doc: handle last updated footer for new document If a new document is added, the CI system fails because the new document hasn't been checked into the branch yet so the last_updated.py script complains with an error. Change to use the last_published date in this situation. Tracked-On: #7249 Signed-off-by: David B. Kinder --- doc/extensions/last_updated.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/extensions/last_updated.py b/doc/extensions/last_updated.py index c4373490d..4140e9e61 100644 --- a/doc/extensions/last_updated.py +++ b/doc/extensions/last_updated.py @@ -134,9 +134,10 @@ def on_html_page_context(app, pagename, templatename, context, doctree): git_repo=app.config.last_updated_git_path, doc_root=app.srcdir) if last_updated_value is None: - app.logger.warning(f'Could not get the last updated value from git for the following file:\ - \n {rst_file_path}\n Ensure that you specified the correct folder in last_updated_git_path.') - context['last_updated'] = None + #app.logger.warning(f'Could not get the last updated value from git for the following file:\ + # \n {rst_file_path}\n Ensure that you specified the correct folder in last_updated_git_path.') + #context['last_updated'] = None + context['last_updated'] = context['last_published'] else: context['last_updated'] = last_updated_value.strftime(date_fmt)