Skip to content

Commit

Permalink
Backport PR #48557 on branch 1.5.x (WEB: Add new footer to web) (#48571)
Browse files Browse the repository at this point in the history
Backport PR #48557: WEB: Add new footer to web

Co-authored-by: Marc Garcia <garcia.marc@gmail.com>
  • Loading branch information
meeseeksmachine and datapythonista committed Sep 15, 2022
1 parent 1fb8811 commit 9e8d859
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/pandas/_templates/layout.html
Expand Up @@ -91,7 +91,7 @@
</li>
</ul>
<p>
pandas is a fiscally sponsored project of <a href="https://numfocus.org">NumFOCUS.</a>
&copy; {{ current_year }} pandas via <a href="https://numfocus.org">NumFOCUS, Inc.</a> Hosted by <a href="https://www.ovhcloud.com">OVH Cloud</a>.
</p>
</footer>

Expand Down
1 change: 1 addition & 0 deletions web/pandas/config.yml
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions web/pandas_web.py
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 9e8d859

Please sign in to comment.