Repository: mkdocs/mkdocs

Issue:
Cant override base.html
## Description

Iv'e tried to override base.html as per the instructions but all I get is:

```
AttributeError: 'Theme' object has no attribute 'name'
```

### Expected behavior

It should just work.

### Actual behavior

```
AttributeError: 'Theme' object has no attribute 'name'
```

### Steps to reproduce the bug

1. Add a custom_dir to the mkdocs.yml
2. Create the directory specified in custom_dir 
3. Copy base.html from material theme source to custom dir
4. Modify base.html
5. Build or Serve

### Package versions

* Python: 3.7.4
* MkDocs: 1.0.4
* Material: 4.4.0

### Project configuration

``` yaml
site_name: xxxxx
nav:
    - Welcome: index.md
    - Setup: setup.md 
    - Documents: docs.md
    - Data: data.md
    - Agent: agent.md
    - About: about.md
theme: 
  name: 'material'
  custom_dir: 'theme'
  palette:
    primary: 'lime'
    accent: 'amber'
  font:
    text: 'Roboto'
    code: 'Roboto Mono'
  favicon: 'images/favicon.ico'
extra_css: 
  - 'styles/extra.css'   
#extra_javascript: 
#  - 'scripts/startup.js'
use_directory_urls: false 
site_dir: ../../../src/xxx/src/help
```

### System information

* OS: Windows 10
* Browser: Chrome



Discussion:
Moved this issue from Material theme as it's also failing on standard theme.
Just a guess, but I wonder if using the name `theme` for your `custom_dir` is causing a naming conflict. Try using a different name for the `custom_dir`. If that is the cause, then we should either blacklist that name (and document it) or provide a fix which avoids the conflict. 
Nice guess, but no sorry.  I changed it to theme_customisation, same result.  Have also tried the full theme with name: null.

Here's the full stack trace:
```
Traceback (most recent call last):                                                                                        
File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main    "__main__", mod_spec)                                                                                                 
File "c:\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals)                                                                                               
File "C:\Python37\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
File "c:\python37\lib\site-packages\click\core.py", line 764, in __call__  return self.main(*args, **kwargs)                                                                                     
File "c:\python37\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) 
File "c:\python37\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python37\lib\site-packages\click\core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params)
File "c:\python37\lib\site-packages\click\core.py", line 555, in invoke return callback(*args, **kwargs)
File "c:\python37\lib\site-packages\mkdocs\__main__.py", line 162, in build_command site_dir=site_dir    
File "c:\python37\lib\site-packages\mkdocs\config\base.py", line 197, in load_config errors, warnings = cfg.validate()                                                                                     
File "c:\python37\lib\site-packages\mkdocs\config\base.py", line 115, in validate post_failed, post_warnings = self._post_validate()                                                                    
File "c:\python37\lib\site-packages\mkdocs\config\base.py", line 95, in _post_validate config_option.post_validation(self, key_name=key)                                                                     
File "c:\python37\lib\site-packages\mkdocs\config\config_options.py", line 430, in post_validation format(path=theme_config['custom_dir'], name=self.name))

AttributeError: 'Theme' object has no attribute 'name'                     
```


Also, I've switched to using the squidfunk/mkdocs-material container and it has the same issue.
Thanks for the feedback. I'll need to investigate this when I have some time. I'm in the middle of a move and have limited connectivity right now so it will be a few days at least.
No hurry at my end.  Have fun!
The problem is that it is trying to raise a `ValidationError` as your config is not valid. It would appear that the value you provided to `custom_dir` does not exist as a directory. However, it encounters a error in the code when attempting to create the message which tells you that. It is the second error which you are seeing. If you can point `custom_dir` to a directory which actually exists, the problem will go away for you.

In the meantime, we have a bug to fix. We need to replace `self.name` with `key_name`. Not sure where `self.name` came from [there][1]. And apparently, we need to add a test for this.

[1]: https://github.com/mkdocs/mkdocs/blob/master/mkdocs/config/config_options.py#L459
We already have a [test for this][1]. Not sure how that it not catching the problem.

[1]: https://github.com/mkdocs/mkdocs/blob/master/mkdocs/tests/config/config_options_tests.py#L521

Resolving patch:
diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py
--- a/mkdocs/config/config_options.py
+++ b/mkdocs/config/config_options.py
@@ -456,7 +456,7 @@ def post_validation(self, config, key_name):
 
         if 'custom_dir' in theme_config and not os.path.isdir(theme_config['custom_dir']):
             raise ValidationError("The path set in {name}.custom_dir ('{path}') does not exist.".
-                                  format(path=theme_config['custom_dir'], name=self.name))
+                                  format(path=theme_config['custom_dir'], name=key_name))
 
         config[key_name] = theme.Theme(**theme_config)
 


Test patch: