ultrabug / mkdocs-static-i18n

MkDocs i18n plugin using static translation markdown files
https://ultrabug.github.io/mkdocs-static-i18n/
MIT License
232 stars 39 forks source link

Error: Invalid Plugins configuration #124

Closed sennewood closed 2 years ago

sennewood commented 2 years ago

I got this error after executing mkdocs serve:

INFO     -  Building documentation...
DEBUG    -  Loading configuration file: D:\Dev\R\mkdocs\doku\mkdocs.yml
ERROR    -  Config value: 'plugins'. Error: Invalid Plugins configuration
DEBUG    -  Config value: 'config_file_path' = 'D:\\Dev\\R\\mkdocs\\doku\\mkdocs.yml'
DEBUG    -  Config value: 'site_name' = 'Doku'
DEBUG    -  Config value: 'nav' = [{'Home': 'index.de.md'}, {'About': 'about.de.md'}]
DEBUG    -  Config value: 'pages' = None
DEBUG    -  Config value: 'site_url' = ''
DEBUG    -  Config value: 'site_description' = None
DEBUG    -  Config value: 'site_author' = None
DEBUG    -  Config value: 'theme' = {'name': 'material'}
DEBUG    -  Config value: 'docs_dir' = 'D:\\Dev\\R\\mkdocs\\doku\\docs'
DEBUG    -  Config value: 'site_dir' = 'C:\\Users\\LeMe\\AppData\\Local\\Temp\\mkdocs_1xipo7k0'
DEBUG    -  Config value: 'copyright' = None
DEBUG    -  Config value: 'google_analytics' = None
DEBUG    -  Config value: 'dev_addr' = Address(host='127.0.0.1', port=8000)
DEBUG    -  Config value: 'use_directory_urls' = True
DEBUG    -  Config value: 'repo_url' = ''
DEBUG    -  Config value: 'repo_name' = None
DEBUG    -  Config value: 'edit_uri' = None
DEBUG    -  Config value: 'extra_css' = []
DEBUG    -  Config value: 'extra_javascript' = []
DEBUG    -  Config value: 'extra_templates' = []
DEBUG    -  Config value: 'markdown_extensions' = ['toc', 'tables', 'fenced_code']
DEBUG    -  Config value: 'mdx_configs' = None
DEBUG    -  Config value: 'strict' = False
DEBUG    -  Config value: 'remote_branch' = 'gh-pages'
DEBUG    -  Config value: 'remote_name' = 'origin'
DEBUG    -  Config value: 'extra' = {}
DEBUG    -  Config value: 'plugins' = [{'i18n': None, 'docs_structure': 'suffix', 'default_language': 'de',
            'default_language_only': True, 'material_alternate': False, 'languages': {'en': {'name': 'English', 'build':
            True}, 'de': {'name': 'Deutsch', 'build': True}}}]
DEBUG    -  Config value: 'watch' = None
Aborted with 1 Configuration Errors!

I'm new to MkDocs and this plugin. I just installed the packages via pip, renamed the files to *.de.md and wrote this config:

site_name: Doku

theme:
  name: material

nav:
  - Home: index.de.md
  - About: about.de.md

plugins:
  - i18n:
    docs_structure: suffix
    default_language: de
    default_language_only: true
    material_alternate: false
    languages:
      en:
        name: English
        build: true
      de:
        name: Deutsch
        build: true

Python: 3.10.5

Pip-Packages:

mkdocs==1.3.1
mkdocs-material==8.3.9
mkdocs-material-extensions==1.0.3
mkdocs-static-i18n==0.46

Any idea what's wrong?

ultrabug commented 2 years ago

Hello @sennewood and welcome to the MkDocs+i18n world :hugs:

I guess you're missing an indentation level below the i18n key:

It should be:

site_name: Doku

theme:
  name: material

nav:
  - Home: index.de.md
  - About: about.de.md

plugins:
  - i18n:
      docs_structure: suffix
      default_language: de
      default_language_only: true
      material_alternate: false
      languages:
        en:
          name: English
          build: true
        de:
          name: Deutsch
          build: true
sennewood commented 2 years ago

-.-

Thank you :)

ultrabug commented 2 years ago

Sure, remember to show your :heart: to projects with a simple :star: , it means a lot to us!