We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Do not commit trivial changes to documentation
### Motivation
<!-- A clear and concise description of what the motivation for the new feature is, and what problem it is solving. -->
At the moment, our CircleCI jobs `build-documentation` and `deploy-documentation` automatically build our documentation and commit/push it to the `gh-pages` branch. Most of the times, this commit includes only trivial changes (see e.g. 6d6c89beda44ebd2448526a18636c464e1111355). This makes the "last changed" date very unreliable, because it is always the date of the last commit, not the date when the documentation actually changed the last time.

### Proposed Solution
<!-- A clear and concise description of the feature you would like to add, and how it solves the motivating problem. -->
Do not commit the changes to the documentation if only the "Last updated on ..." changes

### Alternatives
<!-- A clear and concise description of any alternative solutions or features you've considered, and why you're proposed solution is better. -->
Remove the "last changed" date

Do not commit trivial changes to documentation
### Motivation
<!-- A clear and concise description of what the motivation for the new feature is, and what problem it is solving. -->
At the moment, our CircleCI jobs `build-documentation` and `deploy-documentation` automatically build our documentation and commit/push it to the `gh-pages` branch. Most of the times, this commit includes only trivial changes (see e.g. 6d6c89beda44ebd2448526a18636c464e1111355). This makes the "last changed" date very unreliable, because it is always the date of the last commit, not the date when the documentation actually changed the last time.

### Proposed Solution
<!-- A clear and concise description of the feature you would like to add, and how it solves the motivating problem. -->
Do not commit the changes to the documentation if only the "Last updated on ..." changes

### Alternatives
<!-- A clear and concise description of any alternative solutions or features you've considered, and why you're proposed solution is better. -->
Remove the "last changed" date


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sphinx/conf.py`
Content:
```
1 """
2 Configuration file for the Sphinx documentation builder.
3 
4 This file only contains a selection of the most common options. For a full
5 list see the documentation:
6 https://www.sphinx-doc.org/en/master/usage/configuration.html
7 """
8 
9 # -- Path setup --------------------------------------------------------------
10 
11 import os
12 import sys
13 import inspect
14 import importlib
15 import django
16 
17 from backend.settings import VERSION
18 
19 # Append project source directory to path environment variable
20 sys.path.append(os.path.abspath("../src/"))
21 os.environ["DJANGO_SETTINGS_MODULE"] = "backend.settings"
22 
23 
24 # Setup Django
25 django.setup()
26 
27 
28 def setup(app):
29     """
30     Registeration and setup.
31 
32     This method does the initial setup for the docs generation.
33     """
34     # Register the docstring processor with sphinx to improve the appearance of Django models
35     app.connect("autodoc-process-docstring", process_django_models)
36 
37 
38 # -- Project information -----------------------------------------------------
39 
40 
41 project = "integreat-cms"
42 # pylint: disable=redefined-builtin
43 copyright = "2020, Integreat"
44 author = "Integreat"
45 
46 # The full version, including alpha/beta/rc tags
47 release = VERSION
48 
49 # -- General configuration ---------------------------------------------------
50 
51 # All enabled sphinx extensions
52 extensions = [
53     "sphinx.ext.autodoc",
54     "sphinx.ext.githubpages",
55     "sphinx.ext.intersphinx",
56     "sphinx.ext.linkcode",
57     "sphinxcontrib_django",
58     "sphinx_rtd_theme",
59 ]
60 
61 # Enable cross-references to other documentations
62 intersphinx_mapping = {
63     "python": ("https://docs.python.org/3.7", None),
64     "pipenv": ("https://pipenv.pypa.io/en/latest/", None),
65     "sphinx": ("https://www.sphinx-doc.org/en/master/", None),
66     "sphinx-rtd-tutorial": (
67         "https://sphinx-rtd-tutorial.readthedocs.io/en/latest/",
68         None,
69     ),
70     "django": (
71         "https://docs.djangoproject.com/en/2.2/",
72         "https://docs.djangoproject.com/en/2.2/_objects/",
73     ),
74     "django-mptt": ("https://django-mptt.readthedocs.io/en/latest/", None),
75     "wsgi": ("https://wsgi.readthedocs.io/en/latest/", None),
76 }
77 
78 # The path for patched template files
79 templates_path = ["templates"]
80 
81 # -- Options for HTML output -------------------------------------------------
82 
83 # The theme to use for HTML and HTML Help pages.
84 html_theme = "sphinx_rtd_theme"
85 # Do not show the project name, only the logo
86 html_theme_options = {
87     "logo_only": False,
88     "collapse_navigation": False,
89 }
90 # The logo shown in the menu bar
91 html_logo = "../src/cms/static/images/integreat-logo-white.png"
92 # The facivon of the html doc files
93 html_favicon = "../src/cms/static/images/favicon.ico"
94 # The url where the docs should be published (via gh-pages)
95 html_baseurl = "https://Integreat.github.io/cms-django/"
96 # Do not include links to the documentation source (.rst files) in build
97 html_show_sourcelink = False
98 # Do not include a link to sphinx
99 html_show_sphinx = False
100 # Include last updated timestamp
101 html_last_updated_fmt = "%b %d, %Y"
102 
103 # -- Modify default Django model parameter types------------------------------
104 
105 
106 # pylint: disable=unused-argument, too-many-locals, too-many-branches
107 def process_django_models(app, what, name, obj, options, lines):
108     """Append correct param types from fields to model documentation."""
109     if inspect.isclass(obj) and issubclass(obj, django.db.models.Model):
110         # Intersphinx mapping to django.contrib.postgres documentation does not work, so here the manual link
111         postgres_docu = (
112             intersphinx_mapping.get("django")[1][0] + "ref/contrib/postgres/fields/"
113         )
114         # include_hidden to get also ManyToManyFields
115         for field in obj._meta.get_fields(include_hidden=True):
116             field_type = type(field).__name__
117             field_module = type(field).__module__
118             if field_module == "django.contrib.postgres.fields.array":
119                 # Fix intersphinx mappings for django.contrib.postgres fields
120                 type_line = (
121                     f":type {field.name}: `ArrayField <{postgres_docu}#arrayfield>`_"
122                 )
123             elif field_module == "django.contrib.postgres.fields.jsonb":
124                 # Fix intersphinx mappings for django.contrib.postgres fields
125                 type_line = (
126                     f":type {field.name}: `JSONField <{postgres_docu}#jsonfield>`_"
127                 )
128             elif field_module in ["django.db.models.fields.related", "mptt.fields"]:
129                 # Fix intersphinx mappings for related fields (ForeignKey, OneToOneField, ManyToManyField, ...)
130                 # Also includes related MPTT fields (TreeForeignKey, TreeOneToOneField, TreeManyToManyField, ...)
131                 remote_model = field.remote_field.get_related_field().model
132                 type_line = f":type {field.name}: {field_type} to :class:`~{remote_model.__module__}.{remote_model.__name__}`"
133             elif field_module == "django.db.models.fields.reverse_related":
134                 # Fix intersphinx mappings for reverse related fields (ManyToOneRel, OneToOneRel, ManyToManyRel, ...)
135                 remote_model = field.remote_field.model
136                 type_line = f":type {field.name}: Reverse {field_type[:-3]} Relation from :class:`~{remote_model.__module__}.{remote_model.__name__}`"
137             else:
138                 if "django.db.models" in field_module:
139                     # Scope with django.db.models * imports (remove all sub-module-paths)
140                     field_module = "django.db.models"
141                 # Fix type hint to enable correct intersphinx mappings to other documentations
142                 type_line = f":type {field.name}: ~{field_module}.{field_type}"
143             # This loop gets the indexes which are needed to update the type hints of the model parameters.
144             # It makes it possible to split the parameter section into multiple parts, e.g. params inherited from a base
145             # model and params of a sub model (otherwise the type hints would not be recognized when separated from
146             # the parameter description).
147             param_index = None
148             next_param_index = None
149             type_index = None
150             for index, line in enumerate(lines):
151                 if param_index is None and f":param {field.name}:" in line:
152                     # The index of the field param is only used to determine the next param line
153                     param_index = index
154                 elif (
155                     param_index is not None
156                     and next_param_index is None
157                     and (":param " in line or line == "")
158                 ):
159                     # The line of the next param after the field, this is the index where we will insert the type.
160                     # Sometimes the param descriptions extend over multiple lines, so we cannot just do param_index + 1.
161                     # If the line is empty, the param description is finished, even if it extends over multiple lines.
162                     next_param_index = index
163                 elif type_index is None and f":type {field.name}:" in line:
164                     # The index of the old type hint, we will either move this line or replace it
165                     type_index = index
166                     break
167             if next_param_index is None:
168                 # In case the current field is the last param, we just append the type at the very end of lines
169                 next_param_index = len(lines)
170             # For some params, the type line is not automatically generated and thus the type_index might be `None`
171             if type_index is not None:
172                 # We delete the old type index, because we will replace it with the new type line
173                 del lines[type_index]
174             # Insert the new type line just before the next param
175             lines.insert(next_param_index, type_line)
176     return lines
177 
178 
179 # -- Source Code links to GitHub ---------------------------------------------
180 
181 
182 def linkcode_resolve(domain, info):
183     """Link source code to GitHub."""
184     if domain != "py" or not info["module"]:
185         return None
186     filename = info["module"].replace(".", "/")
187     module = importlib.import_module(info["module"])
188     basename = os.path.splitext(module.__file__)[0]
189     if basename.endswith("__init__"):
190         filename += "/__init__"
191     item = module
192     line_number_reference = ""
193     for piece in info["fullname"].split("."):
194         item = getattr(item, piece)
195         try:
196             line_number_reference = f"#L{inspect.getsourcelines(item)[1]}"
197         except (TypeError, IOError):
198             pass
199     return f"https://github.com/Integreat/cms-django/blob/develop/src/{filename}.py{line_number_reference}"
200
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sphinx/conf.py b/sphinx/conf.py
--- a/sphinx/conf.py
+++ b/sphinx/conf.py
@@ -56,6 +56,7 @@
     "sphinx.ext.linkcode",
     "sphinxcontrib_django",
     "sphinx_rtd_theme",
+    "sphinx_last_updated_by_git",
 ]
 
 # Enable cross-references to other documentations

{"golden_diff": "diff --git a/sphinx/conf.py b/sphinx/conf.py\n--- a/sphinx/conf.py\n+++ b/sphinx/conf.py\n@@ -56,6 +56,7 @@\n     \"sphinx.ext.linkcode\",\n     \"sphinxcontrib_django\",\n     \"sphinx_rtd_theme\",\n+    \"sphinx_last_updated_by_git\",\n ]\n \n # Enable cross-references to other documentations\n", "issue": "Do not commit trivial changes to documentation\n### Motivation\r\n<!-- A clear and concise description of what the motivation for the new feature is, and what problem it is solving. -->\r\nAt the moment, our CircleCI jobs `build-documentation` and `deploy-documentation` automatically build our documentation and commit/push it to the `gh-pages` branch. Most of the times, this commit includes only trivial changes (see e.g. 6d6c89beda44ebd2448526a18636c464e1111355). This makes the \"last changed\" date very unreliable, because it is always the date of the last commit, not the date when the documentation actually changed the last time.\r\n\r\n### Proposed Solution\r\n<!-- A clear and concise description of the feature you would like to add, and how it solves the motivating problem. -->\r\nDo not commit the changes to the documentation if only the \"Last updated on ...\" changes\r\n\r\n### Alternatives\r\n<!-- A clear and concise description of any alternative solutions or features you've considered, and why you're proposed solution is better. -->\r\nRemove the \"last changed\" date\r\n\nDo not commit trivial changes to documentation\n### Motivation\r\n<!-- A clear and concise description of what the motivation for the new feature is, and what problem it is solving. -->\r\nAt the moment, our CircleCI jobs `build-documentation` and `deploy-documentation` automatically build our documentation and commit/push it to the `gh-pages` branch. Most of the times, this commit includes only trivial changes (see e.g. 6d6c89beda44ebd2448526a18636c464e1111355). This makes the \"last changed\" date very unreliable, because it is always the date of the last commit, not the date when the documentation actually changed the last time.\r\n\r\n### Proposed Solution\r\n<!-- A clear and concise description of the feature you would like to add, and how it solves the motivating problem. -->\r\nDo not commit the changes to the documentation if only the \"Last updated on ...\" changes\r\n\r\n### Alternatives\r\n<!-- A clear and concise description of any alternative solutions or features you've considered, and why you're proposed solution is better. -->\r\nRemove the \"last changed\" date\r\n\n", "before_files": [{"content": "\"\"\"\nConfiguration file for the Sphinx documentation builder.\n\nThis file only contains a selection of the most common options. For a full\nlist see the documentation:\nhttps://www.sphinx-doc.org/en/master/usage/configuration.html\n\"\"\"\n\n# -- Path setup --------------------------------------------------------------\n\nimport os\nimport sys\nimport inspect\nimport importlib\nimport django\n\nfrom backend.settings import VERSION\n\n# Append project source directory to path environment variable\nsys.path.append(os.path.abspath(\"../src/\"))\nos.environ[\"DJANGO_SETTINGS_MODULE\"] = \"backend.settings\"\n\n\n# Setup Django\ndjango.setup()\n\n\ndef setup(app):\n    \"\"\"\n    Registeration and setup.\n\n    This method does the initial setup for the docs generation.\n    \"\"\"\n    # Register the docstring processor with sphinx to improve the appearance of Django models\n    app.connect(\"autodoc-process-docstring\", process_django_models)\n\n\n# -- Project information -----------------------------------------------------\n\n\nproject = \"integreat-cms\"\n# pylint: disable=redefined-builtin\ncopyright = \"2020, Integreat\"\nauthor = \"Integreat\"\n\n# The full version, including alpha/beta/rc tags\nrelease = VERSION\n\n# -- General configuration ---------------------------------------------------\n\n# All enabled sphinx extensions\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.githubpages\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.linkcode\",\n    \"sphinxcontrib_django\",\n    \"sphinx_rtd_theme\",\n]\n\n# Enable cross-references to other documentations\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3.7\", None),\n    \"pipenv\": (\"https://pipenv.pypa.io/en/latest/\", None),\n    \"sphinx\": (\"https://www.sphinx-doc.org/en/master/\", None),\n    \"sphinx-rtd-tutorial\": (\n        \"https://sphinx-rtd-tutorial.readthedocs.io/en/latest/\",\n        None,\n    ),\n    \"django\": (\n        \"https://docs.djangoproject.com/en/2.2/\",\n        \"https://docs.djangoproject.com/en/2.2/_objects/\",\n    ),\n    \"django-mptt\": (\"https://django-mptt.readthedocs.io/en/latest/\", None),\n    \"wsgi\": (\"https://wsgi.readthedocs.io/en/latest/\", None),\n}\n\n# The path for patched template files\ntemplates_path = [\"templates\"]\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.\nhtml_theme = \"sphinx_rtd_theme\"\n# Do not show the project name, only the logo\nhtml_theme_options = {\n    \"logo_only\": False,\n    \"collapse_navigation\": False,\n}\n# The logo shown in the menu bar\nhtml_logo = \"../src/cms/static/images/integreat-logo-white.png\"\n# The facivon of the html doc files\nhtml_favicon = \"../src/cms/static/images/favicon.ico\"\n# The url where the docs should be published (via gh-pages)\nhtml_baseurl = \"https://Integreat.github.io/cms-django/\"\n# Do not include links to the documentation source (.rst files) in build\nhtml_show_sourcelink = False\n# Do not include a link to sphinx\nhtml_show_sphinx = False\n# Include last updated timestamp\nhtml_last_updated_fmt = \"%b %d, %Y\"\n\n# -- Modify default Django model parameter types------------------------------\n\n\n# pylint: disable=unused-argument, too-many-locals, too-many-branches\ndef process_django_models(app, what, name, obj, options, lines):\n    \"\"\"Append correct param types from fields to model documentation.\"\"\"\n    if inspect.isclass(obj) and issubclass(obj, django.db.models.Model):\n        # Intersphinx mapping to django.contrib.postgres documentation does not work, so here the manual link\n        postgres_docu = (\n            intersphinx_mapping.get(\"django\")[1][0] + \"ref/contrib/postgres/fields/\"\n        )\n        # include_hidden to get also ManyToManyFields\n        for field in obj._meta.get_fields(include_hidden=True):\n            field_type = type(field).__name__\n            field_module = type(field).__module__\n            if field_module == \"django.contrib.postgres.fields.array\":\n                # Fix intersphinx mappings for django.contrib.postgres fields\n                type_line = (\n                    f\":type {field.name}: `ArrayField <{postgres_docu}#arrayfield>`_\"\n                )\n            elif field_module == \"django.contrib.postgres.fields.jsonb\":\n                # Fix intersphinx mappings for django.contrib.postgres fields\n                type_line = (\n                    f\":type {field.name}: `JSONField <{postgres_docu}#jsonfield>`_\"\n                )\n            elif field_module in [\"django.db.models.fields.related\", \"mptt.fields\"]:\n                # Fix intersphinx mappings for related fields (ForeignKey, OneToOneField, ManyToManyField, ...)\n                # Also includes related MPTT fields (TreeForeignKey, TreeOneToOneField, TreeManyToManyField, ...)\n                remote_model = field.remote_field.get_related_field().model\n                type_line = f\":type {field.name}: {field_type} to :class:`~{remote_model.__module__}.{remote_model.__name__}`\"\n            elif field_module == \"django.db.models.fields.reverse_related\":\n                # Fix intersphinx mappings for reverse related fields (ManyToOneRel, OneToOneRel, ManyToManyRel, ...)\n                remote_model = field.remote_field.model\n                type_line = f\":type {field.name}: Reverse {field_type[:-3]} Relation from :class:`~{remote_model.__module__}.{remote_model.__name__}`\"\n            else:\n                if \"django.db.models\" in field_module:\n                    # Scope with django.db.models * imports (remove all sub-module-paths)\n                    field_module = \"django.db.models\"\n                # Fix type hint to enable correct intersphinx mappings to other documentations\n                type_line = f\":type {field.name}: ~{field_module}.{field_type}\"\n            # This loop gets the indexes which are needed to update the type hints of the model parameters.\n            # It makes it possible to split the parameter section into multiple parts, e.g. params inherited from a base\n            # model and params of a sub model (otherwise the type hints would not be recognized when separated from\n            # the parameter description).\n            param_index = None\n            next_param_index = None\n            type_index = None\n            for index, line in enumerate(lines):\n                if param_index is None and f\":param {field.name}:\" in line:\n                    # The index of the field param is only used to determine the next param line\n                    param_index = index\n                elif (\n                    param_index is not None\n                    and next_param_index is None\n                    and (\":param \" in line or line == \"\")\n                ):\n                    # The line of the next param after the field, this is the index where we will insert the type.\n                    # Sometimes the param descriptions extend over multiple lines, so we cannot just do param_index + 1.\n                    # If the line is empty, the param description is finished, even if it extends over multiple lines.\n                    next_param_index = index\n                elif type_index is None and f\":type {field.name}:\" in line:\n                    # The index of the old type hint, we will either move this line or replace it\n                    type_index = index\n                    break\n            if next_param_index is None:\n                # In case the current field is the last param, we just append the type at the very end of lines\n                next_param_index = len(lines)\n            # For some params, the type line is not automatically generated and thus the type_index might be `None`\n            if type_index is not None:\n                # We delete the old type index, because we will replace it with the new type line\n                del lines[type_index]\n            # Insert the new type line just before the next param\n            lines.insert(next_param_index, type_line)\n    return lines\n\n\n# -- Source Code links to GitHub ---------------------------------------------\n\n\ndef linkcode_resolve(domain, info):\n    \"\"\"Link source code to GitHub.\"\"\"\n    if domain != \"py\" or not info[\"module\"]:\n        return None\n    filename = info[\"module\"].replace(\".\", \"/\")\n    module = importlib.import_module(info[\"module\"])\n    basename = os.path.splitext(module.__file__)[0]\n    if basename.endswith(\"__init__\"):\n        filename += \"/__init__\"\n    item = module\n    line_number_reference = \"\"\n    for piece in info[\"fullname\"].split(\".\"):\n        item = getattr(item, piece)\n        try:\n            line_number_reference = f\"#L{inspect.getsourcelines(item)[1]}\"\n        except (TypeError, IOError):\n            pass\n    return f\"https://github.com/Integreat/cms-django/blob/develop/src/{filename}.py{line_number_reference}\"\n", "path": "sphinx/conf.py"}], "after_files": [{"content": "\"\"\"\nConfiguration file for the Sphinx documentation builder.\n\nThis file only contains a selection of the most common options. For a full\nlist see the documentation:\nhttps://www.sphinx-doc.org/en/master/usage/configuration.html\n\"\"\"\n\n# -- Path setup --------------------------------------------------------------\n\nimport os\nimport sys\nimport inspect\nimport importlib\nimport django\n\nfrom backend.settings import VERSION\n\n# Append project source directory to path environment variable\nsys.path.append(os.path.abspath(\"../src/\"))\nos.environ[\"DJANGO_SETTINGS_MODULE\"] = \"backend.settings\"\n\n\n# Setup Django\ndjango.setup()\n\n\ndef setup(app):\n    \"\"\"\n    Registeration and setup.\n\n    This method does the initial setup for the docs generation.\n    \"\"\"\n    # Register the docstring processor with sphinx to improve the appearance of Django models\n    app.connect(\"autodoc-process-docstring\", process_django_models)\n\n\n# -- Project information -----------------------------------------------------\n\n\nproject = \"integreat-cms\"\n# pylint: disable=redefined-builtin\ncopyright = \"2020, Integreat\"\nauthor = \"Integreat\"\n\n# The full version, including alpha/beta/rc tags\nrelease = VERSION\n\n# -- General configuration ---------------------------------------------------\n\n# All enabled sphinx extensions\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.githubpages\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.linkcode\",\n    \"sphinxcontrib_django\",\n    \"sphinx_rtd_theme\",\n    \"sphinx_last_updated_by_git\",\n]\n\n# Enable cross-references to other documentations\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3.7\", None),\n    \"pipenv\": (\"https://pipenv.pypa.io/en/latest/\", None),\n    \"sphinx\": (\"https://www.sphinx-doc.org/en/master/\", None),\n    \"sphinx-rtd-tutorial\": (\n        \"https://sphinx-rtd-tutorial.readthedocs.io/en/latest/\",\n        None,\n    ),\n    \"django\": (\n        \"https://docs.djangoproject.com/en/2.2/\",\n        \"https://docs.djangoproject.com/en/2.2/_objects/\",\n    ),\n    \"django-mptt\": (\"https://django-mptt.readthedocs.io/en/latest/\", None),\n    \"wsgi\": (\"https://wsgi.readthedocs.io/en/latest/\", None),\n}\n\n# The path for patched template files\ntemplates_path = [\"templates\"]\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.\nhtml_theme = \"sphinx_rtd_theme\"\n# Do not show the project name, only the logo\nhtml_theme_options = {\n    \"logo_only\": False,\n    \"collapse_navigation\": False,\n}\n# The logo shown in the menu bar\nhtml_logo = \"../src/cms/static/images/integreat-logo-white.png\"\n# The facivon of the html doc files\nhtml_favicon = \"../src/cms/static/images/favicon.ico\"\n# The url where the docs should be published (via gh-pages)\nhtml_baseurl = \"https://Integreat.github.io/cms-django/\"\n# Do not include links to the documentation source (.rst files) in build\nhtml_show_sourcelink = False\n# Do not include a link to sphinx\nhtml_show_sphinx = False\n# Include last updated timestamp\nhtml_last_updated_fmt = \"%b %d, %Y\"\n\n# -- Modify default Django model parameter types------------------------------\n\n\n# pylint: disable=unused-argument, too-many-locals, too-many-branches\ndef process_django_models(app, what, name, obj, options, lines):\n    \"\"\"Append correct param types from fields to model documentation.\"\"\"\n    if inspect.isclass(obj) and issubclass(obj, django.db.models.Model):\n        # Intersphinx mapping to django.contrib.postgres documentation does not work, so here the manual link\n        postgres_docu = (\n            intersphinx_mapping.get(\"django\")[1][0] + \"ref/contrib/postgres/fields/\"\n        )\n        # include_hidden to get also ManyToManyFields\n        for field in obj._meta.get_fields(include_hidden=True):\n            field_type = type(field).__name__\n            field_module = type(field).__module__\n            if field_module == \"django.contrib.postgres.fields.array\":\n                # Fix intersphinx mappings for django.contrib.postgres fields\n                type_line = (\n                    f\":type {field.name}: `ArrayField <{postgres_docu}#arrayfield>`_\"\n                )\n            elif field_module == \"django.contrib.postgres.fields.jsonb\":\n                # Fix intersphinx mappings for django.contrib.postgres fields\n                type_line = (\n                    f\":type {field.name}: `JSONField <{postgres_docu}#jsonfield>`_\"\n                )\n            elif field_module in [\"django.db.models.fields.related\", \"mptt.fields\"]:\n                # Fix intersphinx mappings for related fields (ForeignKey, OneToOneField, ManyToManyField, ...)\n                # Also includes related MPTT fields (TreeForeignKey, TreeOneToOneField, TreeManyToManyField, ...)\n                remote_model = field.remote_field.get_related_field().model\n                type_line = f\":type {field.name}: {field_type} to :class:`~{remote_model.__module__}.{remote_model.__name__}`\"\n            elif field_module == \"django.db.models.fields.reverse_related\":\n                # Fix intersphinx mappings for reverse related fields (ManyToOneRel, OneToOneRel, ManyToManyRel, ...)\n                remote_model = field.remote_field.model\n                type_line = f\":type {field.name}: Reverse {field_type[:-3]} Relation from :class:`~{remote_model.__module__}.{remote_model.__name__}`\"\n            else:\n                if \"django.db.models\" in field_module:\n                    # Scope with django.db.models * imports (remove all sub-module-paths)\n                    field_module = \"django.db.models\"\n                # Fix type hint to enable correct intersphinx mappings to other documentations\n                type_line = f\":type {field.name}: ~{field_module}.{field_type}\"\n            # This loop gets the indexes which are needed to update the type hints of the model parameters.\n            # It makes it possible to split the parameter section into multiple parts, e.g. params inherited from a base\n            # model and params of a sub model (otherwise the type hints would not be recognized when separated from\n            # the parameter description).\n            param_index = None\n            next_param_index = None\n            type_index = None\n            for index, line in enumerate(lines):\n                if param_index is None and f\":param {field.name}:\" in line:\n                    # The index of the field param is only used to determine the next param line\n                    param_index = index\n                elif (\n                    param_index is not None\n                    and next_param_index is None\n                    and (\":param \" in line or line == \"\")\n                ):\n                    # The line of the next param after the field, this is the index where we will insert the type.\n                    # Sometimes the param descriptions extend over multiple lines, so we cannot just do param_index + 1.\n                    # If the line is empty, the param description is finished, even if it extends over multiple lines.\n                    next_param_index = index\n                elif type_index is None and f\":type {field.name}:\" in line:\n                    # The index of the old type hint, we will either move this line or replace it\n                    type_index = index\n                    break\n            if next_param_index is None:\n                # In case the current field is the last param, we just append the type at the very end of lines\n                next_param_index = len(lines)\n            # For some params, the type line is not automatically generated and thus the type_index might be `None`\n            if type_index is not None:\n                # We delete the old type index, because we will replace it with the new type line\n                del lines[type_index]\n            # Insert the new type line just before the next param\n            lines.insert(next_param_index, type_line)\n    return lines\n\n\n# -- Source Code links to GitHub ---------------------------------------------\n\n\ndef linkcode_resolve(domain, info):\n    \"\"\"Link source code to GitHub.\"\"\"\n    if domain != \"py\" or not info[\"module\"]:\n        return None\n    filename = info[\"module\"].replace(\".\", \"/\")\n    module = importlib.import_module(info[\"module\"])\n    basename = os.path.splitext(module.__file__)[0]\n    if basename.endswith(\"__init__\"):\n        filename += \"/__init__\"\n    item = module\n    line_number_reference = \"\"\n    for piece in info[\"fullname\"].split(\".\"):\n        item = getattr(item, piece)\n        try:\n            line_number_reference = f\"#L{inspect.getsourcelines(item)[1]}\"\n        except (TypeError, IOError):\n            pass\n    return f\"https://github.com/Integreat/cms-django/blob/develop/src/{filename}.py{line_number_reference}\"\n", "path": "sphinx/conf.py"}]}