Skip to content

How to add the year automatically in the copyright part #4969

Answered by squidfunk
IvyMasterDiego asked this question in Q&A
Discussion options

You must be logged in to vote

Simplest solution: ask ChatGPT to write a hook for you:

from datetime import datetime
def on_config(config, **kwargs):
    config.copyright = f"Copyright © {datetime.now().year} Your Name"

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@shenweiyan
Comment options

@squidfunk
Comment options

Answer selected by kamilkrzyskow
@hellt
Comment options

@kamilkrzyskow
Comment options

@hellt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants