GithubHelp home page GithubHelp logo

eduardoboucas / staticman Goto Github PK

View Code? Open in Web Editor NEW
2.4K 43.0 515.0 1.48 MB

๐Ÿ’ช User-generated content for Git-powered websites

Home Page: https://staticman.net

License: MIT License

JavaScript 99.90% Dockerfile 0.10%
static-site-generator jekyll hugo middleman metalsmith

staticman's Introduction

Staticman coverage Build Status JavaScript Style Guide

Static sites with superpowers

Introduction

Staticman is a Node.js application that receives user-generated content and uploads it as data files to a GitHub and/or GitLab repository. In practice, this allows you to have dynamic content (e.g. blog post comments) as part of a fully static website, as long as your site automatically deploys on every push to GitHub and/or GitLab, as seen on GitHub Pages, GitLab Pages, Netlify and others.

It consists of a small web service that handles the POST requests from your forms, runs various forms of validation and manipulation defined by you and finally pushes them to your repository as data files. You can choose to enable moderation, which means files will be pushed to a separate branch and a pull request will be created for your approval, or disable it completely, meaning that files will be pushed to the main branch automatically.

You can download and run the Staticman API on your own infrastructure. The easiest way to get a personal Staticman API instance up and running is to use the free tier of Heroku. If deploying to Heroku you can simply click the button below and enter your config variables directly into Heroku as environment variables.

Deploy

Requirements

  • Node.js 8.11.3+
  • npm
  • A personal access token for the GitHub and/or GitLab account you want to run Staticman with
  • An RSA key in PEM format

Setting up the server on your own infrastructure

NOTE: The below steps are not required if deploying to Heroku. To deploy to Heroku, click the above deploy button and enter your configuration variables in the Heroku Dashboard.

  • Clone the repository and install the dependencies via npm.

    git clone [email protected]:eduardoboucas/staticman.git
    cd staticman
    npm install
    
  • Create a development config file from the sample file.

    cp config.sample.json config.development.json
    
  • Edit the newly-created config file with your GitHub and/or GitLab access token, SSH private key and the port to run the server. Click here for the list of available configuration parameters.

  • Start the server.

    npm start
    

Each environment, determined by the NODE_ENV environment variable, requires its own configuration file. When you're ready to push your Staticman API live, create a config.production.json file before deploying.

Check this guide if you're using Docker.

Setting up a repository

Staticman runs as a bot using a GitHub and/or GitLab account, as opposed to accessing your account using the traditional OAuth flow. This means that you can give it access to just the repositories you're planning on using it on, instead of exposing all your repositories.

To add Staticman to a repository, you need to add the bot as a collaborator with write access to the repository and ask the bot to accept the invite by firing a GET request to this URL:

http://your-staticman-url/v2/connect/GITHUB-USERNAME/GITHUB-REPOSITORY

Site configuration

Staticman will look for a config file. For the deprecated v1 endpoints, this is a _config.yml with a staticman property inside; for v2 endpoints, Staticman looks for a staticman.yml file at the root of the repository.

For a list of available configuration parameters, please refer to the documentation page.

Development

Would you like to contribute to Staticman? That's great! Here's how:

  1. Read the contributing guidelines
  2. Pull the repository and start hacking
  3. Make sure tests are passing by running npm test
  4. Send a pull request and celebrate

Useful links

staticman's People

Contributors

alexwaibel avatar andgineer avatar arthurlacoste avatar badele avatar binarymist avatar chmac avatar curioswati avatar deadlydog avatar doocey avatar eduardoboucas avatar ericbusch avatar firasuke avatar jovil avatar justinkelly avatar lasocial avatar maciek134 avatar ntsim avatar purpleidea avatar silentcomics avatar simonv3 avatar sukiletxe avatar sukima avatar tbodt avatar vincenttam avatar wd15 avatar wes-brooks avatar willymcallister avatar yifanlu avatar zburgermeiszter avatar zongren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

staticman's Issues

Editing a file

Is it possible for staticman to edit an existing file when it submits content?

When submitting to what would be the same file (as the file name is predefined by the form that gets submitted) I get the following error:

{"code":422,"status":"Unprocessable Entity","message":"{\"message\":\"Invalid request.\\n\\n\\\"sha\\\" wasn't supplied.\",\"documentation_url\":\"https://developer.github.com/v3/repos/contents/\"}"}

Which looks like it's a GitHub error complaining about the sha value not being supplied to the API?

Config file generator and encryptor

It would be useful to have a wizard form that requests all the config variables for the staticman.yml and at the end it encrypts the needed fields with the service public key.

As you mentioned there is going to be a defined set of config keys that need to be encrypted.
With this set and the pubkey and the submitted data, it is possible to generate the whole thing in the browser without the need for a service endpoint.

It would help newbies to begin with this service.

Transform support downcase

the email field is your example for md5 hash, and it's commondly used for gravitar. Gravitar only supports lowercase email addresses.
Can you add support for downcase transforms (or watever java calls it)

yaml would be something like this

transforms:
    email: ["downcase", "md5"]

Ignore trailing slash from path field

Hi!

First, thank you for your awesome tool ;) Since a few weeks I have a trouble creating comments on my blog, Staticman creates a branch on my repository, but doesn't create a commit, and when submitting a new comment I have this page:

{

  "code": 422,

  "status": "Unprocessable Entity",

  "message": "{\"message\":\"path contains a malformed path component\",\"errors\":[{\"resource\":\"Commit\",\"field\":\"path\",\"code\":\"invalid\"}],\"documentation_url\":\"https://developer.github.com/v3/repos/contents/\"}"

}

Here is my staticman.yml:

comments:
  path: "_data/comments/"
  allowedFields: ["name", "email", "url", "message", "post_id"]
  allowedOrigins: ["ilphrin.com", "localhost"]
  branch: "master"
  filename: "{fields.name}_{@timestamp}"
  format: "yml"
  generatedFields:
    date:
      type: date
      options:
        format: "timestamp-seconds"
  moderation: true
  name: "ilphrin.com"
  requiredFields: ["name", "email", "message", "post_id"]
  commitMessage: "New comment on the blog"

And here is my form for submitting a comment (I am using Jekyll):

  <form class="ui form" method="POST" action="https://api.staticman.net/v2/entry/Ilphrin/ilphrin.com/master/comments">
    <input name="options[slug]" type="hidden" value="{{ page.slug }}">
    <input name="options[redirect]" type="hidden" value="https://ilphrin.com{{page.url}}">
    <input name="options[origin]" type="hidden" value="https://ilphrin.com" />
    <input type="hidden" name="fields[post_id]" value="{{page.id}}" />
    <div class="ui inverted segment">
      <h2 class="ui dividing header">Commenter</h2>
      <div class="field">
        <div class="three fields">
          <div class="field">
            <label>Nom</label>
            <input name="fields[name]" placeholder="Requis" type="text" required/>
          </div>
          <div class="field">
            <label>Email</label>
            <input name="fields[email]" placeholder="Requis, non publiรฉ" type="email" required/>
          </div>
          <div class="field">
            <label>Lien</label>
            <input name="fields[url]" placeholder="Optionnel" type="text"/>
          </div>
        </div>
      </div>
      <div class="field">
        <label>Allez-y parlez ;)</label>
        <textarea name="fields[message]" placeholder="Requis" required></textarea>
      </div>
      <button class="ui submit button" type="submit" name="submit">Envoyer</button>
    </div>
  </form>

And I couldn't figure out how to fix this issue :/

Support for iFrames with CSRF?

Are there any plans to support iFrame based forms with CSRF tokens? I like the concept but I would certainly like to curb the amount of possible spam by easy to abuse bots.

Document placeholders

Basically I was looking for a way to make filename: give the same output that Jekyll uses to parse posts, i.e. in the format of YEAR-MONTH-DAY-my-title.md so that I could iterate through it easily via {% for post in site.categories.user_posts %} ... etc
The closest I've gotten is {fields.date}-{fields.title} which gives a filename output of:

2016-11-20T21:07:36.028Z-my title.html.md

I was also wondering if you could put in a setting so we can configure the file format, like instead of .md, we could use .html?

Thanks in advance.

Redirect after POST

Correct me if I'm wrong but at the moment you can only implement this via AJAX, right?

How hard would it be to redirect to the page that send the POST or any page for that matter? Maybe we could have a hidden input field with a URL. Then redirect to that URL after the comment has been submitted.

Thank you.

500 Internal server error.

Hey, I keep getting 500 Internal server error for some reason. I've got an odd case where I'm using two repositories for my site; since I wanted to use plugins that aren't allowed with the --safe flag that github-pages uses for Jekyll. So I'm not sure if that's the issue. Basically my movw-0x16 repo is where all the site data is, I then build the site and push that to twentytwoo.github.io.

I've gotten the staticmanapp set up as a collaborator and I checked to see if I was declaring anything twice in my _config.yml, but nope; so I'm unsure as what to do now.

Also, I get redirected to https://api.staticman.net/v1/entry/twentytwoo/movw-0x16/master on send, yet it displays nothing but {}.

Here's my _config.yml:
https://github.com/twentytwoo/movw-0x16/blob/master/_config.yml
And the page with the form:
https://github.com/twentytwoo/movw-0x16/blob/master/_layouts/post.html

Limited number of fields?

Hey, I was wondering if there was a limit on the number of fields that we can use? Since I always keep getting; for example:

[{"code":"INVALID_FIELDS","data":["contact","link"]}]

When I use ~7 or more fields, my POST form is setup like this:

	<form method="POST" action="https://api.staticman.net/v1/entry/twentytwoo/{{ site.github.repo }}/gh-pages">
	  <input name="options[redirect]" type="hidden" value="{{post.url}}">
	  <input name="options[slug]" type="hidden" value="{{page.slug}}">
	  <input class="col-md-2 col-xs-12" name="fields[title]" type="text" placeholder="Startpage title">
	  <input class="col-md-2 col-xs-12" name="fields[author]" type="text" placeholder="Author">
	  <input class="col-md-2 col-xs-12" name="fields[contact]" type="text" placeholder="Contact (optional)">
	  <input class="col-md-6 col-xs-12" name="fields[description]" type="text" placeholder="Short description of your startpage.">
	  <input class="col-md-6 col-xs-12" name="fields[image]" type="text" placeholder="Screenshot image URL">
	  <input class="col-md-6 col-xs-12" name="fields[link]" type="text" placeholder="Link to your site (optional)">
	  <textarea class="col-md-12 col-xs-12" name="fields[source]" placeholder="Your startpage code here."></textarea>
	  <button class="col-md-1 col-xs-12" type="submit" style="margin-bottom: 2px;">Submit</button>
	</form>

And a snippet of my _config.yml:

# Staticman
staticman:
  allowedFields: ['title','author','contact','description','image','link','source']
  branch: 'gh-pages'
  commitMessage: "New startpage submission."
  filename: submission-{@timestamp}
  format: 'yaml'
  moderation: true
  path: "submissions/_posts/{options.slug}"
  requiredFields: ['title','author','description','image','source']

Endpoints for repos within organization

My repo is there at
https://github.com/mantrayatra/mantrayatra.com

What must be the POST endpoint? (Note my user name kishaningithub is NOT there in the github repo URL since its tied to an organisation)
For authentication the following worked :-)
https://api.staticman.net/v2/connect/mantrayatra/mantrayatra.com

But for form submission i am unable to decipher the URL
I tried all these but no luck :-(
https://api.staticman.net/v2/entry/mantrayatra/mantrayatra.com/master/
https://api.staticman.net/v2/entry/kishaningithub/mantrayatra/mantrayatra.com/master/
https://api.staticman.net/v2/entry/kishaningithub/mantrayatra.com/master/

So what is the form POST URL ?

Unknown Error

Whenever I attempt to post (the way an end-user would), the api.staticman.net website responds with

{}

The submission doesn't get created.
Thanks in advanced.

Heroku Application Error

Your main server is down -- it doesn't respond to

  • new posts
  • adding it as a collaborator

Heroku responds with
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.

{} and 500 response

I setup two test repos. on on an account with uppercase in the path and one with out. both with the example config for v2.
when trying to post I get a page with { } with a resonse of 500, and no PR

https://github.com/bladefirelight2/staticmantest

<form action="https://api.staticman.net/v2/entry/bladefirelight2/staticmantest/master/comments" method="POST">
   <input name="options[origin]" type="hidden" value="http://localhost:4000/test.html"> 
  <input name="options[slug]" type="hidden" value="">
  <label><input name="fields[name]" type="text">Name</label>
  <label><input name="fields[email]" type="email">E-mail</label>
  <label><textarea name="fields[message]"></textarea>Message</label>
  
  <button type="submit">Go!</button>
</form>

https://github.com/BladeFireLight/staticmantest

<form action="https://api.staticman.net/v2/entry/BladeFireLight/staticmantest/master/comments" method="POST">
   <input name="options[origin]" type="hidden" value="http://localhost:4000/test.html"> 
  <input name="options[slug]" type="hidden" value="">
  <label><input name="fields[name]" type="text">Name</label>
  <label><input name="fields[email]" type="email">E-mail</label>
  <label><textarea name="fields[message]"></textarea>Message</label>
  
  <button type="submit">Go!</button>
</form>

Support counters on posts

It might useful to add the ability for users to increment or decrement a set of specified counter fields for a specific comment or post. For instances:

comments:
  allowedFields: ['name', 'email', 'url', 'message']
  branch: "master"
  commitMessage: "New comment."
  filename: comment-{@timestamp}
  format: "yml"
  moderation: true
  path: "_data/comments/{options.slug}"
  requiredFields: ['name', 'email', 'message']
  transforms:
    email: "md5"
  counters:
  - name: "vote"
    field: "votes"
    operation: "increment"

Then, every time the endpoint https://api.staticman.net/v2/entry/user/project/master/comments/{id}/vote is called it updates the value of the votes property in the file for the comment, as oppose to creating an entirely new file.

Before:

name: 'Bob Smith'
email: '...'
message: '...'
votes: 0

After:

name: 'Bob Smith'
email: '...'
message: '...'
votes: 1

Precise docker install

Dear Eduardo and @zburgermeiszter first of all thank you very much for such a great product. We would like to set up own staticman on DigitalOcean droplet and own domain. Unfortunately, we have no admin with Docker knowledge so, we would like to ask for very precise docker install guide (step by step) to make painless install (with all config nuances) . We did before docker installs with other software (discourse forum) but they have very much step by step guide - https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md. Do you have something similar or close to that instruction?
Thanks
Dennis

Add better support for other static site generators

Currently, Staticman will look for a _config.yml configuration file on the root of the repository, which is specific to Jekyll.

I'd like us to support other engines, so I see two options:

  1. Allow requests to specify the path to the configuration file within the options object (ugly, potential security issues?)
  2. Move the staticman config block to its own file

Option 2 seems more appropriate, but what should the name for the new config file be? Jekyll doesn't include files prefixed with an underscore in the generated site โ€” is this a convention used by other engines as well? If not, is there a filename we could use that would cause this effect in all (or, at least, in the majority) of engines?

@biilmann would you be able to advise on this?

(As a side note, this will be a breaking change, so I'll have to release a v2endpoint for entries)

Time stamping entries

Is there a preferred way to capture the datetime of an entry? Noticed there's a {@timestamp} placeholder in the documentation but couldn't figure out how to use that for capturing comment data.

I'm looking to get .yml datafiles something like this to iterate on and spit out in my Jekyll layouts:

name: Your Name
date: 2015-06-26T04:39:00-04:00   #comment timestamp
email:   #MD5 hash
url:
message: "Your message."

Thanks!

Markdown support

First I want to say this project is amazing and thank you for it. One of the first things that came to mind when I heard about it is the possibility to make an open publishing kind of blog/platform out of it. In fact I'm doing that right now. I want to point the path in a Jekyll blog to _posts/ and see if i can make this work such that the form generates markdown files with a few markdown fiels at the top. I guess to make that work ideally we'd need support for markdown as well, not just YAML and JSON, right?
How easy would that be to build in? I'm interested in contributing though I'm mostly a begginner javascript dev.

frontmatterContent field is not working on production server

Using the next options in api.staticman.com doesn't work as expected

format: frontmatter
transforms:
  mdfield: "frontmatterContent"

It generates a field where the mdfield is included in the yaml block instead of the content area of the markdown file.

Additional random behaviors:

Extra fields added:

layout: verslag
excerpt_separator: <!--more-->

If the field is optional and not filled out the content area of the markdown file is generated as undefined

In dev.staticman.com

Only when the field is empty it generates undefined in the content area, the other option works correctly

"Error" when adding staticmanapp as collaborator

I ran https://api.staticman.net/v1/connect/velddev/agdg.me to get staticmanapp to become a collab., all I get is Error, I even forked it and used my own username to auth it, but it still just prompts Error. So staticmanapp is just pending as of now.

I have staticman working on my own site, and I never had an issue at this stage with it; so I don't understand what's up with it at the moment :(

Delete branches created by Staticman

Currently, branches created by Staticman need to be deleted manually, which is a bit of a pain.

We could add a webhook that would allow us to detect every time a pull request created by the bot is either merged or closed, and we could delete the associated branch at that point.

Should we ask people to manually set up this webhook, or should we set it up for them when they run connect? I like how the second option is automated, but isn't it a bit intrusive as well?

Any thoughts welcome.

EDIT: Actually, ignore the second option, as we'd need admin access to the repos in order to create the hooks, which we obviously don't want.

What are all the options?

I see references to options to submit in the documentation, but I'm not sure what they all are.

Is there a difference between options and fields?

If I supply {options.slug} in my filename field in staticman.yml, do I have to actually pass an options.slug to the submission or is this automatically generated?

Fix line-break formatting in pull requests

I just got this PR from staticman: klundberg/klundberg.com#4


~~~I apologize if this already exists and I don't have my site properly configured, but when I set things up I didn't see anything along these lines of only allowing specific form fields to be sent.~~~

My mistake, it's seems like there was no clever spammer behavior here that can be easily prevented. The problem here that confused me appears to be that the line breaks in the message mess up formatting of the PR, which made it look like there were extra form fields added to embed some targeted spam only intended for blog owners. The message in that PR should probably fit entirely inside one markdown table cell, if that's possible to do.

Thank you!

Add pingback support

In wordpress yoh can receive notifications when someone mentions your blogpost.
Here's an interesting post about how to implement pingback for Jekyll

Another

The pingback endpoint could be the Staticman, which is defined in a meta tag, then when someone mention the post on a blog which sends pingbacks, Staticman would simply process it just like a comment.
Easy :)

Sending a pingback is a separate story which has to be implemented in the build script, and won't be supported for those jekyll sites that use github's own builder feature as it does not support plugins.

License?

Hey,
very cool Project.
I didn't see any mention of a license anywhere on the site.

Add better support for Akismet

I'm currently using the honey pot method but around 3-5 spam comments slip through every day. It's not the end of the world to close these out, but it does junk up my Pull Request stream.

In the beginning I got a lot more spam when I had a website field in the comment form. Eventually took that out, but whoever trained the bots to constantly hit my site must have adapted. Now I get Markdown links in there with messages almost always phrased in the same way.

I see Akismet is an option but wasn't sure if that was available to the public instance of Staticman or not. If enabled I could see it pulling out a good bunch of these comments since they seem to follow a common pattern.

If I can get reCAPTCHA working that would probably solve the issue, but having some snags there too.

Encryption for Sensitive Data

Hey guys โ€”

I think a great feature would be to have encryption of sensitive data. Since part of the joy of staticman is the ability to run a website through github, it could be very useful to be able to encrypt certain data coming in from html forms (eg. email addresses of commenters) before they hit github.

Would it be possible to specify a public encryption key in the config file and have staticman encrypt incoming data using the specified key before merging it on github? That way the data is simultaneously both accessible and safe.

Just an idea!! Awesome little service, Staticman.

-A

Docker support

To help people who want to run it in a Docker container, I sent a pull request.

It is suggested to configure a Docker Hub automated build.

Multiple instances on the Same Site

Enhancement

Currently there is support for only one instance of Staticman per static site since the staticman property is a hash in the configuration file. For instance _config.yml:

staticman:
  name          : "comments"
  allowedFields : ['name', 'email', 'url', 'message']
  branch        : "master"
  commitMessage : "New comment."
  filename      : comment-{@timestamp}
  format        : "yml"
  moderation    : true
  path          : "_data/comments/{options.slug}"
  requiredFields: ['name', 'email', 'message']
  transforms:
    email       : "md5"

I am wondering if more than one configuration could be specified if the staticman property could be an array. Each hash in the array, requires an additional property name, and in the submitted form, we must pass an additional required field options[name] with the corresponding name value so that the server can know which instance to use. This would be backward compatibility, since if the staticman property is a hash, it behaves like it does in the current version, and if it is an array, it enables this new behaviour. For example:

staticman:

  - name          : "ideas"
    allowedFields : ['title', 'description']
    branch        : "master"
    commitMessage : "New idea."
    filename      : idea-{@timestamp}
    format        : "yml"
    moderation    : true
    path          : "_data/ideas/{options.slug}"
    requiredFields: ['title', 'description']

  - name          : "comments"
    allowedFields : ['name', 'email', 'url', 'message']
    branch        : "master"
    commitMessage : "New comment."
    filename      : comment-{@timestamp}
    format        : "yml"
    moderation    : true
    path          : "_data/comments/{options.slug}"
    requiredFields: ['name', 'email', 'message']
    transforms:
      email       : "md5"
<form method="POST" action="https://api.staticman.net/v1/entry/my/repo/master">
  <input name="options[name]" type="hidden" value="ideas">
  <input name="options[slug]" type="hidden" value="{{ page.slug }}">
  <label><input name="fields[title]" type="text">Title</label>
  <label><textarea name="fields[description]"></textarea>Description</label>
  <button type="submit">Submit Idea!</button>
</form>

<form method="POST" action="https://api.staticman.net/v1/entry/my/repo/master">
  <input name="options[name]" type="hidden" value="comments">
  <input name="options[slug]" type="hidden" value="{{ page.slug }}">
  <label><input name="fields[name]" type="text">Name</label>
  <label><input name="fields[email]" type="email">E-mail</label>
  <label><textarea name="fields[message]"></textarea>Message</label>
  <button type="submit">Submit Comment!</button>
</form>

Add support for ReCaptcha

Might be a good idea if support for recaptcha is added. Might serve as another layer of protection against spam bots.

Nested comments with Reply to support.

Please investigate how nested comments can be supported, so that commenters can reply to older comments.

I can think this can be achieved if each comment stores the id (timestamp) of its parent comment and itself.

Add auto-generated fields to documentation

I'm working on getting staticman setup on my blog now and was surprised to find that _id, date, and timestamp were all added to a submission by default. When I noticed this, I went to https://staticman.net/docs/configuration to look for an explanation but couldn't find one. I'd suggest adding this info to the top of that page, so the various references to @id and @timestamp further down that page make sense once you get to them.

I had considered adding this info myself and submitting it as proposal via a pull request, but I don't really understand what values are added, or why. For example:

  1. Why does _id start with an underscore when timestamp does not?
  2. Was timestamp added because I referenced it in the filename config?
  3. Why was date added? I can't find any reason to explain that. I disabled the generatedFields option, but that only changed the format from a number to an iso8601 string.

Cann't hook up my forms

Follow the document at https://staticman.net/docs/index.html.

Step 1. Add Staticman to your repository SUCCEED.
image

Step 2. Add Staticman to your Jekyll config file, here is my _config.yml https://github.com/gncavalry/gncavalry.github.io/blob/master/_config.yml

Then I tried to submit a comment at page https://gncavalry.github.io/test/ , but failed.
According to the browser consol , it says :"Failed to load resource: the server responded with a status of 500 ()"

image

Then, I use PostMan to do this step and got returned errorCode :"MISSING_PARAMS". (But I have post all three require fileds .)
image

My project is fork form mmistakes/minimal-mistakes , here is my comments.hmtl: https://github.com/gncavalry/gncavalry.github.io/blob/master/_includes/comments.html
I have never changed it , and It's filelds name is correct
image

I'm dicussing this question with Michael Rose at this issue mmistakes/minimal-mistakes#503 , but have no answer.

So, could you help me to figure it out ? Thank you very much.

This is my test page: https://gncavalry.github.io/test/

Email notification upon replies

Usually commenting solutions allow for users to be notified via email about replies to their comments, or in case of a flat commenting stream when anyone posts a new comment. Is it possible to do this with staticman?

Add labels in the example form

Currently, the example form lacks labels in the fields. This makes it harder for screen readers to use the form.
Solution:

  • Add a id to each field.
  • Add a <label> element with the for attribute being the same as the id for each field The text of the element is the label.

This is not applicable to the submit button.

Demo URLs

It'd be nice to see websites where this is actually used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.