Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #48557 on branch 1.5.x (WEB: Add new footer to web) #48571

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/pandas/_templates/layout.html
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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