ultrabug / mkdocs-static-i18n

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

Config value 'plugins': Plugin 'i18n' option 'languages': Expected a list of items, but a <class 'dict'> was given. #250

Closed Chen-Luan closed 11 months ago

Chen-Luan commented 11 months ago

Two months ago, I successfully deployed a webpage on GitHub Pages using this plugin. Today, when I modified the webpage, Action reported an error. My webpage can be deployed and browsed locally, but it cannot be deployed to GitHub Pages.

GitHub Actions:

Run mkdocs gh-deploy --force
mkdocs gh-deploy --force
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/Chen-Luan/Knowledge_Sharing_Library/actions/runs/6050283095/job/16419272709#step:7:3).11.[4](https://github.com/Chen-Luan/Knowledge_Sharing_Library/actions/runs/6050283095/job/16419272709#step:7:4)/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib
    cache_id: 3[5](https://github.com/Chen-Luan/Knowledge_Sharing_Library/actions/runs/6050283095/job/16419272709#step:7:5)

ERROR   -  Config value 'plugins': Plugin 'i1[8](https://github.com/Chen-Luan/Knowledge_Sharing_Library/actions/runs/6050283095/job/16419272709#step:7:8)n' option 'languages': Expected a list of items, but a <class 'dict'> was given.

Aborted with 1 configuration errors!
Error: Process completed with exit code 1.

ci.yml:

name: ci 
on:
  push:
    branches:
      - master 
      - main
permissions:
  contents: write
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.x
      - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV 
      - uses: actions/cache@v3
        with:
          key: mkdocs-material-${{ env.cache_id }}
          path: .cache
          restore-keys: |
            mkdocs-material-
      - run: pip install \
          mkdocs-material \
          mkdocs-static-i18n \
          mkdocs-git-revision-date-localized-plugin
      - run: mkdocs gh-deploy --force
kamilkrzyskow commented 11 months ago

The new version 1.0.0 of the plugin requires a different configuration setup. There is a migration tool provided: https://ultrabug.github.io/mkdocs-static-i18n/setup/upgrading-to-1/

You can also modify your ci.yml to stick to the older version for now if you don't require new features: Change mkdocs-static-i18n \ to mkdocs-static-i18n==0.56 \ as per the version history: https://pypi.org/project/mkdocs-static-i18n/#history