mkdocs-git-revision-date-localized-plugin: Unable to set any configurations

Description

Using git-revision-date-localized-plugin along with “Material for Mkdocs”. I was asked to raise this issue here as they do not believe it is related to Material: https://github.com/squidfunk/mkdocs-material/issues/4697#issuecomment-1332558500.

The plugin works when no settings are assigned in the mkdocs.yml file, i.e.:

plugins:
  - git-revision-date-localized

Shows correctly the last revision date in the webpages.

However, as soon as I add any custom setting, e.g.:

plugins:
  - git-revision-date-localized:
      enable_creation_date: true

The build fails, and this error is returned:

ERROR    -  Config value 'plugins': Invalid Plugins configuration
Aborted with 1 Configuration Errors!

For me this happens consistently regardless of any other plugin/extension/custom css/etc.

Note that this happens even if you set a configuration to its own default value, e.g.:

plugins:
  - git-revision-date-localized:
      type: date

which may indicate an incorrect parsing of the configurations?

Steps to reproduce

  1. Install git-revision-date-localized via pip
  2. Configure it in the yml file without any configuration
  3. Build the website locally
  4. Verify that it builds
  5. Add any configuration to git-revision-date-localized in the yml file
  6. Verify that build fails

Package versions

  • Python: 3.10.8
  • MkDocs: 1.4.2
  • Material: 8.5.10 (I’m on Windows and running grep is not an option – just noting it 😄)

Configuration

site_name: BHoM documentation
site_url: https://bhom.xyz/documentation/
repo_url: https://github.com/BHoM/documentation
edit_uri: edit/main/docs/

theme:
  name: material

plugins:
  - git-revision-date-localized: #uncommenting any of the lines below makes the build fail.
    # fallback_to_build_date: false
    # enable_creation_date: true
    # type: date

System information

  • Operating system: Windows 10
  • Browser: Chrome

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Hi, I’m getting exactly the same error from this action: https://github.com/dcaddick/gsd_public/actions/runs/3937319131 image

Installing this Plugin is fine, no prob at all. But once it reaches the “enablement” phase of adding the hook by reading the mkdocs.yml file Copy of my config from this file here: https://github.com/dcaddick/gsd_public/blob/main/mkdocs.yml

Once enabled as below, it will fail every time, if I comment out the Plugin it’ll work fine

Relevant snip:

# Plugins
plugins:
  - search
  - simple
  #- git-authors:
  #      exclude:
  #          - index.md
  - git-revision-date-localized
  #    type: timeago
  #    timezone: Europe/Amsterdam
  #    locale: en
  #    fallback_to_build_date: false
  #    enable_creation_date: true
  #- glightbox
  #- social
  #- awesome-list
  #- table-reader
  #- img2fig
  #- mermaid2
  #- macros
  #- minify

See the note on using build systems in the README, you need to set your fetch depth to 0

Oh Great! Thanks. I figured out my error. My fetch-depth was wrongly positioned in the ci.yml file. Now it has corrected the build and creation dates.

Closing the issue as I can’t reproduce

Thanks Tim,

Any suggestions on a better alternative that does fully support the git elements?

Regards, DaveC

@dcaddick your issue is another one. From your link I could deduce you are using https://github.com/athackst/mkdocs-simple-plugin. Please see their documentation on how to properly install plugins. Secondly, mkdocs-simple-plugin does not document which plugins are not supported. Because it copies all content to a /tmp directory, but does not copy the .git folder, all git-based plugins will not work. Please find more information in the issue: https://github.com/athackst/mkdocs-simple-plugin/issues/466

@alelom I will need to setup a development environment on a windows machine to be able to try and reproduce the error. Not a high priority for me tbh…