Skip to content

Commit da558d6

Browse files
authoredJan 3, 2022
Add template variable for copyright year (#1101)
1 parent c51acec commit da558d6

6 files changed

+6
-7
lines changed
 

‎cookiecutter.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"email": "mail@claudiojolowicz.com",
77
"github_user": "cjolowicz",
88
"version": "0.0.0",
9+
"copyright_year": "{% now 'utc', '%Y' %}",
910
"license": ["MIT", "Apache-2.0", "GPL-3.0"],
1011
"development_status": [
1112
"Development Status :: 1 - Planning",

‎docs/guide.rst

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ Here is a complete list of the project variables defined by this template:
263263
``email`` E-mail address of the author katherine@example.com
264264
``github_user`` GitHub username of the author ``katherine``
265265
``version`` Initial project version ``0.0.0``
266+
``copyright_year`` The project copyright year ``2022``
266267
``license`` The project license ``MIT``
267268
``development_status`` Development status of the project ``Development Status :: 3 - Alpha``
268269
====================== ================================= ===================================

‎{{cookiecutter.project_name}}/docs/conf.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
"""Sphinx configuration."""
2-
from datetime import datetime
3-
4-
52
project = "{{cookiecutter.friendly_name}}"
63
author = "{{cookiecutter.author}}"
7-
copyright = f"{datetime.now().year}, {author}"
4+
copyright = "{{cookiecutter.copyright_year}}, {author}"
85
extensions = [
96
"sphinx.ext.autodoc",
107
"sphinx.ext.napoleon",

‎{{cookiecutter.project_name}}/{% if cookiecutter.license == 'Apache-2.0' -%} LICENSE.rst {%- endif %}

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright {% now 'utc', '%Y' %} {{ cookiecutter.author }}
1+
Copyright {{ cookiecutter.copyright_year }} {{ cookiecutter.author }}
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

‎{{cookiecutter.project_name}}/{% if cookiecutter.license == 'GPL-3.0' -%} LICENSE.rst {%- endif %}

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ cookiecutter.friendly_name }}
2-
Copyright (C) {% now 'utc', '%Y' %} {{ cookiecutter.author }}
2+
Copyright (C) {{ cookiecutter.copyright_year }} {{ cookiecutter.author }}
33

44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by

‎{{cookiecutter.project_name}}/{% if cookiecutter.license == 'MIT' -%} LICENSE.rst {%- endif %}

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22
===========
33

4-
Copyright © {% now 'utc', '%Y' %} {{ cookiecutter.author }}
4+
Copyright © {{ cookiecutter.copyright_year }} {{ cookiecutter.author }}
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)
Please sign in to comment.