Skip to content

Plz use your own Staticman instance #182

@VincentTam

Description

@VincentTam

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions