eduardoboucas / staticman

💪 User-generated content for Git-powered websites
https://staticman.net
MIT License
2.41k stars 541 forks source link

NO_FRONTMATTER_CONTENT_TRANSFORM when format: "frontmatter" #376

Open fedetask opened 4 years ago

fedetask commented 4 years ago

I am receiving this error NO_FRONTMATTER_CONTENT_TRANSFORM when trying to post comments. My staticman configuration has the followings:

format: "frontmatter"
transforms:
    email: "md5"

The form that sends the comment is the following:

<form id="contact" method="POST" action="https://campusai-staticman.herokuapp.com/v2/entry/campusai/campusai.github.io/comments/comments">
<fieldset>
<input name="options[slug]" type="hidden" value="{{ page.name }}">
<label><input name="fields[name]" type="text" placeholder="Your name" tabindex="1"
              required autofocus style="width: 49.5%; margin: 0 1% 0 0"></label>
<label><input name="fields[email]" type="email" placeholder="Your email" tabindex="2"
              style="width: 49.5%; margin: 0 0 0 0 px;"></label>
</fieldset>

<fieldset>
<label><textarea name="fields[message]" placeholder="Leave a message here" tabindex="3"
              required></textarea></label>
</fieldset>

<fieldset>
<button name="submit" type="submit" id="contact-submit">Leave a comment</button>
</fieldset>
</form>

As you can see, the email field that should be transformed is sent. Moreover, if I set

format: "yaml"

the issue doesn't appear

tikicoder commented 4 years ago

under transform you need to identify what field is the content so under transforms I would add message: frontmatterContent