Skip to content

Staticman v2 provider configuration inconsistency #2386

Closed
@travisdowns

Description

@travisdowns

Environment

  • Minimal Mistakes version: 4.18.1
  • Ruby gem or remote theme version: jekyll-remote-theme (0.4.1)
  • Jekyll version: 3.8.5
  • Git repository URL: http://github.com/travisdowns/mm-test
  • Operating system: Linux

Expected behavior

The staticman configuration implementation and doc seems a bit inconsistent. The configuration doc shows that the branch key should be nested under comments, i.e., at site.comments.staticman.branch:

image

However, in the template _config.yml in master, staticman is not nested under comments, but at the top level:

image

I believe this is the way it was supposed to work for staticman v1, because the staticman API bridge lookins in _config.yml for it's own configuration parameters.

However, for v2, this stuff goes in a separate staticman.yml file. So the actual bug I find is that in the staticman_v2 provider, it is checking the not-nested site.staticman.branch, rather than site.comments.staticman.branch:

image

This means if you configure staticman v2, it will be missing the javascript associated with form submission. As it turns out, comment submission will still go through, but you end up getting redirected to the JSON results page of the API bridge, because the default action is to do that, when the JS is missing, I guess.

Suggested fix:

  1. Change site.staticman.branch to site.comments.staticman.branch in the v2 provider.
  2. Clarify the documentation and default config.yml where to put the staticman stuff depending on the version. Include nested under comments the v2 configuration for staticman.

Workaround:

To get the comments working in the meantime, you can just include a redundant staticman.branch key at the top level so the check in the v2 provider passes, which is what I'm doing:

comments:
  provider: "staticman_v2"
  staticman:
    branch: "master"
    endpoint: https://staticman-travisdownsio.herokuapp.com/v2/entry/

# redundant, needed only as workaround for provider_v2.html bug
staticman:
  branch: "master"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions