Motiviation
To avoid sραm
Description
Staticman's maintainer has recommended everyone to use his/her own API instance and stay away from any public instance in the comments of eduardoboucas/staticman#317.
|
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v3/entry/github/{{ site.repository }}/{{ site.staticman.branch }}/comments"> |
Other suggestion and comments
The endpoint is better set via a site parameter in _config.yml. See https://github.com/mmistakes/minimal-mistakes/blob/d6444412c63aea5e47241ef536509fb1bfef4830/_includes/comments.html#L38 for example.
⚠️ To avoid search bots from getting the URL of the API instance (and possibly abusing that), the article Bot block for forms suggests putting that into a separate JS file. For an implementation, you may view, for example, my PR daattali/beautiful-jekyll#521.
I wonder if it's possible to replace jQuery with jQuery slim so as to boost page load speed. However, jQuery slim doesn't include the $.ajax method, which can be replaced by a xmlHttpRequest.
|
$.ajax({ |
|
type: $(this).attr('method'), |
|
url: $(this).attr('action'), |
|
data: $(this).serialize(), |
References
You might find the updated official quick start guide useful.
Motiviation
To avoid sραm
Description
Staticman's maintainer has recommended everyone to use his/her own API instance and stay away from any public instance in the comments of eduardoboucas/staticman#317.
pateskinasy.github.io/_includes/comments.html
Line 37 in a5a062d
Other suggestion and comments
The endpoint is better set via a site parameter in
_config.yml. See https://github.com/mmistakes/minimal-mistakes/blob/d6444412c63aea5e47241ef536509fb1bfef4830/_includes/comments.html#L38 for example.I wonder if it's possible to replace jQuery with jQuery slim so as to boost page load speed. However, jQuery slim doesn't include the
$.ajaxmethod, which can be replaced by axmlHttpRequest.pateskinasy.github.io/_includes/comments-providers/staticman_v2.html
Lines 10 to 13 in 067bd86
References
You might find the updated official quick start guide useful.