We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add build date and MkDocs version to the output
The date was suggested in #290, but didn't seem useful at the time.

However, it would be really useful to see when the output was built and with what version when helping people debug.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mkdocs/build.py`
Content:
```
1 # coding: utf-8
2 from __future__ import print_function
3 
4 from jinja2.exceptions import TemplateNotFound
5 from mkdocs import nav, toc, utils
6 from mkdocs.compat import urljoin, PY2
7 from mkdocs.relative_path_ext import RelativePathExtension
8 import jinja2
9 import json
10 import markdown
11 import os
12 import logging
13 
14 log = logging.getLogger('mkdocs')
15 
16 
17 def convert_markdown(markdown_source, site_navigation=None, extensions=(), strict=False):
18     """
19     Convert the Markdown source file to HTML content, and additionally
20     return the parsed table of contents, and a dictionary of any metadata
21     that was specified in the Markdown file.
22 
23     `extensions` is an optional sequence of Python Markdown extensions to add
24     to the default set.
25     """
26 
27     # Generate the HTML from the markdown source
28     builtin_extensions = ['meta', 'toc', 'tables', 'fenced_code']
29     mkdocs_extensions = [RelativePathExtension(site_navigation, strict), ]
30     extensions = builtin_extensions + mkdocs_extensions + list(extensions)
31     md = markdown.Markdown(
32         extensions=extensions
33     )
34     html_content = md.convert(markdown_source)
35     meta = md.Meta
36     toc_html = md.toc
37 
38     # Post process the generated table of contents into a data structure
39     table_of_contents = toc.TableOfContents(toc_html)
40 
41     return (html_content, table_of_contents, meta)
42 
43 
44 def get_global_context(nav, config):
45     """
46     Given the SiteNavigation and config, generate the context which is relevant
47     to app pages.
48     """
49 
50     site_name = config['site_name']
51 
52     if config['site_favicon']:
53         site_favicon = nav.url_context.make_relative('/' + config['site_favicon'])
54     else:
55         site_favicon = None
56 
57     page_description = config['site_description']
58 
59     extra_javascript = utils.create_media_urls(nav=nav, url_list=config['extra_javascript'])
60 
61     extra_css = utils.create_media_urls(nav=nav, url_list=config['extra_css'])
62 
63     return {
64         'site_name': site_name,
65         'site_author': config['site_author'],
66         'favicon': site_favicon,
67         'page_description': page_description,
68 
69         # Note that there's intentionally repetition here. Rather than simply
70         # provide the config dictionary we instead pass everything explicitly.
71         #
72         # This helps ensure that we can throughly document the context that
73         # gets passed to themes.
74         'repo_url': config['repo_url'],
75         'repo_name': config['repo_name'],
76         'nav': nav,
77         'base_url': nav.url_context.make_relative('/'),
78         'homepage_url': nav.homepage.url,
79 
80         'extra_css': extra_css,
81         'extra_javascript': extra_javascript,
82 
83         'include_nav': config['include_nav'],
84         'include_next_prev': config['include_next_prev'],
85         'include_search': config['include_search'],
86 
87         'copyright': config['copyright'],
88         'google_analytics': config['google_analytics']
89     }
90 
91 
92 def get_page_context(page, content, nav, toc, meta, config):
93     """
94     Generate the page context by extending the global context and adding page
95     specific variables.
96     """
97 
98     if page.is_homepage or page.title is None:
99         page_title = None
100     else:
101         page_title = page.title
102 
103     if page.is_homepage:
104         page_description = config['site_description']
105     else:
106         page_description = None
107 
108     if config['site_url']:
109         base = config['site_url']
110         if not base.endswith('/'):
111             base += '/'
112         canonical_url = urljoin(base, page.abs_url.lstrip('/'))
113     else:
114         canonical_url = None
115 
116     return {
117         'page_title': page_title,
118         'page_description': page_description,
119 
120         'content': content,
121         'toc': toc,
122         'meta': meta,
123 
124 
125         'canonical_url': canonical_url,
126 
127         'current_page': page,
128         'previous_page': page.previous_page,
129         'next_page': page.next_page,
130     }
131 
132 
133 def build_404(config, env, site_navigation):
134 
135     try:
136         template = env.get_template('404.html')
137     except TemplateNotFound:
138         return
139 
140     global_context = get_global_context(site_navigation, config)
141 
142     output_content = template.render(global_context)
143     output_path = os.path.join(config['site_dir'], '404.html')
144     utils.write_file(output_content.encode('utf-8'), output_path)
145 
146 
147 def build_pages(config, dump_json=False):
148     """
149     Builds all the pages and writes them into the build directory.
150     """
151     site_navigation = nav.SiteNavigation(config['pages'], config['use_directory_urls'])
152     loader = jinja2.FileSystemLoader(config['theme_dir'])
153     env = jinja2.Environment(loader=loader)
154 
155     build_404(config, env, site_navigation)
156 
157     for page in site_navigation.walk_pages():
158         # Read the input file
159         input_path = os.path.join(config['docs_dir'], page.input_path)
160         try:
161             input_content = open(input_path, 'r').read()
162         except IOError:
163             log.error('file not found: %s' % input_path)
164         if PY2:
165             input_content = input_content.decode('utf-8')
166 
167         # Process the markdown text
168         html_content, table_of_contents, meta = convert_markdown(
169             input_content, site_navigation,
170             extensions=config['markdown_extensions'], strict=config['strict']
171         )
172 
173         context = get_global_context(site_navigation, config)
174         context.update(get_page_context(
175             page, html_content, site_navigation,
176             table_of_contents, meta, config
177         ))
178 
179         # Allow 'template:' override in md source files.
180         if 'template' in meta:
181             template = env.get_template(meta['template'][0])
182         else:
183             template = env.get_template('base.html')
184 
185         # Render the template.
186         output_content = template.render(context)
187 
188         # Write the output file.
189         output_path = os.path.join(config['site_dir'], page.output_path)
190         if dump_json:
191             json_context = {
192                 'content': context['content'],
193                 'title': context['current_page'].title,
194                 'url': context['current_page'].abs_url,
195                 'language': 'en',
196             }
197             utils.write_file(json.dumps(json_context, indent=4).encode('utf-8'), output_path.replace('.html', '.json'))
198         else:
199             utils.write_file(output_content.encode('utf-8'), output_path)
200 
201 
202 def build(config, live_server=False, dump_json=False, clean_site_dir=False):
203     """
204     Perform a full site build.
205     """
206     if clean_site_dir:
207         print("Cleaning site directory")
208         utils.clean_directory(config['site_dir'])
209     if not live_server:
210         print("Building documentation to directory: %s" % config['site_dir'])
211         if not clean_site_dir and site_directory_contains_stale_files(config['site_dir']):
212             print("Directory %s contains stale files. Use --clean to remove them." % config['site_dir'])
213 
214     if dump_json:
215         build_pages(config, dump_json=True)
216     else:
217         # Reversed as we want to take the media files from the builtin theme
218         # and then from the custom theme_dir so the custom versions take take
219         # precedence.
220         for theme_dir in reversed(config['theme_dir']):
221             utils.copy_media_files(theme_dir, config['site_dir'])
222         utils.copy_media_files(config['docs_dir'], config['site_dir'])
223         build_pages(config)
224 
225 
226 def site_directory_contains_stale_files(site_directory):
227     """
228     Check if the site directory contains stale files from a previous build.
229     Right now the check returns true if the directory is not empty.
230     A more sophisticated approach should be found to trigger only if there are
231     files that won't be overwritten anyway.
232     """
233     if os.path.exists(site_directory):
234         if os.listdir(site_directory):
235             return True
236     return False
237
```
--- 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/mkdocs/build.py b/mkdocs/build.py
--- a/mkdocs/build.py
+++ b/mkdocs/build.py
@@ -1,7 +1,10 @@
 # coding: utf-8
 from __future__ import print_function
 
+from datetime import datetime
+
 from jinja2.exceptions import TemplateNotFound
+import mkdocs
 from mkdocs import nav, toc, utils
 from mkdocs.compat import urljoin, PY2
 from mkdocs.relative_path_ext import RelativePathExtension
@@ -85,7 +88,10 @@
         'include_search': config['include_search'],
 
         'copyright': config['copyright'],
-        'google_analytics': config['google_analytics']
+        'google_analytics': config['google_analytics'],
+
+        'mkdocs_version': mkdocs.__version__,
+        'build_date_utc': datetime.utcnow()
     }

{"golden_diff": "diff --git a/mkdocs/build.py b/mkdocs/build.py\n--- a/mkdocs/build.py\n+++ b/mkdocs/build.py\n@@ -1,7 +1,10 @@\n # coding: utf-8\n from __future__ import print_function\n \n+from datetime import datetime\n+\n from jinja2.exceptions import TemplateNotFound\n+import mkdocs\n from mkdocs import nav, toc, utils\n from mkdocs.compat import urljoin, PY2\n from mkdocs.relative_path_ext import RelativePathExtension\n@@ -85,7 +88,10 @@\n         'include_search': config['include_search'],\n \n         'copyright': config['copyright'],\n-        'google_analytics': config['google_analytics']\n+        'google_analytics': config['google_analytics'],\n+\n+        'mkdocs_version': mkdocs.__version__,\n+        'build_date_utc': datetime.utcnow()\n     }\n", "issue": "Add build date and MkDocs version to the output\nThe date was suggested in #290, but didn't seem useful at the time.\n\nHowever, it would be really useful to see when the output was built and with what version when helping people debug.\n\n", "before_files": [{"content": "# coding: utf-8\nfrom __future__ import print_function\n\nfrom jinja2.exceptions import TemplateNotFound\nfrom mkdocs import nav, toc, utils\nfrom mkdocs.compat import urljoin, PY2\nfrom mkdocs.relative_path_ext import RelativePathExtension\nimport jinja2\nimport json\nimport markdown\nimport os\nimport logging\n\nlog = logging.getLogger('mkdocs')\n\n\ndef convert_markdown(markdown_source, site_navigation=None, extensions=(), strict=False):\n    \"\"\"\n    Convert the Markdown source file to HTML content, and additionally\n    return the parsed table of contents, and a dictionary of any metadata\n    that was specified in the Markdown file.\n\n    `extensions` is an optional sequence of Python Markdown extensions to add\n    to the default set.\n    \"\"\"\n\n    # Generate the HTML from the markdown source\n    builtin_extensions = ['meta', 'toc', 'tables', 'fenced_code']\n    mkdocs_extensions = [RelativePathExtension(site_navigation, strict), ]\n    extensions = builtin_extensions + mkdocs_extensions + list(extensions)\n    md = markdown.Markdown(\n        extensions=extensions\n    )\n    html_content = md.convert(markdown_source)\n    meta = md.Meta\n    toc_html = md.toc\n\n    # Post process the generated table of contents into a data structure\n    table_of_contents = toc.TableOfContents(toc_html)\n\n    return (html_content, table_of_contents, meta)\n\n\ndef get_global_context(nav, config):\n    \"\"\"\n    Given the SiteNavigation and config, generate the context which is relevant\n    to app pages.\n    \"\"\"\n\n    site_name = config['site_name']\n\n    if config['site_favicon']:\n        site_favicon = nav.url_context.make_relative('/' + config['site_favicon'])\n    else:\n        site_favicon = None\n\n    page_description = config['site_description']\n\n    extra_javascript = utils.create_media_urls(nav=nav, url_list=config['extra_javascript'])\n\n    extra_css = utils.create_media_urls(nav=nav, url_list=config['extra_css'])\n\n    return {\n        'site_name': site_name,\n        'site_author': config['site_author'],\n        'favicon': site_favicon,\n        'page_description': page_description,\n\n        # Note that there's intentionally repetition here. Rather than simply\n        # provide the config dictionary we instead pass everything explicitly.\n        #\n        # This helps ensure that we can throughly document the context that\n        # gets passed to themes.\n        'repo_url': config['repo_url'],\n        'repo_name': config['repo_name'],\n        'nav': nav,\n        'base_url': nav.url_context.make_relative('/'),\n        'homepage_url': nav.homepage.url,\n\n        'extra_css': extra_css,\n        'extra_javascript': extra_javascript,\n\n        'include_nav': config['include_nav'],\n        'include_next_prev': config['include_next_prev'],\n        'include_search': config['include_search'],\n\n        'copyright': config['copyright'],\n        'google_analytics': config['google_analytics']\n    }\n\n\ndef get_page_context(page, content, nav, toc, meta, config):\n    \"\"\"\n    Generate the page context by extending the global context and adding page\n    specific variables.\n    \"\"\"\n\n    if page.is_homepage or page.title is None:\n        page_title = None\n    else:\n        page_title = page.title\n\n    if page.is_homepage:\n        page_description = config['site_description']\n    else:\n        page_description = None\n\n    if config['site_url']:\n        base = config['site_url']\n        if not base.endswith('/'):\n            base += '/'\n        canonical_url = urljoin(base, page.abs_url.lstrip('/'))\n    else:\n        canonical_url = None\n\n    return {\n        'page_title': page_title,\n        'page_description': page_description,\n\n        'content': content,\n        'toc': toc,\n        'meta': meta,\n\n\n        'canonical_url': canonical_url,\n\n        'current_page': page,\n        'previous_page': page.previous_page,\n        'next_page': page.next_page,\n    }\n\n\ndef build_404(config, env, site_navigation):\n\n    try:\n        template = env.get_template('404.html')\n    except TemplateNotFound:\n        return\n\n    global_context = get_global_context(site_navigation, config)\n\n    output_content = template.render(global_context)\n    output_path = os.path.join(config['site_dir'], '404.html')\n    utils.write_file(output_content.encode('utf-8'), output_path)\n\n\ndef build_pages(config, dump_json=False):\n    \"\"\"\n    Builds all the pages and writes them into the build directory.\n    \"\"\"\n    site_navigation = nav.SiteNavigation(config['pages'], config['use_directory_urls'])\n    loader = jinja2.FileSystemLoader(config['theme_dir'])\n    env = jinja2.Environment(loader=loader)\n\n    build_404(config, env, site_navigation)\n\n    for page in site_navigation.walk_pages():\n        # Read the input file\n        input_path = os.path.join(config['docs_dir'], page.input_path)\n        try:\n            input_content = open(input_path, 'r').read()\n        except IOError:\n            log.error('file not found: %s' % input_path)\n        if PY2:\n            input_content = input_content.decode('utf-8')\n\n        # Process the markdown text\n        html_content, table_of_contents, meta = convert_markdown(\n            input_content, site_navigation,\n            extensions=config['markdown_extensions'], strict=config['strict']\n        )\n\n        context = get_global_context(site_navigation, config)\n        context.update(get_page_context(\n            page, html_content, site_navigation,\n            table_of_contents, meta, config\n        ))\n\n        # Allow 'template:' override in md source files.\n        if 'template' in meta:\n            template = env.get_template(meta['template'][0])\n        else:\n            template = env.get_template('base.html')\n\n        # Render the template.\n        output_content = template.render(context)\n\n        # Write the output file.\n        output_path = os.path.join(config['site_dir'], page.output_path)\n        if dump_json:\n            json_context = {\n                'content': context['content'],\n                'title': context['current_page'].title,\n                'url': context['current_page'].abs_url,\n                'language': 'en',\n            }\n            utils.write_file(json.dumps(json_context, indent=4).encode('utf-8'), output_path.replace('.html', '.json'))\n        else:\n            utils.write_file(output_content.encode('utf-8'), output_path)\n\n\ndef build(config, live_server=False, dump_json=False, clean_site_dir=False):\n    \"\"\"\n    Perform a full site build.\n    \"\"\"\n    if clean_site_dir:\n        print(\"Cleaning site directory\")\n        utils.clean_directory(config['site_dir'])\n    if not live_server:\n        print(\"Building documentation to directory: %s\" % config['site_dir'])\n        if not clean_site_dir and site_directory_contains_stale_files(config['site_dir']):\n            print(\"Directory %s contains stale files. Use --clean to remove them.\" % config['site_dir'])\n\n    if dump_json:\n        build_pages(config, dump_json=True)\n    else:\n        # Reversed as we want to take the media files from the builtin theme\n        # and then from the custom theme_dir so the custom versions take take\n        # precedence.\n        for theme_dir in reversed(config['theme_dir']):\n            utils.copy_media_files(theme_dir, config['site_dir'])\n        utils.copy_media_files(config['docs_dir'], config['site_dir'])\n        build_pages(config)\n\n\ndef site_directory_contains_stale_files(site_directory):\n    \"\"\"\n    Check if the site directory contains stale files from a previous build.\n    Right now the check returns true if the directory is not empty.\n    A more sophisticated approach should be found to trigger only if there are\n    files that won't be overwritten anyway.\n    \"\"\"\n    if os.path.exists(site_directory):\n        if os.listdir(site_directory):\n            return True\n    return False\n", "path": "mkdocs/build.py"}], "after_files": [{"content": "# coding: utf-8\nfrom __future__ import print_function\n\nfrom datetime import datetime\n\nfrom jinja2.exceptions import TemplateNotFound\nimport mkdocs\nfrom mkdocs import nav, toc, utils\nfrom mkdocs.compat import urljoin, PY2\nfrom mkdocs.relative_path_ext import RelativePathExtension\nimport jinja2\nimport json\nimport markdown\nimport os\nimport logging\n\nlog = logging.getLogger('mkdocs')\n\n\ndef convert_markdown(markdown_source, site_navigation=None, extensions=(), strict=False):\n    \"\"\"\n    Convert the Markdown source file to HTML content, and additionally\n    return the parsed table of contents, and a dictionary of any metadata\n    that was specified in the Markdown file.\n\n    `extensions` is an optional sequence of Python Markdown extensions to add\n    to the default set.\n    \"\"\"\n\n    # Generate the HTML from the markdown source\n    builtin_extensions = ['meta', 'toc', 'tables', 'fenced_code']\n    mkdocs_extensions = [RelativePathExtension(site_navigation, strict), ]\n    extensions = builtin_extensions + mkdocs_extensions + list(extensions)\n    md = markdown.Markdown(\n        extensions=extensions\n    )\n    html_content = md.convert(markdown_source)\n    meta = md.Meta\n    toc_html = md.toc\n\n    # Post process the generated table of contents into a data structure\n    table_of_contents = toc.TableOfContents(toc_html)\n\n    return (html_content, table_of_contents, meta)\n\n\ndef get_global_context(nav, config):\n    \"\"\"\n    Given the SiteNavigation and config, generate the context which is relevant\n    to app pages.\n    \"\"\"\n\n    site_name = config['site_name']\n\n    if config['site_favicon']:\n        site_favicon = nav.url_context.make_relative('/' + config['site_favicon'])\n    else:\n        site_favicon = None\n\n    page_description = config['site_description']\n\n    extra_javascript = utils.create_media_urls(nav=nav, url_list=config['extra_javascript'])\n\n    extra_css = utils.create_media_urls(nav=nav, url_list=config['extra_css'])\n\n    return {\n        'site_name': site_name,\n        'site_author': config['site_author'],\n        'favicon': site_favicon,\n        'page_description': page_description,\n\n        # Note that there's intentionally repetition here. Rather than simply\n        # provide the config dictionary we instead pass everything explicitly.\n        #\n        # This helps ensure that we can throughly document the context that\n        # gets passed to themes.\n        'repo_url': config['repo_url'],\n        'repo_name': config['repo_name'],\n        'nav': nav,\n        'base_url': nav.url_context.make_relative('/'),\n        'homepage_url': nav.homepage.url,\n\n        'extra_css': extra_css,\n        'extra_javascript': extra_javascript,\n\n        'include_nav': config['include_nav'],\n        'include_next_prev': config['include_next_prev'],\n        'include_search': config['include_search'],\n\n        'copyright': config['copyright'],\n        'google_analytics': config['google_analytics'],\n\n        'mkdocs_version': mkdocs.__version__,\n        'build_date_utc': datetime.utcnow()\n    }\n\n\ndef get_page_context(page, content, nav, toc, meta, config):\n    \"\"\"\n    Generate the page context by extending the global context and adding page\n    specific variables.\n    \"\"\"\n\n    if page.is_homepage or page.title is None:\n        page_title = None\n    else:\n        page_title = page.title\n\n    if page.is_homepage:\n        page_description = config['site_description']\n    else:\n        page_description = None\n\n    if config['site_url']:\n        base = config['site_url']\n        if not base.endswith('/'):\n            base += '/'\n        canonical_url = urljoin(base, page.abs_url.lstrip('/'))\n    else:\n        canonical_url = None\n\n    return {\n        'page_title': page_title,\n        'page_description': page_description,\n\n        'content': content,\n        'toc': toc,\n        'meta': meta,\n\n\n        'canonical_url': canonical_url,\n\n        'current_page': page,\n        'previous_page': page.previous_page,\n        'next_page': page.next_page,\n    }\n\n\ndef build_404(config, env, site_navigation):\n\n    try:\n        template = env.get_template('404.html')\n    except TemplateNotFound:\n        return\n\n    global_context = get_global_context(site_navigation, config)\n\n    output_content = template.render(global_context)\n    output_path = os.path.join(config['site_dir'], '404.html')\n    utils.write_file(output_content.encode('utf-8'), output_path)\n\n\ndef build_pages(config, dump_json=False):\n    \"\"\"\n    Builds all the pages and writes them into the build directory.\n    \"\"\"\n    site_navigation = nav.SiteNavigation(config['pages'], config['use_directory_urls'])\n    loader = jinja2.FileSystemLoader(config['theme_dir'])\n    env = jinja2.Environment(loader=loader)\n\n    build_404(config, env, site_navigation)\n\n    for page in site_navigation.walk_pages():\n        # Read the input file\n        input_path = os.path.join(config['docs_dir'], page.input_path)\n        try:\n            input_content = open(input_path, 'r').read()\n        except IOError:\n            log.error('file not found: %s' % input_path)\n        if PY2:\n            input_content = input_content.decode('utf-8')\n\n        # Process the markdown text\n        html_content, table_of_contents, meta = convert_markdown(\n            input_content, site_navigation,\n            extensions=config['markdown_extensions'], strict=config['strict']\n        )\n\n        context = get_global_context(site_navigation, config)\n        context.update(get_page_context(\n            page, html_content, site_navigation,\n            table_of_contents, meta, config\n        ))\n\n        # Allow 'template:' override in md source files.\n        if 'template' in meta:\n            template = env.get_template(meta['template'][0])\n        else:\n            template = env.get_template('base.html')\n\n        # Render the template.\n        output_content = template.render(context)\n\n        # Write the output file.\n        output_path = os.path.join(config['site_dir'], page.output_path)\n        if dump_json:\n            json_context = {\n                'content': context['content'],\n                'title': context['current_page'].title,\n                'url': context['current_page'].abs_url,\n                'language': 'en',\n            }\n            utils.write_file(json.dumps(json_context, indent=4).encode('utf-8'), output_path.replace('.html', '.json'))\n        else:\n            utils.write_file(output_content.encode('utf-8'), output_path)\n\n\ndef build(config, live_server=False, dump_json=False, clean_site_dir=False):\n    \"\"\"\n    Perform a full site build.\n    \"\"\"\n    if clean_site_dir:\n        print(\"Cleaning site directory\")\n        utils.clean_directory(config['site_dir'])\n    if not live_server:\n        print(\"Building documentation to directory: %s\" % config['site_dir'])\n        if not clean_site_dir and site_directory_contains_stale_files(config['site_dir']):\n            print(\"Directory %s contains stale files. Use --clean to remove them.\" % config['site_dir'])\n\n    if dump_json:\n        build_pages(config, dump_json=True)\n    else:\n        # Reversed as we want to take the media files from the builtin theme\n        # and then from the custom theme_dir so the custom versions take take\n        # precedence.\n        for theme_dir in reversed(config['theme_dir']):\n            utils.copy_media_files(theme_dir, config['site_dir'])\n        utils.copy_media_files(config['docs_dir'], config['site_dir'])\n        build_pages(config)\n\n\ndef site_directory_contains_stale_files(site_directory):\n    \"\"\"\n    Check if the site directory contains stale files from a previous build.\n    Right now the check returns true if the directory is not empty.\n    A more sophisticated approach should be found to trigger only if there are\n    files that won't be overwritten anyway.\n    \"\"\"\n    if os.path.exists(site_directory):\n        if os.listdir(site_directory):\n            return True\n    return False\n", "path": "mkdocs/build.py"}]}