From bbf17ea692e437cec908eae6759ffff8092fb42e Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 15 Sep 2022 18:36:47 +0100 Subject: [PATCH] WEB: Add new footer to web (#48557) --- web/pandas/_templates/layout.html | 2 +- web/pandas/config.yml | 1 + web/pandas_web.py | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/web/pandas/_templates/layout.html b/web/pandas/_templates/layout.html index 67876d88a2d1a..0829bec043b2b 100644 --- a/web/pandas/_templates/layout.html +++ b/web/pandas/_templates/layout.html @@ -91,7 +91,7 @@

- pandas is a fiscally sponsored project of NumFOCUS. + © {{ current_year }} pandas via NumFOCUS, Inc. Hosted by OVH Cloud.

diff --git a/web/pandas/config.yml b/web/pandas/config.yml index b33ea5b0dd972..df31b1a4fde19 100644 --- a/web/pandas/config.yml +++ b/web/pandas/config.yml @@ -7,6 +7,7 @@ main: - try.md # the binder page will be added later github_repo_url: pandas-dev/pandas context_preprocessors: + - pandas_web.Preprocessors.current_year - pandas_web.Preprocessors.navbar_add_info - pandas_web.Preprocessors.blog_add_posts - pandas_web.Preprocessors.maintainers_add_info diff --git a/web/pandas_web.py b/web/pandas_web.py index 290443d1d2970..62539574543a9 100755 --- a/web/pandas_web.py +++ b/web/pandas_web.py @@ -54,6 +54,15 @@ class Preprocessors: anything else needed just be added with context preprocessors. """ + @staticmethod + def current_year(context): + """ + Add the current year to the context, so it can be used for the copyright + note, or other places where it is needed. + """ + context["current_year"] = datetime.datetime.now().year + return context + @staticmethod def navbar_add_info(context): """