diff --git a/docs/_data/plugins.py b/docs/_data/plugins.py index 05c3aea05b27349881aa3b8fd29cffca48dd80b3..cbac0510eaaef2f22dcce4593f6c701b341d8066 100644 --- a/docs/_data/plugins.py +++ b/docs/_data/plugins.py @@ -401,9 +401,19 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None: first_year = time.strftime("%Y", time.localtime()) curr_year = time.strftime("%Y", time.localtime()) + if first_year == curr_year: + env.variables[ + "date_copyright" + ] = f"Copyright © {curr_year}" + else: + env.variables[ + "date_copyright" + ] = f"Copyright © {curr_year} - {curr_year}" + env.conf[ "copyright" - ] = f"Copyright © {first_year} - {curr_year} {env.variables['copyright']}" + ] = f"{env.variables['date_copyright']} {env.variables['copyright']}" + def set_repo_name(env: dict, repo_slug: str) -> None: @@ -844,7 +854,7 @@ def update_version(env: dict) -> None: } ) last_minor = minor - last_patch = 0 + last_patch = -1 if patch > last_patch: last_patch = patch mike_version.append( diff --git a/docs/about/license.md b/docs/about/license.md index bffc81d86845cb373c1d6a71a2d54e91e1fa3b79..ae67b55618781513701f668c9bc85f02a0a9793e 100644 --- a/docs/about/license.md +++ b/docs/about/license.md @@ -17,7 +17,7 @@ Software is under double licensing: ## MIT License -Copyright (c) 2020 +{{ date_copyright }} {% for i_maintainer in curr_repo.maintainers %} - [{{ i_maintainer.name }}](mailto:{{ i_maintainer.mail }}) diff --git a/docs/about/release_notes.md b/docs/about/release_notes.md index e03cfeae492f6e36102d00b8bcbd7a42ecc93792..40e0ea3667a6c0f03b42359f272088894f497d22 100644 --- a/docs/about/release_notes.md +++ b/docs/about/release_notes.md @@ -10,6 +10,12 @@ Modified content will be overwritten when updating ## 🔖 v1.0 +### 🔖 v1.0.2 <small>(29/04/2021)</small> + +- ðŸ“📄 Update copyright in license content +- ✨ Improve handling of copyright in plugins.py script +- 🔥 Remove useless file from tracked tree + ### 🔖 v1.0.1 <small>(29/04/2021)</small> - ðŸ›ðŸ± Fix wrong assets path in `docs/personal_template/create.md` diff --git a/preview/docs/_data/vars.yaml b/preview/docs/_data/vars.yaml deleted file mode 100644 index 73bf21779dff38d42e11da04f2141aa05a71dde6..0000000000000000000000000000000000000000 --- a/preview/docs/_data/vars.yaml +++ /dev/null @@ -1,97 +0,0 @@ -### BEGIN MKDOCS TEMPLATE ### -### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !### -### Modified content will be overwritten when updating.### - -# Extra Data Information & Customization -# =========================================================================== -# Dictionnary storing variables to be used as "Jinja2" variables within -# markdown files and _data/plugins.py - -# Mkdocs.yaml -# --------------------------------------------------------------------------- -# Here you can overwrite main key you could find in mkdocs.yaml - -# The name of your site, if not specified, will be the entry `name` of the repo in -# `_data/repo_name.yaml` -#site_name: "Your Site Name" - -# The site description of your site, if not specified will be the description -# of the repo in `_data/repo_name.yaml` -#site_desc: "A short description" - -# The url of your site, if not specified, then the site_url will be build from -# the key `site_base_url` below and the `url_slug_with_namespace` in -# `_data/repo_name.yaml`. If `site_base_url` is not specified, then value of -# `site_url` will not be overwritten. -#site_url: "https://my_site.tld" - -# The name or company which old the copyright. No need to specify any date -# as it will be built based on the first commit of your repo. If not specify, -# then no copyright will be shown on the footer of the documentation. -#copyright: "Firstname Lastname" - -# Name of your repo, if not specified, will be the key `mkdocs_repo_name` in -# `_data/repo_name.yaml` If value is EXACTLY "!!git_platform", then the value -# will be `git_platform["name"]` (see below). -#repo_name: "My Repo Name" - -# URL to the source code of your repo. If not specified, will be build from -# `git_platform["url"]` (see below) and `repo_name["git_slug_with_namespace"]` -# in `_data/repo_name.yaml`. -#repo_url: "https://mygit.tld/namespace/repo_name - -# You can override every entry of the `theme` key in `mkdocs.yaml`, here. -# Usefull to override templated mkdocs. -# -# REMARK, ONLY FOR MATERIAL-MKDOCS THEME -# If `theme["logo"]` is not specified, i.e. path to the logo image, then it -# will be set to the value of the key `repo_name["logo"]` in -# `_data/repo_name.yaml` if specified. -# -# If `theme["favicon"]` is not specified, i.e. path to the favicon image, -# then it will be set to the value of the key `repo_name["logo"]` in -# `_data/repo_name.yaml` if specified. -# -# If `theme["icon"]["repo"]` is not specified, i.e. icon "path" (see -# https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) that -# will be shown on the top rigt corner in front off the repo name, then it -# will be set to the value of the key `git_platform["icon"]` (see below). -#theme: -# logo: "path/to/logo.svg" -# icon: -# repo: fontawesome/brands/gitlab -# favicon: "path/to/favicon.svg" - -# Main repo configuration -# --------------------------------------------------------------------------- -# Here you can specify variable about your main repo documentation - -# The base url of your site, e.g. if you are using multiple nested -# documentation build with monorepo, you might want to share the same base URL -# for all your repo, then build link from the repo["url_slug_with_namespace"]. -#site_url: "https://my_site.tld" - - -# Git platform -# --------------------------------------------------------------------------- -# In this REQUIRED section you will be able to specify some information for you -# git platform hosting your repo. This section will be used to automatically -# setup configuration for mkdocs such as `repo_url`, theme["icon"]["repo"] etc. - -# Main dict entry -git_platform: - # The logo of the git platform you use. Not used in mkdocs configuration but - # can be used in markdown documentation file. - logo: " " - # Icon "path" (see - # https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) that - # will be shown on the top rigt corner in front off the repo name if not - # specified in `theme["icon"]["repo"]`. - icon: "fontawesome/brands/gitlab" - # Name of the platform you use. - name: "Framagit" - # URL of the platform you use, to be able to set `repo_url` for mkdocs - # configuration. - url: "https://framagit.org/" - -### END MKDOCS TEMPLATE ### diff --git a/templates/docs/_data/plugins.py b/templates/docs/_data/plugins.py index 462c7cbd1fc582221b4e709596e6b5dc235a452a..cbac0510eaaef2f22dcce4593f6c701b341d8066 100644 --- a/templates/docs/_data/plugins.py +++ b/templates/docs/_data/plugins.py @@ -401,9 +401,19 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None: first_year = time.strftime("%Y", time.localtime()) curr_year = time.strftime("%Y", time.localtime()) + if first_year == curr_year: + env.variables[ + "date_copyright" + ] = f"Copyright © {curr_year}" + else: + env.variables[ + "date_copyright" + ] = f"Copyright © {curr_year} - {curr_year}" + env.conf[ "copyright" - ] = f"Copyright © {first_year} - {curr_year} {env.variables['copyright']}" + ] = f"{env.variables['date_copyright']} {env.variables['copyright']}" + def set_repo_name(env: dict, repo_slug: str) -> None: